結果

問題 No.593 4進FizzBuzz
ユーザー phspls
提出日時 2020-05-07 22:20:59
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 11,388 ms
コンパイル使用メモリ 402,528 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-03 09:36:38
合計ジャッジ時間 15,510 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let a: usize = n.trim().chars().enumerate()
        .map(|pair| (pair.1).to_string().parse::<usize>().unwrap() * (1 << pair.0 << pair.0))
        .sum();
    if a % 3 == 0 || a % 5 == 0 {
        if a%3 == 0 {
            print!("Fizz");
        }
        if a%5 == 0 {
            print!("Buzz");
        }
        println!();
    } else {
        println!("{}", n.trim());
    }
}
0