Submission #566060

# Submission time Handle Problem Language Result Execution time Memory
566060 2022-05-21T17:39:02 Z piOOE ICC (CEOI16_icc) C++17
7 / 100
372 ms 476 KB
#include "icc.h"
#include <bits/stdc++.h>

using namespace std;

#define all(x) begin(x), end(x)
#define sz(x) ((int)size(x))
#define trace(x) cout << #x << ": " << (x) << endl;

typedef long long ll;

int query(int size_a, int size_b, int a[], int b[]);

void run(int n);

void setRoad(int a, int b);

int ask(vector<int> a, vector<int> b) {
    return query(sz(a), sz(b), a.data(), b.data());
}

void run(int n) {
    vector<vector<bool>> ws(n, vector<bool>(n));
    for (int cnt = 1; cnt <= n - 1; ++cnt) {
        for (int i = 1; i <= n; ++i) {
            bool ok = false;
            for (int j = i + 1; j <= n; ++j) {
                if (!ws[i - 1][j - 1] && ask({i}, {j})) {
                    ws[i - 1][j - 1] = true;
                    setRoad(i, j);
                    ok = true;
                    break;
                }
            }
            if (ok) {
                break;
            }
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 47 ms 468 KB Ok! 1015 queries used.
2 Correct 47 ms 472 KB Ok! 1010 queries used.
# Verdict Execution time Memory Grader output
1 Incorrect 276 ms 468 KB Number of queries more than 5000 out of 2500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 372 ms 476 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 335 ms 476 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 309 ms 476 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 287 ms 476 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -