結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー forest3
提出日時 2025-03-25 14:08:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 1,492 ms
コンパイル使用メモリ 161,632 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-25 14:08:58
合計ジャッジ時間 2,364 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)

int main() {
	int m;
	cin >> m;
	int n = 2017 * 2017 % m;
	int ans = 1;
	rep(i, 2017) ans = ans * n % m;
	ans += 2017;
	cout << ans % m << endl;
}
0