#include "ramen.h"
bool check[410];
void Ramen(int N) {
int i;
int ansx,ansy;
if(N == 1){
Answer(0,0);
return;
}
for(i=0; i+1<N; i+=2){
if(Compare(i,i+1) == 1) check[i] = true;
else check[i+1] = true;
}
if(check[0]) ansy = 0;
else ansy = 1;
if(N%2 == 1) check[N-1] = true;
for(i=2; i<N; i++){
if(!check[i]) continue;
if(Compare(ansy,i) == -1) ansy = i;
}
if(N%2 == 1) check[N-1] = false;
if(!check[0]) ansx = 0;
else ansx = 1;
for(i=2; i<N; i++){
if(check[i]) continue;
if(Compare(ansx,i) == 1) ansx = i;
}
Answer(ansx,ansy);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |