Could some one help me for finding the error in my submission :-(https://codeforces.me/contest/1092/submission/47307889). Thanks! :)
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Could some one help me for finding the error in my submission :-(https://codeforces.me/contest/1092/submission/47307889). Thanks! :)
Name |
---|
Auto comment: topic has been updated by vivek034 (previous revision, new revision, compare).
Check this slight update to your code.
47347385
Your code should have the if-condition (i > 0 and p[i] == q[i-1]) to avoid accessing q[-1] when i = 0. The updated code did not pass test case 19 as it computed the n-letter string to be "babab" whereas the correct string should be "ababa", as both prefix and suffix of length 1 are "a".
You may check the the following solution as well as the tutorial for hints on how the correct string is computed.
47236313
Thanks got it now I’ll fix the bug in my code.:)
With pleasure.
gaurav172 You must see this code. It must be little familiar to you. #chandela xD