Why???

Правка en3, от Omega1, 2015-10-12 17:14:03

Hello to all,today I solve problem A. Greg and Array and I have and misunderstanding: I have two submission,one get accepted and another get wrong answer on test 11.

Accepted

Wrong answer

the difference between this both submission is the line below:

for (i=1;i<=n;i++) dp[i]=dp[i]+dp[i-1];

if I change n with m I get Accepted,Can someone explain me why,I didn't use element on position bigger than m???

I'm very interesting why this happens,because during the contest this mistake can cost me one problem.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский Omega1 2015-10-12 17:16:48 49
en3 Английский Omega1 2015-10-12 17:14:03 49
en2 Английский Omega1 2015-10-12 17:03:44 1 Tiny change: '\nI have to submissi' -> '\nI have two submissi'
en1 Английский Omega1 2015-10-12 16:59:47 679 Initial revision (published)