#include "springboard.h"
void Reorder(int N)
{
// PutBall(3); // ��ȯ�� = -1
// PutBall(1); // ��ȯ�� = 1
PutBall(N/2+1);
int dir = PutBall(N/2+1);
for(int i=12; i>=0; i--) // 13
{
if((1<<i) >= N) continue;
if(dir == -1) dir = PutBall((1<<i)+1);
else if(dir == 1) dir = PutBall(N-(1<<i)+1);
}
if(dir == -1)
{
dir = PutBall(1);
if(dir == -1) PutBall(N);
}
else if(dir == 1)
{
dir = PutBall(N);
if(dir == -1) PutBall(1);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1132 KB |
Output is correct |
2 |
Correct |
0 ms |
1132 KB |
Output is correct |
3 |
Correct |
0 ms |
1132 KB |
Output is correct |
4 |
Correct |
0 ms |
1132 KB |
Output is correct |
5 |
Correct |
0 ms |
1132 KB |
Output is correct |
6 |
Incorrect |
0 ms |
1132 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |