結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2017-08-04 15:04:19 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 1,362 ms |
コンパイル使用メモリ | 157,800 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 20:50:33 |
合計ジャッジ時間 | 2,145 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include <bits/stdc++.h>#define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++)#define REP(i,n) FOR(i,0,n)#define MOD 1000000007#define int long longusing namespace std;typedef long long ll;const int INF = 1e9;signed main(){int M;cin >> M;int f = (2017 % M) * (2017 % M) % M;int f2 = f;REP(i,2016) {f *= f2;f %= M;}cout << (2017 + f) % M << endl;}