I am trying Problem . Please Tell me what's wrong in it Submission
Thanks in advanced.
# | 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 | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
I am trying Problem . Please Tell me what's wrong in it Submission
Thanks in advanced.
Name |
---|
Auto comment: topic has been updated by nipul1 (previous revision, new revision, compare).
the issue with your solution is in the part where the current statement is not 'f' and we are not in the base case yet
first : U allow the statement to go left by the indentation no matter what was the previous statement but you can't do this if the previous statement was 'f' as the problem says 'f' have to enclose a statement inside it.
second : when U allow a statement to go left with the indentation U have to stay in this statement as U can do this more than one time and each time will represent different valid indentation for the whole set of statements but in Ur code you do this ans=(ans+solve(index+1,fors-1))%Mod; (index+1 ) is one of ur mistakes here
also I will show the flow of states that get me AC
1- if U have 'f' statement before current statement there is no chance to go left by indentation so go and and add 1 if current is 'f'
2- if there is no 'f' statement right before the current statement, there is 2 cases here
2.1 continue with the same indentation and add 1 to it if current is 'f'
2.2 you can go left by indentation as long as it's > 0 and be careful u will be in the same statement but with different level of indentation
submission : 58186588
Thanks a lot.