結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー ikd
提出日時 2017-02-24 22:42:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 616 ms
コンパイル使用メモリ 57,468 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-02 23:12:44
合計ジャッジ時間 1,384 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;
#define int long long

signed main(){

   int M;
   cin>> M;

   int s=1;
   for(int i=0; i<2017; i++){
      (s*=((2017%M)*(2017%M)))%=M;
   }

   (s+=2017)%=M;
   cout<< s<< endl;
   
}
0