Submission #565875

# Submission time Handle Problem Language Result Execution time Memory
565875 2022-05-21T13:27:37 Z Deepesson ICC (CEOI16_icc) C++17
0 / 100
339 ms 480 KB
#include <bits/stdc++.h>

#include "icc.h"

#define MAX 105

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

int query(std::vector<int> a,std::vector<int> b){
    for(auto&x:a)++x;
    for(auto&x:b)++x;
    return query(a.size(),b.size(),a.data(),b.data());
}

void setRoad(int a, int b);

int pai[MAX];

int find(int a){
    if(pai[a]==a){
        return a;
    }
    return pai[a]=find(pai[a]);
}

void Union(int a,int b){
    a=find(a);
    b=find(b);
    pai[a]=b;
}

void run(int N) {
    for(int i=0;i!=MAX;++i)pai[i]=i;

    for(int i=1;i!=N;++i){
        for(int u=0;u!=N;++u){
            for(int v=u+1;v!=N;++v){
                std::vector<int> a,b;
                a.push_back(u);
                b.push_back(v);
                if(query(a,b)){
                    Union(u,v);
                    setRoad(u,v);
                    goto prox;
                }
            }
        }
        prox:{}
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 61 ms 480 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 339 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 315 ms 468 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 290 ms 480 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 262 ms 480 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -