# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
486057 | 2021-11-10T13:35:00 Z | flappybird | 라멘 (JOI14_ramen) | C++14 | 1 ms | 292 KB |
#include "ramen.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; void Ramen(int N) { if (N == 1) { Answer(0, 0); return; } ll i; vector<ll> v1; vector<ll> v2; if (N % 2) { for (i = 0; i < N - 1; 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); } ll r1, r2; if (Compare(N - 1, N - 2) == -1) { if (v1[v1.size() - 1] == N - 2) v1.pop_back(); v1.push_back(N - 1); } else { if (v2[v2.size() - 1] == N - 2) v2.pop_back(); v2.push_back(N - 1); } } else { for (i = 0; i < 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); } } ll aa, bb; aa = v1[0]; for (i = 1; i < v1.size(); i++) if (Compare(aa, v1[i]) == 1) aa = v1[i]; bb = v2[0]; for (i = 1; i < v2.size(); i++) if (Compare(bb, v2[i]) == -1) bb = v2[i]; Answer(aa, bb); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 292 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |