結果
| 問題 |
No.487 2017 Calculation(2017の計算)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-12 05:59:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 267 bytes |
| コンパイル時間 | 1,729 ms |
| コンパイル使用メモリ | 192,812 KB |
| 最終ジャッジ日時 | 2025-01-15 06:50:21 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll m; cin >> m;
ll res=2017;
ll p=2017*2017%m;
ll pp=1;
for(int i=0;i<2017;i++){
(pp*=p)%=m;
}
cout << (res+pp)%m << endl;
}