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