| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 725340 | groshi | Highway design (CEOI12_highway) | C++17 | 1 ms | 592 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
