結果
| 問題 |
No.1565 Union
|
| コンテスト | |
| ユーザー |
akakimidori
|
| 提出日時 | 2021-06-26 13:20:35 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,569 bytes |
| コンパイル時間 | 12,165 ms |
| コンパイル使用メモリ | 404,516 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-25 10:21:49 |
| 合計ジャッジ時間 | 14,113 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 27 |
コンパイルメッセージ
warning: unused variable: `out`
--> src/main.rs:42:45
|
42 | fn run<W: Write>(sc: &mut scanner::Scanner, out: &mut std::io::BufWriter<W>) {
| ^^^ help: if this is intentional, prefix it with an underscore: `_out`
|
= note: `#[warn(unused_variables)]` on by default
ソースコード
// ---------- begin scannner ----------
#[allow(dead_code)]
mod scanner {
use std::str::FromStr;
pub struct Scanner<'a> {
it: std::str::SplitWhitespace<'a>,
}
impl<'a> Scanner<'a> {
pub fn new(s: &'a String) -> Scanner<'a> {
Scanner {
it: s.split_whitespace(),
}
}
pub fn next<T: FromStr>(&mut self) -> T {
self.it.next().unwrap().parse::<T>().ok().unwrap()
}
pub fn next_bytes(&mut self) -> Vec<u8> {
self.it.next().unwrap().bytes().collect()
}
pub fn next_chars(&mut self) -> Vec<char> {
self.it.next().unwrap().chars().collect()
}
pub fn next_vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
(0..len).map(|_| self.next()).collect()
}
}
}
// ---------- end scannner ----------
use std::io::Write;
fn main() {
use std::io::Read;
let mut s = String::new();
std::io::stdin().read_to_string(&mut s).unwrap();
let mut sc = scanner::Scanner::new(&s);
let out = std::io::stdout();
let mut out = std::io::BufWriter::new(out.lock());
run(&mut sc, &mut out);
}
fn run<W: Write>(sc: &mut scanner::Scanner, out: &mut std::io::BufWriter<W>) {
let n = sc.next::<usize>();
let m = sc.next::<usize>();
assert!(2 <= n && n <= 200_000);
assert!(2 <= m && m <= 200_000);
for _ in 0..m {
let a = sc.next::<usize>();
let b = sc.next::<usize>();
assert!(1 <= a && a <= n);
assert!(1 <= b && b <= n);
}
}
akakimidori