結果

問題 No.1828 Except 3
ユーザー 小野寺健
提出日時 2022-03-10 14:30:39
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 979 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 883 ms
コンパイル使用メモリ 185,016 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-04 13:27:12
合計ジャッジ時間 1,742 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf)
        .expect("Failed to read line");
    let _n: i32 = buf.trim().parse()
        .expect("not integer");
        let mut buf = String::new();
    io::stdin().read_line(&mut buf)
        .expect("Failed to read line");
    let a = buf.trim().split_whitespace()
        .map(|x| x.parse::<i32>().unwrap());
        let mut buf = String::new();
    io::stdin().read_line(&mut buf)
        .expect("Failed to read line");
    let b = buf.trim().split_whitespace()
        .map(|x| x.parse::<i32>().unwrap());
    let mut buf = String::new();
    io::stdin().read_line(&mut buf)
        .expect("Failed to read line");
    let c = buf.trim().split_whitespace()
        .map(|x| x.parse::<i32>().unwrap());
    let an = a.filter(|x| *x % 3 != 0).count();
    let bn = b.filter(|x| *x % 3 != 0).count();
    let cn = c.filter(|x| *x % 3 != 0).count();
    println!("{}", an * bn * cn);
}
0