| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 725340 | groshi | Highway design (CEOI12_highway) | C++17 | 1 ms | 592 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 int long long
using namespace std;
/*int GetN()
{
    int n;
    cin>>n;
    return n;
}
int isOnLine(int x,int y,int z){
    cout<<x<<" "<<y<<" "<<z<<"\n";
    int co;
    cin>>co;
    return co;
}
void Answer(int a1,int b1,int a2,int b2){
    cout<<a1<<" "<<b1<<" "<<a2<<" "<<b2<<"\n";
}*/
int a1=0,b1=0,a2=0,b2=0;
int n;
void dodaj(int kto)
{
    if(a2==0)
        a2=kto;
    else b2=kto;
}
void wyznacz(int x)
{
    for(int i=x;i<n;i+=2)
    {
        int co=isOnLine(a1,i,i+1);
        if(co)
            continue;
        co=isOnLine(a1,b1,i);
        if(co)
            dodaj(i+1);
        else dodaj(i);
        if(b2!=0) break;
    }
    if(b2==0)
        b2=n;
}
int32_t main()
{
    //cin.tie(0);
    //cout.tie(0);
    //ios_base::sync_with_stdio(0);
    n=GetN();
    int co=isOnLine(1,2,3);
    if(co==1)
    {
        a1=1;
        b1=2;
        wyznacz(4);
    }
    else{
        int co=isOnLine(1,2,4);
        if(co==1)
        {
            a1=1;
            b1=2;
            a2=3;
        }
        else{
            co=isOnLine(1,3,4);
            if(co)
            {
                a1=1;
                b1=3;
                a2=2;
            }
            else{
                a1=2;
                b1=3;
                a2=1;
            }
        }
        wyznacz(5);
    }
    Answer(a1,b1,a2,b2);
    return 0;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
