# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947897 | benjaminkleyn | Highway design (CEOI12_highway) | C++17 | 1 ms | 2000 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>
#define ll long long
#define FOR(i, x, y) for(ll i = x; i < y; i++)
using namespace std;
ll MinimumCrossings(int x, int y, int z)
{
return 1 - isOnLine(x, y, z);
}
void FindCities(int n)
{
ll x = MinimumCrossings(1, 2, 3);
ll y = MinimumCrossings(4, 5, 6);
vector<ll> rem;
cout << x << " " << y << endl;
if (x==0 || y==0){
ll idk1;
ll idk2;
if (x==0){
idk1 = 1;
idk2 = 2;
FOR(i,1,n+1){
if (i != 1 && i != 2 && i != 3) rem.push_back(i);
}
}else{
idk1 = 4;
idk2 = 5;
FOR(i,1,n+1){
if (i != 4 && i != 5 && i != 6) rem.push_back(i);
}
}
vector<ll> zamn;
cout << idk1 << " " << idk2 << endl;
FOR(i,0,rem.size()/2){
ll sus = MinimumCrossings(idk1, rem[2*i], rem[2*i+1]);
if (sus == 1){
ll zuzzy = MinimumCrossings(idk1, idk2, rem[2*i]);
if (zuzzy == 0) zamn.push_back(rem[2*i+1]);
else zamn.push_back(rem[2*i]);
}
}
if (zamn.size() == 1) zamn.push_back(rem[rem.size()-1]);
Answer(idk1, idk2, zamn[0], zamn[1]);
}
}
int main()
{
int N = GetN();
FindCities(N);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |