結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー Nafmo2Nafmo2
提出日時 2017-02-24 22:59:42
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 374 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 57,356 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 23:36:58
合計ジャッジ時間 1,370 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:11: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |      scanf("%lld",&M);
      |      ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include<iostream>
using namespace std;
#include<cstdio>
#include<cstring>
#include<string>
typedef long long ll;
ll a,b,ans,M;
 int main(){
     scanf("%lld",&M);
     a=2017%M;
     for(int i=1;i<=2017;i++){
         if(i==1){
             b=(a*a)%M;
         }else{
             b=(b*b)%M;
         }
     }
     ans=(a+b)%M;
     printf("%lld",ans );

     return 0;

 }
0