# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
941705 | benjaminkleyn | Highway design (CEOI12_highway) | C++17 | 1 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "office.h"
using namespace std;
typedef long long ll;
int main()
{
cin.tie(0)->sync_with_stdio(0);
int n = GetN();
vector<int> otherline;
int a, b;
if (isOnLine(1, 2, 3))
{
// [{1, 2, 3}]
a = 1;
b = 2;
if (!isOnLine(1, 2, 4))
otherline.push_back(4);
}
else if (isOnLine(1, 2, 4))
{
// [{1, 2}, {3}]
a = 1;
b = 2;
otherline = {3};
}
else if (isOnLine(2, 3, 4))
{
// [{2, 3}, {1}]
a = 2;
b = 3;
otherline = {1};
}
else if (isOnLine(2, 3, 4))
{
// [{3, 1}, {2}]
a = 1;
b = 3;
otherline = {2};
}
else
{
// [{1, 2}, {3, 4}] or [{1, 3}, {2, 4}] or [{2, 3}, {1, 4}].
if (isOnLine(1, 2, 5) || isOnLine(3, 4, 5))
{
Answer(1, 2, 3, 4);
return 0;
}
if (isOnLine(1, 3, 5) || isOnLine(2, 4, 5))
{
Answer(1, 3, 2, 4);
return 0;
}
Answer(2, 3, 1, 4);
return 0;
}
for (int i = 5; i + 1 <= n && otherline.size() < 2; i += 2)
{
if (isOnLine(a, i, i + 1))
continue;
if (isOnLine(a, b, i + 1))
otherline.push_back(i);
else
otherline.push_back(i + 1);
}
if (n % 2 && otherline.size() < 2)
otherline.push_back(n);
Answer(a, b, otherline[0], otherline[1]);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |