I am getting runtime Error on Test 3 while solving this problem 1831C - Copil Copac Draws Trees My submission was this https://codeforces.com/contest/1831/submission/207746010 Can someone plz point out my mistake??
# | User | Rating |
---|---|---|
1 | tourist | 3751 |
2 | Benq | 3727 |
3 | cnnfls_csy | 3691 |
4 | Radewoosh | 3651 |
5 | jiangly | 3632 |
6 | orzdevinwang | 3559 |
7 | -0.5 | 3545 |
8 | inaFSTream | 3478 |
9 | fantasy | 3468 |
10 | Rebelz | 3415 |
# | User | Contrib. |
---|---|---|
1 | adamant | 178 |
2 | awoo | 167 |
3 | BledDest | 165 |
4 | Um_nik | 164 |
5 | maroonrk | 163 |
6 | SecondThread | 160 |
7 | nor | 157 |
8 | -is-this-fft- | 154 |
9 | kostka | 146 |
10 | Geothermal | 144 |
I am getting runtime Error on Test 3 while solving this problem 1831C - Copil Copac Draws Trees My submission was this https://codeforces.com/contest/1831/submission/207746010 Can someone plz point out my mistake??
Name |
---|
memset
sets every byte with the specified value, and int is a 4 byte value. So for instance,memset(mini, 250, sizeof(mini));
would set each element of the array as $$$-84215046$$$ instead of $$$250$$$. These values are used as indices later in your code, leading to out-of-bounds error.Replace memset with a loop to initialize the array elements. That should fix it
thanks
edit: got it now.