結果
| 問題 | No.2427 Tree Distance Two |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-16 23:18:21 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 578 bytes |
| 記録 | |
| コンパイル時間 | 5,924 ms |
| コンパイル使用メモリ | 336,136 KB |
| 実行使用メモリ | 21,372 KB |
| 最終ジャッジ日時 | 2026-07-02 04:45:51 |
| 合計ジャッジ時間 | 10,213 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 35 |
ソースコード
/*
validation
*/
#include <bits/stdc++.h>
#include "testlib.h"
#include <atcoder/dsu>
using ll = long long;
const ll n_min = 2, n_max = 300'000;
int main() {
registerValidation();
const ll n = inf.readLong(n_min, n_max);
inf.readEoln();
atcoder::dsu uf(n);
for(int i = 0; i < n-1; i++) {
const ll u = inf.readLong(1, n) - 1;
inf.readSpace();
const ll v = inf.readLong(1, n) - 1;
inf.readEoln();
ensure(!uf.same(u, v));
uf.merge(u, v);
}
ensure(uf.size(0) == n);
inf.readEof();
return 0;
}