I am trying Problem . Please Tell me what's wrong in it Submission
Thanks in advanced.
# | 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 |
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.