# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
173479 | jhwest2 | 우호 조약 체결 (JOI14_friends) | C++14 | 296 ms | 11384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int N, M;
int par[100010], size[100010];
vector<int> E[100010];
int Find(int a) {
if (par[a] == a) return a;
return par[a] = Find(par[a]);
}
void Union(int a, int b) {
if (Find(a) == Find(b)) return;
size[Find(a)] += size[Find(b)];
par[Find(b)] = Find(a);
}
void dfs(int key, int cur) {
Union(key, cur);
for (int nxt : E[cur]) {
if (Find(nxt) == Find(cur)) continue;
dfs(key, nxt);
}
}
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
컴파일 시 표준 에러 (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... |