結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2018-01-06 22:43:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 382 bytes |
コンパイル時間 | 624 ms |
コンパイル使用メモリ | 73,800 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 09:14:46 |
合計ジャッジ時間 | 1,396 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cmath> #include <stack> #include <cctype> #include <stdio.h> using namespace std; int main() { long long m=0; cin>>m; long long x = (2017*2017)%m; int a =1; for(int i=0; i<2017; i++){ a *=x; a %=m; } cout<<(a+2017)%m<<endl; return 0; }