結果
| 問題 |
No.487 2017 Calculation(2017の計算)
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2017-08-03 17:30:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 339 bytes |
| コンパイル時間 | 440 ms |
| コンパイル使用メモリ | 54,364 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 20:25:36 |
| 合計ジャッジ時間 | 1,166 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
ソースコード
#include <iostream>
using namespace std;
long long int Pow(long long x,long long n,long long M){
long long int res=1;
while(n>0){
if(n%2==1)res=res*x%M;
x=x*x%M;
n/=2;
}
return res;
}
int main(){
int M;
cin >> M;
long long int ans=Pow(2017,4034,M);
ans=(ans+2017)%M;
cout << ans << endl;
return 0;
}
notetonous