# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94929 | popovicirobert | Highway design (CEOI12_highway) | C++14 | 9 ms | 632 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdlib.h>
#include <iostream>
#include <string>
#include "office.h"
#define _MaxN 100001
using namespace std;
int main() {
int n, i;
n = GetN();
pair <int, int> l1 = {-1, -1}, l2;
bool ok = 1;
for(int a = 1; a <= 2 && ok; a++) {
for(int b = a + 1; b <= 3 && ok; b++) {
for(int c = b + 1; c <= 4 && ok; c++) {
if(isOnLine(a, b, c)) {
l1 = {a, b};
l2.first = (1 ^ 2 ^ 3 ^ 4 ^ a ^ b ^ c);
ok = 0;
}
}
}
}
if(l1.first == -1) {
if(isOnLine(1, 2, 5) || isOnLine(3, 4, 5)) {
Answer(1, 2, 3, 4);
}
if(isOnLine(1, 3, 5) || isOnLine(2, 4, 5)) {
Answer(1, 3, 2, 4);
}
if(isOnLine(1, 4, 5) || isOnLine(2, 3, 5)) {
Answer(1, 4, 2, 3);
}
}
else {
for(i = 5; i <= n; i += 2) {
if(isOnLine(l1.first, i, i + 1)) {
continue;
}
if(isOnLine(l1.first, l1.second, i)) {
l2.second = i + 1;
}
else {
l2.second = i;
}
break;
}
Answer(l1.first, l1.second, l2.first, l2.second);
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |