結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2019-02-28 23:54:08 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 1,315 ms |
コンパイル使用メモリ | 159,256 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 11:54:42 |
合計ジャッジ時間 | 2,158 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {// 1. 入力情報取得.int M;cin >> M;// 2. 2017 + (2017 × 2017) の 2017乗 を, M で割った余りは?int ans = 1;for(int i = 0; i < 2017; i++) ans *= 2017, ans %= M, ans *= 2017, ans %= M;// 3. 後処理.ans += 2017;ans %= M;cout << ans << endl;return 0;}