| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 262899 | dolphingarlic | Meandian (CEOI06_meandian) | C++14 | 5 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "libmean.h"
#include <bits/stdc++.h>
using namespace std;
int ans[100], c[5];
int main() {
int n = Init();
fill(ans, ans + n, -1);
queue<int> cand;
for (int i = 1; i <= n; i++) cand.push(i);
while (cand.size() > 4) {
for (int i = 0; i < 5; i++) {
c[i] = cand.front();
cand.pop();
}
vector<pair<int, int>> occ = {
{Meandian(c[0], c[1], c[2], c[3]), c[4]},
{Meandian(c[0], c[1], c[2], c[4]), c[3]},
{Meandian(c[0], c[1], c[3], c[4]), c[2]},
{Meandian(c[0], c[2], c[3], c[4]), c[1]},
{Meandian(c[1], c[2], c[3], c[4]), c[0]}
};
sort(occ.begin(), occ.end());
ans[occ[2].second - 1] = occ[0].first + occ[4].first - occ[2].first;
for (int i = 0; i < 5; i++) if (i != 2) cand.push(occ[i].second);
}
Solution(ans);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
