# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
224418 | MKopchev | Highway design (CEOI12_highway) | C++14 | 5 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "office.h"
using namespace std;
/*
int GetN()
{
int ret;
cin>>ret;
return ret;
}
bool isOnLine(int x,int y,int z)
{
cout<<x<<" "<<y<<" "<<z<<endl;
int ret;
cin>>ret;
return ret;
}
void Answer(int a1,int a2,int b1,int b2)
{
cout<<a1<<" "<<a2<<" "<<b1<<" "<<b2<<endl;
}
*/
int main()
{
int n=GetN();
assert(isOnLine(1,2,3)==1);
int a1=1,a2=2;
vector<int> b={};
int i;
for(i=4;i<=n&&b.size()<2;i=i+2)
{
if(i==n)b.push_back(i);
else
{
if(isOnLine(a1,i,i+1)==0)
{
if(isOnLine(a1,a2,i)==0)
{
b.push_back(i);
if(b.size()==2)break;
if(isOnLine(a1,a2,i+1)==0)b.push_back(i+1);
}
else b.push_back(i+1);
}
}
}
Answer(a1,a2,b[0],b[1]);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |