# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
5118 | ainta | Highway design (CEOI12_highway) | C++98 | 0 ms | 1508 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 "office.h"
int main() {
int N = GetN();
int i, c1 = 0, c2 = 0, j, k, x, y, z;
if (isOnLine(1, 2, 3)) {
for (i = 4; i < N && !c2; i += 2){
if (!isOnLine(1, i, i + 1)){
if (isOnLine(1, 2, i)){
if (c1 == 0)c1 = i + 1;
else c2 = i + 1;
}
else{
if (c1 == 0)c1 = i;
else c2 = i;
}
}
}
if (!c2) c2 = c1 + 1;
Answer(1, 2, c1, c2);
}
else if(isOnLine(4, 5, 6))
{
for (i = 7; i < N && !c1; i += 2){
if (!isOnLine(4, i, i + 1)){
if (!isOnLine(4, 5, i))c1 = i;
else c1 = i + 1;
}
}
if (!c1)c1 = N;
if (!isOnLine(4, 5, 1))c2 = 1;
else if (!isOnLine(4, 5, 2))c2 = 2;
else c2 = 3;
Answer(4, 5, c1, c2);
}
else{
for (i = 1; i <= 4; i++){
for (j = i + 1; j <= 5; j++){
for (k = j + 1; k <= 6; k++){
if (isOnLine(i, j, k))break;
}
if (k != 7)break;
}
if (j != 6)break;
}
x = i, y = j, z = k;
for (i = 1; i <= 6 && !c2; i++){
if (x != i && y != i && z != i){
if (!isOnLine(x, y, i)){
if (!c1)c1 = i;
else c2 = i;
}
else break;
}
}
if (!c2){
for (i = i + 1; i <= 6 && !c2; i++){
if (x != i && y != i && z != i){
if (!c1)c1 = i;
else if (!c2)c2 = i;
}
}
}
Answer(x, y, c1, c2);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |