結果

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

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let a: usize = n.trim().chars().rev().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