結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-24 02:56:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 74,132 KB
実行使用メモリ 54,420 KB
最終ジャッジ日時 2024-04-19 08:14:59
合計ジャッジ時間 4,884 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
54,164 KB
testcase_01 AC 129 ms
54,108 KB
testcase_02 AC 126 ms
54,160 KB
testcase_03 AC 127 ms
53,992 KB
testcase_04 AC 114 ms
52,748 KB
testcase_05 AC 117 ms
52,724 KB
testcase_06 AC 128 ms
54,420 KB
testcase_07 AC 125 ms
53,872 KB
testcase_08 AC 130 ms
54,168 KB
testcase_09 AC 128 ms
54,084 KB
testcase_10 AC 130 ms
54,136 KB
testcase_11 AC 126 ms
54,020 KB
testcase_12 AC 114 ms
52,684 KB
testcase_13 AC 126 ms
53,968 KB
testcase_14 AC 129 ms
54,180 KB
testcase_15 AC 129 ms
54,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.System.*;

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