結果

問題 No.1828 Except 3
ユーザー siman
提出日時 2022-02-02 11:14:26
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 13,332 ms
コンパイル使用メモリ 379,364 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 09:20:27
合計ジャッジ時間 13,811 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable `A` should have a snake case name
  --> src/main.rs:16:9
   |
16 |     let A = read_line();
   |         ^ help: convert the identifier to snake case: `a`
   |
   = note: `#[warn(non_snake_case)]` on by default

warning: variable `B` should have a snake case name
  --> src/main.rs:17:9
   |
17 |     let B = read_line();
   |         ^ help: convert the identifier to snake case: `b`

warning: variable `C` should have a snake case name
  --> src/main.rs:18:9
   |
18 |     let C = read_line();
   |         ^ help: convert the identifier to snake case (notice the capitalization): `c`

ソースコード

diff #

fn read_line() -> Vec<i32> {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect()
}

fn main() {
    let _n: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };
    
    let A = read_line();
    let B = read_line();
    let C = read_line();
    
    let ac = A.iter().filter(|&a| *a % 3 != 0).count();
    let bc = B.iter().filter(|&b| *b % 3 != 0).count();
    let cc = C.iter().filter(|&c| *c % 3 != 0).count();
    
    println!("{}", ac * bc * cc);
}
0