結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2020-07-29 00:23:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 385 bytes |
コンパイル時間 | 3,190 ms |
コンパイル使用メモリ | 191,160 KB |
最終ジャッジ日時 | 2025-01-12 07:24:43 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef long double ld; typedef pair<int,int> P; int main() { int mod; cin >> mod; ll res = 1; ll d = 2017 * 2017 % mod; for (int i = 0; i < 2017; i++) { (res *= d) %= mod; } cout << (res + 2017) % mod << endl; return 0; }