結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー samplelpmas
提出日時 2017-04-11 18:56:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 2,016 ms
コンパイル使用メモリ 74,116 KB
実行使用メモリ 41,784 KB
最終ジャッジ日時 2024-07-18 09:05:39
合計ジャッジ時間 4,275 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int M = sc.nextInt();

        long result = 1;

        for (int i = 0; i < 2017; i++) {
            result = result * 2017 * 2017 % M;
        }

        result += 2017;
        result %= M;

        System.out.println(result);

    }

}
0