#include "ramen.h"
int big[201],small[201],mx,mn;
void Ramen(int N) {
if(N==1){
Answer(0,0);
return;
}
for(int i=0;i<N/2;i++){
if(Compare(2*i,2*i+1)==1){
big[i]=2*i;
small[i]=2*i+1;
}
else{
big[i]=2*i+1;
small[i]=2*i;
}
}
if(N%2)big[N/2]=small[N/2]=N-1;
mx=big[0];
mn=small[0];
for(int i=1;i<N/2+N%2;i++){
if(Compare(big[i],mx)==1)mx=big[i];
}
for(int i=1;i<N/2+N%2;i++){
if(Compare(small[i],mn)==-1)mn=small[i];
}
Answer(mn,mx);
}
# |
결과 |
실행 시간 |
메모리 |
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 |