Submission #585652

# Submission time Handle Problem Language Result Execution time Memory
585652 2022-06-29T07:37:26 Z 박상훈(#8384) ICC (CEOI16_icc) C++14
18 / 100
361 ms 588 KB
#include "icc.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
struct DSU{
    int path[111];
    void init(int n){for (int i=1;i<=n;i++) path[i] = i;}
    int find(int s){
        if (s==path[s]) return s;
        return path[s] = find(path[s]);
    }
    void merge(int s, int v){
        s = find(s), v = find(v);
        if (s==v) return;
        path[s] = v;
    }
}dsu;
int A[111], B[111];

void run(int n){
    dsu.init(n);
    for (int z=0;z<n-1;z++){
        vector<int> V;
        for (int i=1;i<=n;i++){
            A[1] = i;
            int cnt = 0;
            for (int j=1;j<=n;j++) if (dsu.find(i)!=dsu.find(j)) B[++cnt] = j;

            if (query(1, cnt, A+1, B+1)) V.push_back(i);
        }
        assert(V.size()==2);
        setRoad(V[0], V[1]);
        dsu.merge(V[0], V[1]);
    }
}

//int main(){}
# Verdict Execution time Memory Grader output
1 Correct 13 ms 588 KB Ok! 210 queries used.
2 Correct 10 ms 504 KB Ok! 210 queries used.
# Verdict Execution time Memory Grader output
1 Correct 131 ms 468 KB Ok! 2450 queries used.
2 Correct 127 ms 476 KB Ok! 2450 queries used.
3 Correct 129 ms 468 KB Ok! 2450 queries used.
# Verdict Execution time Memory Grader output
1 Incorrect 361 ms 480 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 317 ms 480 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 279 ms 472 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 252 ms 476 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -