제출 #1162710

#제출 시각아이디문제언어결과실행 시간메모리
1162710gmroh06라멘 (JOI14_ramen)C++20
0 / 100
0 ms320 KiB
#include <bits/stdc++.h> #include "ramen.h" using namespace std; using ll = long long; void Ramen(int n) { vector<ll> w, l; for (ll i = 0; i + 1 < n; i += 2) { if (Compare(i, i + 1) == 1) { w.emplace_back(i); l.emplace_back(i + 1); } else { w.emplace_back(i + 1); l.emplace_back(i); } } if (n & 1) { w.emplace_back(n - 1); l.emplace_back(n - 1); } ll x = w[0], y = l[0]; for (ll i = 1; i < w.size(); i++) { if (Compare(x, w[i]) == -1) { x = w[i]; } } for (ll i = 1; i < l.size(); i++) { if (Compare(y, l[i]) == 1) { y = l[i]; } } Answer(x, y); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...