結果
問題 |
No.487 2017 Calculation(2017の計算)
|
ユーザー |
|
提出日時 | 2017-03-02 20:49:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 829 bytes |
コンパイル時間 | 1,678 ms |
コンパイル使用メモリ | 165,436 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-13 01:39:32 |
合計ジャッジ時間 | 2,393 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; #define P(x) cout << (x) << endl #define p(x) cout << (x) #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define VV(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i)); #define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i) #define rrep(i,a,n) for(int i=(a); i>n; --i) #define len(x) ((int)(x).size()) #define mp make_pair #define eb emplace_back typedef long long ll; typedef vector<int> vi; typedef vector<double> vd; typedef vector<long long> vll; typedef vector<string> vs; typedef vector<bool> vb; inline ll f() { ll m; cin >> m; ll ans = 1; rep(i, 0, 2017) { ans = ans * (2017 * 2017) % m; } return (ans + 2017) % m; } int main() { P(f()); return 0; }