結果
| 問題 | No.9017 ac-library 動作確認 |
| ユーザー |
|
| 提出日時 | 2026-09-06 14:06:28 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 10 ms / 5,000 ms |
| + 701µs | |
| コード長 | 502 bytes |
| 記録 | |
| コンパイル時間 | 3,509 ms |
| コンパイル使用メモリ | 187,296 KB |
| 実行使用メモリ | 9,736 KB |
| 最終ジャッジ日時 | 2026-09-07 01:30:21 |
| 合計ジャッジ時間 | 3,488 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
use ac_library::Dsu;
use std::io::Read;
fn main() {
let mut s = String::new();
std::io::stdin().read_to_string(&mut s).unwrap();
let mut it = s.split_ascii_whitespace().map(|x| x.parse::<usize>().unwrap());
let n = it.next().unwrap();
let m = it.next().unwrap();
let mut d = Dsu::new(n);
for _ in 0..m {
let u = it.next().unwrap();
let v = it.next().unwrap();
d.merge(u, v);
}
println!("{}", (0..n).filter(|&i| d.leader(i) == i).count());
}