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

Автор Shuaib, 13 лет назад, По-английски

The book "Programming Challenges" has some very annoying selection of problems from UVa. In the chapter "Dynamic Programming", the second problem is "Distinct subsequences". The problem is simple DP, but the upper limit on possible result is 10^100. How on earth am I suppose to hold such a value in any of the builtin types in C++. I don't think the UVa judge will let me use any external libraries, would it? If not, the problem isn't only DP, it also requires an implementation of some form of BigInt within the solution.


Any ideas how to handle such a situation?

The problem in question is this: Distinct Subsequences
  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится

13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Implement BigInt?
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
just implement it in Java and use its BigInteger built in library.