結果
問題 |
No.500 階乗電卓
|
ユーザー |
|
提出日時 | 2017-04-07 22:25:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 717 bytes |
コンパイル時間 | 859 ms |
コンパイル使用メモリ | 101,160 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-16 00:51:50 |
合計ジャッジ時間 | 1,628 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 13 |
ソースコード
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> using namespace std; const long long MOD = 1000000000000; int main() { long long n; cin >> n; long long ans = 1; for(long long i=1; i<=n; ++i){ ans *= i; ans %= MOD; if(ans == 0) break; } cout << ans << endl; return 0; }