|  | 
|  | 
| back to board | Why WA5? The code is here: I have tested this code many times, it answers to all my tests correctly.
 UPD: AC now !!!
 Bug was here:
 for (i = 1; i <= n; ++i)
 {
 for (j = 1; j < POW; ++j)
 {
 up[i][j]=up[up[i][j - 1]][j - 1];
 }
 }
 must be:
 for (j = 1; j < POW; ++j)
 {
 for (i = 1; i <= n; ++i)
 {
 up[i][j]=up[up[i][j - 1]][j - 1];
 }
 }
 
 
 Edited by author 25.04.2013 18:21
 | 
 | 
|