# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789517 | 2023-07-21T13:01:41 Z | NothingXD | 라멘 (JOI14_ramen) | C++17 | 1 ms | 304 KB |
#include "ramen.h" #include <bits/stdc++.h> using namespace std; void debug_out() {cerr << endl;} template<typename Head, typename... Tail> void debug_out(Head H, Tail... T){ cerr << H << ' '; debug_out(T...); } #define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__) void Ramen(int N) { vector<int> mns; vector<int> mxs; N--; for (int i = 0; i < N; i += 2){ int tmp = Compare(i, i+1); if (tmp == 1){ mns.push_back(i+1); mxs.push_back(i); } else{ mns.push_back(i); mxs.push_back(i+1); } } N++; if (N & 1){ mns.push_back(N-1); mxs.push_back(N-1); } int mn = mns[0]; for (int i = 1; i < mns.size(); i++){ int tmp = Compare(mn, mns[i]); if (tmp == 1) mn = mns[i]; } int mx = mxs[0]; for (int i = 1; i < mxs.size(); i++){ int tmp = Compare(mx, mxs[i]); if (tmp == -1) mx = mxs[i]; } Answer(mn, mx); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 304 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |