結果
| 問題 |
No.523 LED
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-22 23:32:10 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 358 bytes |
| コンパイル時間 | 13,346 ms |
| コンパイル使用メモリ | 376,868 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 12:22:08 |
| 合計ジャッジ時間 | 14,163 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
use std::io;
fn main() {
let div = 1000000007;
let mut st = String::new();
io::stdin().read_line(&mut st).unwrap();
let n: u64 = st.trim().parse().unwrap();
println!("{}", (1..n + 1).fold(1, |mut s, i| {
s *= i * 2 - 1;
if s > div { s = s % div; }
s *= i;
if s > div { s = s % div; }
s
}));
}