結果
問題 |
No.502 階乗を計算するだけ
|
ユーザー |
![]() |
提出日時 | 2017-04-09 00:00:53 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 112 ms |
コンパイル使用メモリ | 23,168 KB |
実行使用メモリ | 9,120 KB |
最終ジャッジ日時 | 2024-07-17 23:57:48 |
合計ジャッジ時間 | 3,120 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 32 TLE * 1 -- * 19 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%llu",&n); | ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> #include <stdlib.h> int main(void){ unsigned long long n; scanf("%llu",&n); if(n>=1000000007){ printf("0\n"); return 0; } unsigned long long a[100000]; a[0]=1;a[1]=1; int m=1; int i=2,j=2,kai=1; while(i<=n){ if(j!=0){ a[j]=(a[j-1]*i)%1000000007; }else{ a[j]=(a[99999]*i)%1000000007; } i++; j++; if(j==100000){ j=0; } } printf("%llu\n",a[j-1]); return 0; }