結果
問題 | No.2451 Redistribute Integers |
ユーザー | あさくち |
提出日時 | 2023-09-01 21:27:30 |
言語 | Rust (1.77.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 927 bytes |
コンパイル時間 | 1,001 ms |
コンパイル使用メモリ | 144,056 KB |
実行使用メモリ | 14,028 KB |
最終ジャッジ日時 | 2023-09-01 21:27:34 |
合計ジャッジ時間 | 2,303 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 35 ms
14,028 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 1 ms
4,376 KB |
testcase_08 | AC | 26 ms
11,352 KB |
testcase_09 | AC | 1 ms
4,376 KB |
testcase_10 | AC | 1 ms
4,380 KB |
testcase_11 | AC | 1 ms
4,376 KB |
testcase_12 | WA | - |
testcase_13 | AC | 34 ms
11,744 KB |
testcase_14 | AC | 34 ms
12,724 KB |
testcase_15 | AC | 18 ms
7,320 KB |
testcase_16 | AC | 17 ms
6,520 KB |
testcase_17 | WA | - |
testcase_18 | AC | 34 ms
12,792 KB |
testcase_19 | WA | - |
testcase_20 | AC | 29 ms
11,040 KB |
testcase_21 | WA | - |
ソースコード
fn main() { let n = input_value(); let a: Vec<isize> = input_vec(); let mut total = 0; for i in 0..n { total += a[i]; } if total % n as isize == 0 { println!("Yes"); } else { println!("No"); } } fn input_value<T>() -> T where T: std::str::FromStr, <T as std::str::FromStr>::Err: std::fmt::Debug, { let stdin = std::io::stdin(); let mut buf = String::new(); stdin.read_line(&mut buf).unwrap(); buf = buf.trim_end().to_owned(); let n = buf.parse().unwrap(); n } fn input_vec<T>() -> Vec<T> where T: std::str::FromStr, <T as std::str::FromStr>::Err: std::fmt::Debug, { let stdin = std::io::stdin(); let mut buf = String::new(); stdin.read_line(&mut buf).unwrap(); buf = buf.trim_end().to_owned(); let iter = buf.split_whitespace(); let line = iter.map(|x| x.parse().unwrap()).collect(); line }