結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2017-02-28 23:34:32 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 142 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 3,815 ms |
コンパイル使用メモリ | 74,676 KB |
実行使用メモリ | 41,528 KB |
最終ジャッジ日時 | 2024-06-12 00:41:01 |
合計ジャッジ時間 | 7,359 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
import java.util.*;public class A{static Scanner s = new Scanner(System.in);static final int _2017_2 = 2017*2017;public static void main(String[] args) {int m=s.nextInt();long result = _2017_2;for(int i=1;i<2017;i++) {result*=_2017_2;result%=m;}result+=2017;result%=m;System.out.println(result);}}