#include "ramen.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> v1, v2;
void Ramen(int N) {
if(N == 1) Answer(0, 0);
for(int i=0; i+1<N; i+=2) {
if(Compare(i, i + 1) == 1) v1.push_back(i), v2.push_back(i + 1);
else v1.push_back(i + 1), v2.push_back(i);
}
if(N % 2 == 1) {
if(Compare(N - 1, 0) == 1) v1.push_back(N - 1);
else v2.push_back(N - 1);
}
int X = v1[0], Y = v2[0];
for(int i=1; i<(int)v1.size(); i++) if(Compare(v1[i], X) == +1) X = v1[i];
for(int i=1; i<(int)v2.size(); i++) if(Compare(v2[i], Y) == -1) Y = v2[i];
Answer(Y, X);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2028 KB |
Output is correct |
2 |
Correct |
0 ms |
2028 KB |
Output is correct |
3 |
Correct |
0 ms |
2028 KB |
Output is correct |
4 |
Correct |
0 ms |
2028 KB |
Output is correct |
5 |
Correct |
0 ms |
2028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2028 KB |
Output is correct |
2 |
Correct |
0 ms |
2028 KB |
Output is correct |
3 |
Correct |
0 ms |
2028 KB |
Output is correct |
4 |
Correct |
0 ms |
2028 KB |
Output is correct |
5 |
Correct |
0 ms |
2028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2028 KB |
Output is correct |
2 |
Correct |
0 ms |
2028 KB |
Output is correct |
3 |
Correct |
0 ms |
2028 KB |
Output is correct |
4 |
Correct |
0 ms |
2028 KB |
Output is correct |
5 |
Correct |
0 ms |
2028 KB |
Output is correct |