結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー samplelpmas
提出日時 2017-04-11 18:54:52
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 1,723 ms
コンパイル使用メモリ 73,916 KB
実行使用メモリ 54,852 KB
最終ジャッジ日時 2024-07-18 09:05:31
合計ジャッジ時間 4,262 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 13
権限があれば一括ダウンロードができます

ソースコード

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