# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
368218 |
2021-02-19T19:24:00 Z |
ivan_tudor |
ICC (CEOI16_icc) |
C++14 |
|
1 ms |
492 KB |
#include"icc.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int dad[N];
vector<int> memb[N];
int findd(int nod){
if(nod == dad[nod])
return nod;
int d = findd(dad[nod]);
dad[nod] = d;
return dad[nod];
}
void join(int x,int y){
x = findd(x);
y = findd(y);
if(x == y)
return;
if(memb[x].size() < memb[y].size()){
swap(x, y);
swap(memb[x], memb[y]);
}
for(auto mm:memb[y]){
memb[x].push_back(mm);
}
dad[y] = x;
}
int used[N];
void buildgroups(vector<int> &gra, vector<int> &grb, vector<int> &dads, int bit){
bit++;
}
int findx(vector<int> v, vector<int> second){
return v[0];
}
void run(int n){
for(int i=1;i<=n;i++)
dad[i] = i, memb[i].push_back(i);
for(int nre = 1; nre<n;nre++){
for(int i=1;i<=n;i++)
used[i] = 0;
vector<int> dads;
for(int i = 1; i<=N;i++){
int tata = findd(i);
if(used[tata] == true)
continue;
used[tata] = true;
dads.push_back(tata);
}
int ds = dads.size();
vector<int> gra, grb;
for(int bit = 0; (1<<bit) < ds; bit++){
gra.clear();
grb.clear();
buildgroups(gra, grb, dads, bit);
if(query(gra.size(), grb.size(), gra.data(), grb.data()) == 1){
int x, y;
x = findx(gra, grb);
y = findx(grb, gra);
setRoad(x, y);
join(x, y);
break;
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |