# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
237105 | dolphingarlic | Highway design (CEOI12_highway) | C++14 | 6 ms | 1152 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 <bits/stdc++.h>
using namespace std;
#include "office.h"
int main() {
int n = GetN();
vector<int> same, different;
for (int i = 2; i < n; i += 2) {
if (isOnLine(1, i, i + 1)) same.push_back(i);
else different.push_back(i);
}
if (same.size() && n % 2 == 0) {
if (isOnLine(1, same[0], n)) same.push_back(n);
else different.push_back(n);
}
if (same.size()) {
assert(different.size() > 1);
int a2;
if (isOnLine(1, same[0], different[0])) a2 = different[0] + 1;
else a2 = different[0];
int b2;
if (isOnLine(1, same[0], different[1])) b2 = different[1] + 1;
else b2 = different[1];
Answer(1, same[0], a2, b2);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |