Submission #565876

# Submission time Handle Problem Language Result Execution time Memory
565876 2022-05-21T13:28:23 Z Deepesson ICC (CEOI16_icc) C++17
7 / 100
346 ms 472 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){
                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 43 ms 468 KB Ok! 1015 queries used.
2 Correct 41 ms 468 KB Ok! 1010 queries used.
# Verdict Execution time Memory Grader output
1 Incorrect 124 ms 472 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 346 ms 472 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 316 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 288 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 268 ms 472 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -