# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
632293 |
2022-08-19T20:02:23 Z |
Cyber_Wolf |
ICC (CEOI16_icc) |
C++14 |
|
350 ms |
480 KB |
//CEOI '16 P1
//Problem: ICC
//Link: https://oj.uz/problem/view/CEOI16_icc
#include <bits/stdc++.h>
#include "icc.h"
using namespace std;
#define lg long long
const lg MOD = 1e9+7, N = 101, M = 1e7+1, SZ = 1e3+1;
lg par[N], compSize[N];
vector<lg> child[N];
lg getParent(lg src)
{
if(src == par[src]) return src;
return par[src] = getParent(par[src]);
}
void join(lg u, lg v)
{
u = getParent(u), v = getParent(v);
if(u == v) return;
if(compSize[u] > compSize[v]) swap(u, v);
par[u] = v;
for(auto it : child[u]) child[v].push_back(it);
compSize[v] += compSize[u];
}
void run(int n)
{
for(int i = 1; i <= n; i++) par[i] = i, compSize[i] = 1, child[i].push_back(i);
lg x = n-1;
while(x--)
{
vector<lg> parents;
for(int i = 1; i <= n; i++) if(par[i] == i) parents.push_back(i);
bool cur = true;
for(int i = 1; i <= n && cur; i++)
{
for(int j = i+1; j <= n && cur; j++)
{
int a[] = {i}, b[] = {j};
bool flag = query(1, 1, a, b);
if(flag)
{
join(i, j);
setRoad(i, j);
cur = false;
break;
}
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
468 KB |
Ok! 1015 queries used. |
2 |
Correct |
52 ms |
428 KB |
Ok! 1010 queries used. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
139 ms |
476 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
350 ms |
480 KB |
Number of queries more than 4500 out of 2250 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
329 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 |
298 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 |
285 ms |
480 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |