結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー YamaKasa
提出日時 2018-09-23 19:59:21
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 73,496 KB
実行使用メモリ 41,336 KB
最終ジャッジ日時 2024-09-14 13:43:20
合計ジャッジ時間 5,063 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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