Submission #468797

# Submission time Handle Problem Language Result Execution time Memory
468797 2021-08-29T16:44:45 Z Carmel_Ab1 ICC (CEOI16_icc) C++17
0 / 100
10 ms 480 KB
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int>vi;
#define pb push_back
vi par;
int get(int x){return par[x]=(x==par[x]?x:get(par[x]));}
void unite(int u,int v){
    u=get(u),v=get(v);
    if(u==v)return;
    par[u]=v;
}
void run(int n){
    par.resize(n+1);
    for(int i=0; i<=n; i++)
        par[i]=i;
    for(int k=0; k<n-1; k++){
        int u=-1,v=-1;
        for(int i=1;u==-1 && v==-1 && i<=n; i++){
            int a[1]={i};
            int b[n-1];
            int ix=0;
            for(int j=1; j<=n; j++)
                if(get(i)!=get(j))
                    b[ix++]=j;
            if(query(1,ix,a,b)){
                if(u==-1)
                    u=i;
                else
                    v=i;
            }
        }
        unite(u,v);
        setRoad(u,v);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 480 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 480 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -