# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465115 | AlexLuchianov | Highway design (CEOI12_highway) | C++14 | 1 ms | 584 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include "office.h"
int main() {
int n = GetN();
if(isOnLine(1, 2, 3) == 1) {
int last = 0;
for(int i = 4; i <= n; i += 2) {
if(i + 1 <= n) {
if(isOnLine(1, i, i + 1) == 0) {
if(isOnLine(1, 2, i) == 0) {
if(last == 0)
last = i;
else {
Answer(1, 2, last, i);
return 0;
}
} else {
if(last == 0)
last = i + 1;
else {
Answer(1, 2, last, i + 1);
return 0;
}
}
}
} else {
//no need to ask
Answer(1, 2, last, n);
return 0;
}
}
} else {
if(isOnLine(4, 5, 6) == 0) {
for(int i = 1;i <= 5; i++)
for(int j = i + 1; j <= 5; j++)
for(int h = j + 1; h <= 5; h++)
if(isOnLine(i, j, h) == 1) {
int last = 0;
for(int k = 1; k <= 6; k++)
if(k != i && k != j && k != h && isOnLine(i, j, k) == 0) {
if(last == 0)
last = k;
else {
Answer(i, j, last, k);
return 0;
}
}
}
} else {
int last = 0;
if(isOnLine(4, 5, 1) == 0)
last = 1;
else if(isOnLine(4, 5, 2) == 0)
last = 2;
else
last = 3;
for(int i = 7; i <= n; i += 2) {
if(i + 1 <= n) {
if(isOnLine(4, i, i + 1) == 0) {
if(isOnLine(4, 5, i) == 0) {
Answer(4, 5, last, i);
return 0;
} else {
Answer(4, 5, last, i + 1);
return 0;
}
}
} else {
Answer(4, 5, last, i);
return 0;
}
}
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |