結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー 37zigen37zigen
提出日時 2017-02-24 22:44:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 3,074 ms
コンパイル使用メモリ 71,772 KB
実行使用メモリ 56,500 KB
最終ジャッジ日時 2023-08-30 23:32:04
合計ジャッジ時間 5,927 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,156 KB
testcase_01 AC 122 ms
55,824 KB
testcase_02 AC 120 ms
55,824 KB
testcase_03 AC 120 ms
55,848 KB
testcase_04 AC 121 ms
55,840 KB
testcase_05 AC 120 ms
56,100 KB
testcase_06 AC 120 ms
55,620 KB
testcase_07 AC 120 ms
55,460 KB
testcase_08 AC 121 ms
56,500 KB
testcase_09 AC 123 ms
55,920 KB
testcase_10 AC 121 ms
56,212 KB
testcase_11 AC 121 ms
55,736 KB
testcase_12 AC 122 ms
55,908 KB
testcase_13 AC 121 ms
55,676 KB
testcase_14 AC 120 ms
55,636 KB
testcase_15 AC 125 ms
56,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Q485 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long M = sc.nextLong();
		long ans = 1;
		for (int i = 0; i < 2017; ++i) {
			ans = ans * 2017 * 2017 % M;
		}
		ans += 2017;
		ans %= M;
		System.out.println(ans);
	}

}
0