結果

問題 No.523 LED
ユーザー uenoku
提出日時 2017-08-28 08:56:21
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 12,429 ms
コンパイル使用メモリ 400,884 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-06 08:08:38
合計ジャッジ時間 14,235 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;
use std::str::*;
fn main() {
    let n:i64 = read();
    let mo:i64 = 1000000007;
    let mut ans = 1;
    for i in 1..(n+1){
        ans = ( ans * i)%mo *(2*i-1);
        ans = ans % mo;
    }
    println!("{}",ans);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().unwrap_or_else(|_| panic!("Faild to parse {}", s))
}


0