結果
| 問題 |
No.487 2017 Calculation(2017の計算)
|
| コンテスト | |
| ユーザー |
rinrinta121
|
| 提出日時 | 2019-04-27 20:20:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 574 bytes |
| コンパイル時間 | 713 ms |
| コンパイル使用メモリ | 75,140 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-29 12:07:00 |
| 合計ジャッジ時間 | 1,469 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 11 |
ソースコード
#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;
template<class T>
bool chmin(T& a,T b){
if(a < b){
a = b;
return true;
}
return false;
}
ll h[100010];
ll dp[100010];
int main()
{
ll m;
cin >> m;
ll n = 2017 % m;
ll k = (n * n) % m ;
for(int i = 0 ; i < 2017; i++){
k *= k;
k %= m;
}
cout << (k + 2017) % m << endl;
}
rinrinta121