結果
問題 |
No.502 階乗を計算するだけ
|
ユーザー |
![]() |
提出日時 | 2017-04-08 00:44:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 510 bytes |
コンパイル時間 | 531 ms |
コンパイル使用メモリ | 61,664 KB |
実行使用メモリ | 14,016 KB |
最終ジャッジ日時 | 2024-07-16 03:34:49 |
合計ジャッジ時間 | 3,615 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 19 TLE * 1 -- * 19 |
ソースコード
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <map> typedef long long ll; #define fi first #define se second using namespace std; ll N; ll ans; ll mod = 1000000007; //123456789 #define mod 1000000000000 //123456789012 int main(){ cin>>N; int i; ans = 1; if( N < mod ){ while( N ){ ans *= N; ans %= mod; N--; } cout<<ans<<endl; } else{ cout<<"0"<<endl; } return 0; }