結果

問題 No.500 階乗電卓
ユーザー tonyu0
提出日時 2020-04-05 15:21:24
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 12,665 ms
コンパイル使用メモリ 378,696 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-03 08:12:53
合計ジャッジ時間 12,197 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: u64 = itr.next().unwrap().parse().unwrap();
    let mut ans = 1;
    if n < 50 {
        for i in 1..n + 1 {
            ans = (ans * i) % 1000000000000;
        }
    } else {
        ans = 0;
    }
    println!("{:<012}", ans);
}
0