# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
66394 | ansol4328 | 문명 (KOI17_civilization) | C++98 | 1056 ms | 38144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<memory.h>
#include<queue>
using namespace std;
int n, k;
int visit[2002][2002];
int p[4000002];
int cnt;
bool st[4000002];
void setup(int a)
{
cnt=a;
memset(p,-1,sizeof(p));
memset(st,false,sizeof(st));
}
int f(int v)
{
if(p[v]==-1) return v;
p[v]=f(p[v]);
return p[v];
}
void u(int v1, int v2) // v2 subtree -> v1 subtree
{
v1=f(v1);
v2=f(v2);
if(v1==v2) return;
if(st[v2]) cnt--;
컴파일 시 표준 에러 (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... |