結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー rinrinta121rinrinta121
提出日時 2019-04-25 17:41:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 791 ms
コンパイル使用メモリ 73,624 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-13 03:57:14
合計ジャッジ時間 2,051 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
const int mod = 1e9 + 7;
const int INF = 1e9;
using namespace std;
typedef long long ll;

int main()
{
    int m;
    cin >> m;
    int n = 2017 % m;
    int k = (n * n) % m;

    for(int i = 0 ; i < 2017; i++){
        k *= k;
        k %= m;
    }
    cout << (k + 2017) % m;
}
0