結果
| 問題 | No.487 2017 Calculation(2017の計算) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-24 23:17:55 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 336µs | |
| コード長 | 327 bytes |
| 記録 | |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 71,352 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-10-10 09:24:31 |
| 合計ジャッジ時間 | 1,600 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main(int argc, const char* argv[])
{
int a, b;
string s;
int M;
cin >> M;
int ret = 0;
int x = 2 * 2017;
int y = 2017 % M;
ret = y;
for (int i = 1; i < x; i++) {
ret = (ret * y) % M;
}
ret += 2017;
ret %= M;
cout << ret << endl;
return 0;
}