# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
311804 | mohamedsobhi777 | Highway design (CEOI12_highway) | C++14 | 4 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"
using namespace std;
int main(){
int n = GetN() ;
cout<< n ;
vector<int> line1 , line2 ;
bool x1 = isOnLine(1 , 2 , 3) ;
if(x1){
line1 = {1 , 2 , 3} ;
for(int i = 4 ;i <= n ;++ i){
if(!isOnLine(line1[0],line1[1] , i)){
line2.push_back(i) ;
}
if(line2.size() > 1)
break ;
}
Answer(line1[0],line1[1],line2[0] , line2[1]) ;
return 0 ;
}else{
if(isOnLine(4 , 1 , 2)){
line1 = {1 , 2 , 4} ;
line2 = {3} ;
}
else if(isOnLine(4 , 1 , 3)){
line1 = {4 , 1 , 3} ;
line2 = {2} ;
}else{
line1 = {2 , 3, 4} ;
line2 = {1} ;
}
for(int i = 5 ; i<= n; ++ i){
if(!isOnLine(line1[0],line1[1], i)){
Answer(line1[0],line1[1],line2[0] , i) ;
return 0 ;
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |