# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99086 | asifthegreat | Highway design (CEOI12_highway) | C++14 | 3 ms | 640 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"
#define debug(a) cout << #a << " = " << a << endl;
using namespace std;
/*
int GetN(void);
int isOnLine(int x, int y, int z);
void Answer(int a1, int b1, int a2, int b2);
*/
vector<int>v;
int main()
{
int n = GetN();
int a = 2,b = 3,c = 0,d = 0;
if(isOnLine(1,2,3)){
//cout << "Hola Hola\n";
a = 2;b = 3;
}
for(int i = b+1;;i+=2){
if(i+1 > n or v.size() >= 2)break;
if(!isOnLine(b,i,i+1)){
bool one = isOnLine(a,b,i);
if(one){
v.push_back(i+1);
if(v.size() == 2){
break;
}
}
else if(!one){
v.push_back(i);
if(v.size() == 2){
break;
}
else{
if(!isOnLine(a,b,i+1)){
v.push_back(i+1);
// break;
}
}
}
}
}
// debug(v.size());
c = v[0];
d = v[1];
// cout << a << " " << b << " " << c << " " << d << endl;
Answer(a,b,c,d);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |