結果
| 問題 | No.487 2017 Calculation(2017の計算) |
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2017-08-03 17:30:04 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 267µs | |
| コード長 | 339 bytes |
| 記録 | |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 70,144 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-14 05:32:25 |
| 合計ジャッジ時間 | 1,487 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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