# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
78561 | hamzqq9 | 고속도로 설계 (CEOI12_highway) | C++14 | 5 ms | 2236 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdlib.h>
#include <iostream>
#include <string>
#include "office.h"
#define _MaxN 100001
#include<vector>
using namespace std;
#define pb push_back
int pro[100005];
int main() {
// freopen("in.txt","r",stdin);
int n=GetN();
int g=0;
vector<int> ans[2];
for(int i=1;i<n;i+=2) {
if(i+2<=n) {
if(isOnLine(i,i+1,i+2)) {
if(!pro[i]) ans[g].pb(i),pro[i]=1;
if(!pro[i+1]) ans[g].pb(i+1),pro[i+1]=1;
if(!pro[i+2]) ans[g].pb(i+2),pro[i+2]=1;
}
else {
g=!g;
pro[i+1]=1;
if(!pro[i]) ans[g].pb(i),pro[i]=1;
if(!pro[i+1]) ans[g].pb(i+1),pro[i+1]=1;
if(!pro[i+2]) ans[g].pb(i+2),pro[i+2]=1;
}
}
else {
if(isOnLine(i-1,i,i+1)) {
if(!pro[i-1]) ans[g].pb(i-1),pro[i-1]=1;
if(!pro[i]) ans[g].pb(i),pro[i]=1;
if(!pro[i+1]) ans[g].pb(i+1),pro[i+1]=1;
}
else {
g=!g;
pro[i]=1;
if(!pro[i-1]) ans[g].pb(i-1),pro[i-1]=1;
if(!pro[i]) ans[g].pb(i),pro[i]=1;
if(!pro[i+1]) ans[g].pb(i+1),pro[i+1]=1;
}
}
}
Answer(ans[0][0],ans[0][1],ans[1][0],ans[1][1]);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |