結果
問題 | No.1880 Many Ways |
ユーザー | akakimidori |
提出日時 | 2022-03-18 22:23:47 |
言語 | Rust (1.77.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,442 bytes |
コンパイル時間 | 12,238 ms |
コンパイル使用メモリ | 383,516 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-03 07:14:59 |
合計ジャッジ時間 | 21,206 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
コンパイルメッセージ
warning: unused import: `std::io::Write` --> src/main.rs:51:5 | 51 | use std::io::Write; | ^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused variable: `a` --> src/main.rs:60:9 | 60 | a: usize, | ^ | help: `a` is captured in macro and introduced a unused variable --> src/main.rs:24:13 | 24 | let $var = read_value!($iter, $t); | ^^^^ ... 59 | / input! { 60 | | a: usize, 61 | | } | |_____- in this macro invocation = note: `#[warn(unused_variables)]` on by default = note: this warning originates in the macro `input_inner` which comes from the expansion of the macro `input` (in Nightly builds, run with -Z macro-backtrace for more info) warning: type alias `Map` is never used --> src/main.rs:54:6 | 54 | type Map<K, V> = BTreeMap<K, V>; | ^^^ | = note: `#[warn(dead_code)]` on by default warning: type alias `Set` is never used --> src/main.rs:55:6 | 55 | type Set<T> = BTreeSet<T>; | ^^^ warning: type alias `Deque` is never used --> src/main.rs:56:6 | 56 | type Deque<T> = VecDeque<T>; | ^^^^^
ソースコード
// ---------- begin input macro ---------- // reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); input_inner!{iter, $($r)*} }; ($($r:tt)*) => { let s = { use std::io::Read; let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); s }; let mut iter = s.split_whitespace(); input_inner!{iter, $($r)*} }; } macro_rules! input_inner { ($iter:expr) => {}; ($iter:expr, ) => {}; ($iter:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($iter, $t); input_inner!{$iter $($r)*} }; } macro_rules! read_value { ($iter:expr, ( $($t:tt),* )) => { ( $(read_value!($iter, $t)),* ) }; ($iter:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>() }; ($iter:expr, chars) => { read_value!($iter, String).chars().collect::<Vec<char>>() }; ($iter:expr, bytes) => { read_value!($iter, String).bytes().collect::<Vec<u8>>() }; ($iter:expr, usize1) => { read_value!($iter, usize) - 1 }; ($iter:expr, $t:ty) => { $iter.next().unwrap().parse::<$t>().expect("Parse error") }; } // ---------- end input macro ---------- use std::io::Write; use std::collections::*; type Map<K, V> = BTreeMap<K, V>; type Set<T> = BTreeSet<T>; type Deque<T> = VecDeque<T>; fn run() { input! { a: usize, } /* let mut v = 1; let mut gen = || { let res = v; v += 1; res }; let src = 0; let mut e = vec![]; let mut x = vec![]; let mut y = vec![]; let mut z = vec![]; for i in 1..=39 { x.push(gen()); y.push(gen()); z.push(gen()); } let dst = z[z.len() - 1]; e.push((src, x[0])); e.push((src, y[0])); for i in 1..x.len() { e.push((x[i - 1], x[i])); e.push((x[i - 1], y[i])); e.push((y[i - 1], x[i])); e.push((y[i - 1], y[i])); e.push((z[i - 1], z[i])); } for i in 0..40 { if a >> i & 1 == 1 { e.push((x[i], z[i])); } } println!("{} {}", dst + 1, e.len()); for (a, b) in e { println!("{} {}", a + 1, b + 1); } */ } fn main() { run(); }