| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 640092 | ygim | Highway design (CEOI12_highway) | C++17 | 4 ms | 976 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.
// P1_HighwayDesign.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "office.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
int main()
{
    //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n = GetN();
    vector<int> nums(n);
    for (int i = 0; i < n; i++) nums[i] = i + 1;
    while (true)
    {
        random_shuffle(nums.begin(), nums.end());
        vector<int> a;
        bool f = true;
        for (int i = 2; i < n; i++)
        {
            if (!isOnLine(nums[0], nums[1], nums[i])) {
                a.push_back(nums[i]);
                if (a.size() >= 3)
                {
                    if (!isOnLine(a[0], a[1], a.back()))
                    {
                        f = false;
                        break;
                    }
                }
            }
        }
        if (f) Answer(nums[0], a[0], nums[1], a[1]);
    }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
