結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー samplelpmassamplelpmas
提出日時 2017-04-11 18:54:52
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 2,844 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 57,944 KB
最終ジャッジ日時 2023-09-25 11:15:12
合計ジャッジ時間 5,341 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 124 ms
55,584 KB
testcase_02 AC 124 ms
56,260 KB
testcase_03 AC 124 ms
55,904 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

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