# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
597455 |
2022-07-16T04:18:32 Z |
1bin |
ICC (CEOI16_icc) |
C++14 |
|
41 ms |
492 KB |
#include <bits/stdc++.h>
#include <icc.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(), v.end()
const int NMAX = 105;
int par[NMAX], a[NMAX], b[NMAX], sza, szb;
int find(int x){ return par[x] == -1 ? x : par[x] = find(par[x]);}
vector<int> v[NMAX];
int find_vr(int na, int nb, int a[], int b[])
{
int lo = 1, hi = na;
while (lo < hi)
{
int mi = (lo + hi) >> 1;
int *c = new int[NMAX];
for (int i = 0; i < mi; i++) c[i] = a[i];
if (query(mi, nb, c, b)) hi = mi;
else lo = mi+1;
}
return a[lo-1];
}
void run(int n){
memset(par, -1, sizeof(par));
for(int i = 1; i <= n; i++) v[i].emplace_back(i);
int sz = n;
for(int i = 0; i < n - 1; i++, sz--){
vector<int> arr;
for(int i = 1; i <= n; i++)
if(par[i] == -1) arr.emplace_back(i);
for(int bit = 0; 1 << bit < sz; bit++){
sza = szb = 0;
for(int j = 0; j < sz; j++){
if(j & (1 << bit)) {
for(auto x : v[j]) a[sza++] = x;
}
else{
for(auto x : v[j]) b[szb++] = x;
}
}
if(query(sza, szb, a, b)){
int x = find_vr(sza, szb, a, b);
int y = find_vr(szb, sza, b, a);
setRoad(x, y);
x = find(x); y = find(y);
if(v[x].size() < v[y].size()) swap(x, y);
for(int t : v[y]) v[x].emplace_back(t);
par[y] = x;
break;
}
}
}
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
468 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
468 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
492 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
468 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
468 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
468 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |