| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 632325 | Cyber_Wolf | ICC (CEOI16_icc) | C++14 | 17 ms | 500 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//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];
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;
compSize[v] += compSize[u];
}
void run(int n)
{
for(int i = 1; i <= n; i++) par[i] = i, compSize[i] = 1;
lg x = n-1;
while(x--)
{
map<lg, lg> mp;
for(int i = 1; i <= n; i++)
{
vector<lg> v;
for(int j = 1; j <= n; j++) if(getParent(i) != getParent(j) && !mp.count(j)) v.push_back(j);
int arr[v.size()];
for(int j = 0; j < v.size(); j++) arr[j] = v[j];
int h[1] = {i};
bool flag = query(1, v.size(), h, arr);
mp[i]++;
if(!flag) continue;
lg sz = v.size();
while(true)
{
if(sz == 1)
{
join(h[0], v[0]);
setRoad(h[0], v[0]);
break;
}
lg mid = sz/2;
int a[mid+1];
for(int i = 0; i < mid; i++)
{
a[i] = v[i];
}
bool flag = query(1, mid+1, h, a);
if(flag)
{
v.resize(mid+1);
for(int i = 0; i < mid+1; i++) v[i] = a[i];
}
else{
vector<lg> bef = v;
v.resize(v.size()-mid-1);
for(int i = mid+1; i < v.size(); i++) v[i-mid-1] = bef[i];
}
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
