| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 94929 | popovicirobert | Highway design (CEOI12_highway) | C++14 | 9 ms | 632 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 <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;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
