# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
125312 | figter001 | 고속도로 설계 (CEOI12_highway) | C++17 | 4 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "office.h"
using namespace std;
bool vis[11][11][11];
int main(){
int n = GetN();
vector<int> a = {1,2,3,4,5};
do{
vector<int> cur;
cur.push_back(a[0]);
cur.push_back(a[1]);
cur.push_back(a[2]);
sort(cur.begin(),cur.end());
int x = cur[0],y = cur[1],z = cur[2];
if(vis[x][y][z])continue;
cout << x << ' ' << y << ' ' << z << endl;
vis[x][y][z] = 1;
int res = isOnLine(x,y,z);
if(res == 1){
vector<int> g;
for(int i=1;i<=n;i++){
if(i == x || i == y || i == z){
}else{
int res = isOnLine(x,y,i);
if(res == 0)g.push_back(i);
if(g.size() == 2)break;
}
}
Answer(x,y,g[0],g[1]);
break;
}
}while(next_permutation(a.begin(),a.end()));
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |