# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
700956 | mychecksedad | Werewolf (IOI18_werewolf) | C++17 | 4051 ms | 22076 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct Dsu{
vector<int> p, s;
Dsu(int n){
s.resize(n + 1, 1);
p.resize(n + 1);
for(int i = 0; i <= n; ++i) p[i] = i;
}
int find(int v){
if(v==p[v]) return v;
return (p[v] = find(p[v]));
}
void merge(int a, int b){
a = find(a);
b = find(b);
if(a != b){
if(s[a] > s[b]) swap(a, b);
p[a] = b;
s[b] += s[a];
}
}
};
int n, m;
vector<int> check_validity(int N, vector<int> X, vector<int> Y, vector<int> S, vector<int> E, vector<int> L, vector<int> R){
n = N, m = X.size();
vector<int> ans(S.size());
for(int q = 0; q < S.size(); ++q){
Dsu small(n), large(n);
for(int i = 0; i < m; ++i){
if(X[i] <= R[q] && Y[i] <= R[q])
small.merge(X[i], Y[i]);
if(X[i] >= L[q] && Y[i] >= L[q])
large.merge(X[i], Y[i]);
}
for(int mid = L[q]; mid <= R[q]; ++mid){
if(small.find(mid) == small.find(E[q]) && large.find(mid) == large.find(S[q])){
ans[q] = 1;
break;
}
}
}
return ans;
}
컴파일 시 표준 에러 (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... |