結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2017-04-06 22:20:16 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 219 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-17 21:41:43 |
合計ジャッジ時間 | 1,096 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&m); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>int main(void){int m;scanf("%d",&m);int x=1,r,r2;r=2017%m;r2=(2017*2017)%m;for(int i=0;i<2017;i++){x=x*r2;if(x>=2017){x%=m;}}x=x+r;x%=m;printf("%d\n",x);return 0;}