Here is my submission and it gives wrong answer for test case 1. It gives an answer of 8 on Codeforces when I submit and 7 when I run it on PC. Can someone help me with that? http://codeforces.me/problemset/submission/1029/42313945
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | Um_nik | 164 |
2 | maomao90 | 160 |
3 | -is-this-fft- | 159 |
4 | atcoder_official | 158 |
4 | cry | 158 |
4 | awoo | 158 |
7 | adamant | 155 |
8 | nor | 154 |
9 | maroonrk | 151 |
9 | Dominater069 | 151 |
Here is my submission and it gives wrong answer for test case 1. It gives an answer of 8 on Codeforces when I submit and 7 when I run it on PC. Can someone help me with that? http://codeforces.me/problemset/submission/1029/42313945
Name |
---|
Try making your arrays global...
To elaborate, Global variables are initialized to 0 (for integers) or to similar values for other types. If you define an array locally, it is not initalized and can initially contain whatever.