Submission #565878

# Submission time Handle Problem Language Result Execution time Memory
565878 2022-05-21T13:29:21 Z Deepesson ICC (CEOI16_icc) C++17
7 / 100
372 ms 476 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);
void InformaRua(int a,int b){setRoad(a+1,b+1);}
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){
                if(find(u)==find(v))continue;
                std::vector<int> a,b;
                a.push_back(u);
                b.push_back(v);
                if(query(a,b)){
                    Union(u,v);
                    InformaRua(u,v);
                    goto prox;
                }
            }
        }
        prox:{}
    }
}
# Verdict Execution time Memory Grader output
1 Correct 44 ms 468 KB Ok! 1015 queries used.
2 Correct 44 ms 472 KB Ok! 1010 queries used.
# Verdict Execution time Memory Grader output
1 Incorrect 268 ms 476 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 328 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 301 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 284 ms 468 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -