# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
585552 |
2022-06-29T05:03:04 Z |
반딧불(#8385) |
ICC (CEOI16_icc) |
C++14 |
|
379 ms |
492 KB |
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct unionFind{
int par[105];
void init(int _n){
for(int i=1; i<=_n; i++) par[i] = i;
}
int find(int x){
if(x==par[x]) return x;
return par[x] = find(par[x]);
}
void merge(int x, int y){
x = find(x), y = find(y);
par[x] = y;
}
} dsu;
int n;
bool arr[105][105];
int qa[105], qb[105];
void run(int N){
n = N;
dsu.init(n);
for(int i=1; i<n; i++){
int X=-1, Y=-1;
for(int x=1; x<=n; x++){
for(int y=x+1; y<=n; y++){
if(dsu.find(x) == dsu.find(y)) continue;
qa[0]=x, qb[0]=y;
if(query(1, 1, qa, qb)){
X = x, Y = y;
goto skip;
}
}
}
skip:
setRoad(X, Y);
arr[X][Y] = arr[Y][X] = 1;
dsu.merge(X, Y);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
476 KB |
Ok! 1015 queries used. |
2 |
Correct |
58 ms |
492 KB |
Ok! 1010 queries used. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
310 ms |
484 KB |
Number of queries more than 5000 out of 2500 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
379 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 |
362 ms |
480 KB |
Number of queries more than 4000 out of 2000 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
334 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 |
354 ms |
480 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |