結果
問題 | No.523 LED |
ユーザー |
![]() |
提出日時 | 2016-05-04 15:53:48 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 89 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 118 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-05 06:29:50 |
合計ジャッジ時間 | 1,357 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:22:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d", &n); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #define MOD 1000000007 typedef unsigned long long flandre; long solve(int n){ flandre result = 1; int i; for (i = 1; i <= n; i++) { result *= i; result %= MOD; result *= (2 * i - 1); result %= MOD; } return (long)result; } int main(void){ int n; scanf("%d", &n); printf("%ld\n", solve(n)); return 0; }