On Ideone my code ran correctly for the first two Test Cases(Couldn't check for more):
But on Codeforces it's showing Runtime Error for the first Test Case.
Can anyone help?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 170 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 154 |
7 | Dominater069 | 154 |
9 | awoo | 153 |
10 | luogu_official | 152 |
On Ideone my code ran correctly for the first two Test Cases(Couldn't check for more):
But on Codeforces it's showing Runtime Error for the first Test Case.
Can anyone help?
Name |
---|
The return code of the first test of your submission suggests a stack overflow. Try using ints instead of long long ints.
I have used int everywhere.
I'm looking at http://codeforces.net/contest/983/submission/38822395
These occupy 3*5010*5010*sizeof(long long) bytes, which is approximately 574MB. But the stack size is only 256MB (see https://codeforces.net/blog/entry/79). So even if you use int instead of long long, you will need 574/2 = 287 MB, which is still to much.
Try to reuse the matrix f and use int instead of long long