# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
792899 | burythelightdeepwithin | Highway design (CEOI12_highway) | C++14 | 1 ms | 592 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>
#include "office.h"
using namespace std;
const int N = 1e5+7;
int n, resp, reset = 0, l;
vector <int> alr;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
n = GetN();
for (int i = 2; i <= 4; i++){
vector <int> take;
for (int j = 1; j <= 4; j++){
if (j == i){
continue;
}
take.push_back(j);
}
int w = isOnLine(take[0], take[1], take[2]);
if (w){
reset = 1;
alr = take;
l = i;
break;
}
}
if (!reset){
alr = {2, 3, 4};
l = 1;
}
reset = 0;
for (int i = 5; i < n; i += 2){
int w = isOnLine(alr[0], i, i+1);
if (!w){
reset = 1;
w = isOnLine(alr[0], alr[1], i);
if (w){
Answer(alr[0], alr[1], l, i+1);
return 0;
} else {
Answer(alr[0], alr[1], l, i);
return 0;
}
}
}
Answer(alr[0], alr[1], l, n);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |