| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 311813 | mohamedsobhi777 | 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"
using namespace std;
vector<int> line1 , line2 ; 
void finish(){
        Answer(line1[0],line1[1],line2[0] , line2[1]) ; 
        exit(0) ; 
}
int main(){
        int n = GetN() ; 
        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 ; 
                }
                if(line2.size() == 1)line2.push_back(n) ; 
                finish() ; 
        }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 += 2){
                        if(!isOnLine(line1[0],i, i + 1)){
                                if(isOnLine(line1[0],line1[1] , i)){
                                        line2.push_back(i+1) ; 
                                }else line2.push_back(i) ; 
                                break ; 
                        }else{
                                line1.push_back(i) ; 
                                line1.push_back(i+1) ; 
                        }
                }
                if(line2.size() == 1)line2.push_back(n) ; 
                finish() ; 
        }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
