| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 370474 | arnold518 | Highway design (CEOI12_highway) | C++14 | 27 ms | 4196 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 "office.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int N;
int GetN(void); 
int isOnLine(int x, int y, int z); 
void Answer(int a1, int b1, int a2, int b2);
map<tuple<int, int, int>, int> M;
int query(int a, int b, int c)
{
	if(a>b) swap(a, b);
	if(b>c) swap(b, c);
	if(a>b) swap(a, b);
	if(M.find({a, b, c})!=M.end()) return M[{a, b, c}];
	M[{a, b, c}]=isOnLine(a, b, c);
	return M[{a, b, c}];
}
vector<int> V, V2, V3;
int main()
{
	N=GetN();
	V.push_back(1);
	for(int i=2; i+1<=N; i+=2)
	{
		if(query(1, i, i+1))
		{
			V.push_back(i);
			V.push_back(i+1);
		}
		else
		{
			V2.push_back(i);
			V2.push_back(i+1);
		}
	}
	for(auto it : V2)
	{
		if(!query(V[0], V[1], it))
		{
			V3.push_back(it);
		}
		if(V3.size()>1 && V.size()>1) break;
	}
	Answer(V[0], V[1], V3[0], V3[1]);
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
