# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
218662 | jjaewon | 산만한 고양이 (KOI17_cat) | C++14 | 2079 ms | 10856 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fi first
#define se second
#define endl '\n'
#define y1 holyshit
const int inf=0x3f3f3f3f;
int N,M;
pii edge[300010];
int p[300010];
int find(int x){ return x==p[x]?x:p[x]=find(p[x]); }
bool merge(int x,int y){
x=find(x); y=find(y);
if(x==y) return false;
return p[x]=y;
}
bool solve(int x){
for(int i=1;i<=N;i++) p[i]=i;
for(int i=0;i<M;i++){
if(edge[i].fi==x||edge[i].se==x) continue;
if(!merge(edge[i].fi,edge[i].se)) return false;
}
return true;
}
컴파일 시 표준 에러 (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... |