Блог пользователя Mehedi33

Автор Mehedi33, 11 лет назад, По-английски
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

the input size if small (the largest factorial you will need is 20!) so here you can generate all the possible factorials and use bitmasking (or recursion) to pre-calculate all possible values and cache them ... then for every case you just output the answer