Getting WA on This problem. My Solution . Can anyone plz suggest me anything to improve it.
# | User | Rating |
---|---|---|
1 | tourist | 3856 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3462 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 160 |
4 | Um_nik | 158 |
5 | atcoder_official | 157 |
6 | Qingyu | 156 |
7 | adamant | 151 |
7 | djm03178 | 151 |
7 | luogu_official | 151 |
10 | awoo | 146 |
Getting WA on This problem. My Solution . Can anyone plz suggest me anything to improve it.
Name |
---|
u made a wrong assumption, try this tc:
1
1
10
0
4
F 0 9
E 0 9
I 0 9
S 0 4
answer for the query should be 5
Many many thanks for this tc. Now i have the bug. i made wrong when flipping. for example when flipping the left child — i used : if(Left.p==0) Left.p=1; if(Left.p==1) Left.p=0; if(Left.p==2) Left.p=-1; if(Left.p==-1) Left.p=2;
But it should be: if(Left.p==0) Left.p=1; else if(Left.p==1) Left.p=0; else if(Left.p==2) Left.p=-1; else if(Left.p==-1) Left.p=2;
& now it's Accepted.. Thanks again.. :)