when run my code in my codeblocks ide,it gives perfect ans.. but when I submit it it gives 'uninitiaized value usage' and wrong answere..
my submition:75769281
how can i solve this problem??
№ | Пользователь | Рейтинг |
---|---|---|
1 | ecnerwala | 3649 |
2 | Benq | 3581 |
3 | orzdevinwang | 3570 |
4 | Geothermal | 3569 |
4 | cnnfls_csy | 3569 |
6 | tourist | 3565 |
7 | maroonrk | 3531 |
8 | Radewoosh | 3521 |
9 | Um_nik | 3482 |
10 | jiangly | 3468 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 161 |
4 | TheScrasse | 159 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | SecondThread | 147 |
9 | orz | 146 |
10 | pajenegod | 145 |
when run my code in my codeblocks ide,it gives perfect ans.. but when I submit it it gives 'uninitiaized value usage' and wrong answere..
my submition:75769281
how can i solve this problem??
Название |
---|
Here,I fixed it. https://codeforces.com/contest/1005/submission/75775687
You were doing a[k+1] so the upper bound should be k<n-1 not k<n(a[n] wasn't initialized)
for(int k=0;k<n;k++)
when k = n-1, it's trying to access the data of a[n] insideif(a[k] >= a[k+1])
. a[n] will show a garbage value unless you initialize it.