Hi4ko's blog

By Hi4ko, 14 years ago, translation, In English

Problem #1036 I've already got some help, Thanks :)

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
14 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

You are not initialising ar[i][j]=0. Since you are declaring the array inside your main function, the initial values might be garbage. So start with declaring long long ar[51][1001]; as a global array or set ar[i][j]=0 inside your loop

»
14 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

The answer might not fit in long long.

  • »
    »
    14 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    Hi, SamanSami is right, I tried here with ull and got WA on test case #8, then I changed to bignum and got accepted.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Use BigInteger....