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

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

Hello, I am solving this problem and

I am getting Wrong answer when submitting my solution even the results are true on my computer

I am getting:

Wrong answer on test 1 for Microsoft visual c++ 2010

Wrong answer on test 9 for GNU c++ 4.9.2

Wrong answer on test 9 for GNU c++11 4.9.2

Even my answer is correct in the three cases

So what could the problem be ?

Теги bug
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

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

try to reset your arrays.

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

I've put larger size(larger than I need) for each array and I got it accepted but I don't know the reason

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

The problem wasn't in compilers, it was in your code :) Look, in the last loop you're using C(i,k). But here i starts from zero while k can be big enough. You just have to use the fact that C(i,k)=0 when k>i: 11176479 — AC.