I am trying Problem . Please Tell me what's wrong in it Submission
Thanks in advanced.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
I am trying Problem . Please Tell me what's wrong in it Submission
Thanks in advanced.
Название |
---|
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.