結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2021-07-21 23:51:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,056 bytes |
コンパイル時間 | 8,171 ms |
コンパイル使用メモリ | 414,052 KB |
最終ジャッジ日時 | 2025-01-23 05:21:11 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <boost/multiprecision/cpp_int.hpp> namespace mp = boost::multiprecision; #include <atcoder/all> using namespace atcoder; #pragma GCC optimize("O0") typedef long long int ll; typedef long double ld; const ll mod = 1e9+7; const ll INF = 1e18; #define rep(i,n) for (ll i = 0; i < (n); ++i) #define Rep(i,a,n) for (ll i = (a); i < (n); ++i) #define All(a) (a).begin(),(a).end() #define Pi acos(-1) using Graph = vector<vector<ll>>; using V = vector<ll>; using P = pair<ll,ll>; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } struct IoSetup { IoSetup() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << setprecision(15) << fixed; } } iosetup; int main() { ll n; cin >> n; ll ans = 1; rep(i,n) { ans *= (i+1); ans %= 1000000000000; if (ans == 0) { cout << "000000000000\n"; return 0; } } cout << ans << '\n'; }