結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー GrenacheGrenache
提出日時 2017-02-24 22:28:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 3,343 ms
コンパイル使用メモリ 72,452 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-08-30 23:24:11
合計ジャッジ時間 6,403 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,420 KB
testcase_01 AC 123 ms
55,924 KB
testcase_02 AC 123 ms
56,000 KB
testcase_03 AC 123 ms
56,152 KB
testcase_04 AC 124 ms
55,720 KB
testcase_05 AC 124 ms
55,752 KB
testcase_06 AC 123 ms
56,052 KB
testcase_07 AC 125 ms
55,732 KB
testcase_08 AC 125 ms
55,696 KB
testcase_09 AC 125 ms
55,720 KB
testcase_10 AC 124 ms
55,952 KB
testcase_11 AC 124 ms
56,092 KB
testcase_12 AC 125 ms
55,880 KB
testcase_13 AC 124 ms
55,876 KB
testcase_14 AC 124 ms
55,484 KB
testcase_15 AC 125 ms
56,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder487 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int m = sc.nextInt();

		long ret = 1;
		for (int i = 0; i < 2017; i++) {
			ret = ret * 2017 * 2017 % m;
		}

		ret += 2017;
		ret %= m;

		pr.println(ret);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0