結果
問題 |
No.500 階乗電卓
|
ユーザー |
|
提出日時 | 2017-05-05 16:27:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 401 bytes |
コンパイル時間 | 570 ms |
コンパイル使用メモリ | 63,452 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 08:42:52 |
合計ジャッジ時間 | 1,445 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 13 |
ソースコード
#include <iostream> using namespace std; struct iostream_init_struct { iostream_init_struct() { std::cin.tie(0); std::cin.sync_with_stdio(false); } } iostream_init; int main(void) { long long N; cin >> N; if (N >= 50) { cout << '0' << endl; return 0; } long long ans = 1; for (int i = 2; i <= N; ++i) { ans = (ans * i) % 1000000000000LL; } cout << ans << endl; return 0; }