# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
262899 | dolphingarlic | Meandian (CEOI06_meandian) | C++14 | 5 ms | 256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |