結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2017-04-07 23:26:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 409 bytes |
コンパイル時間 | 596 ms |
コンパイル使用メモリ | 64,484 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 03:06:05 |
合計ジャッジ時間 | 1,221 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; const ll mod = 1000000000000; int main() { ll N; cin >> N; ll num_zeros = 0; for (ll i=5;i<=N;i*=5){ num_zeros += N/i; if (num_zeros>=12) break; } if(num_zeros>=12) printf("000000000000\n"); else { ll ans=1; for (ll i=2;i<=N;i+=1){ ans = ans * i % mod; } printf("%llu\n", ans); } }