結果
| 問題 | No.502 階乗を計算するだけ |
| コンテスト | |
| ユーザー |
coderkc
|
| 提出日時 | 2019-06-06 02:00:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 55,936 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-09-22 17:04:52 |
| 合計ジャッジ時間 | 3,545 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 WA * 1 TLE * 1 -- * 19 |
コンパイルメッセージ
main.cpp: In function ‘long long int makeFactrial(long long int)’:
main.cpp:22:12: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
22 | return ret;
| ^~~
ソースコード
#include <iostream>
#define ll long long
using namespace std;
ll mod = 1000000007;
ll makeFactrial(ll a);
int main(){
ll N;
cin >>N;
cout << makeFactrial(N) << endl;
return 0;
}
ll makeFactrial(ll a){
ll pre = 1;
ll ret;
for(ll i=1;i<=a;i++){
ret = (i * pre) % mod;
pre = ret;
}
return ret;
}
coderkc