結果

問題 No.87 Advent Calendar Problem
ユーザー kano_townkano_town
提出日時 2014-12-07 01:29:34
言語 Java19
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 468 bytes
コンパイル時間 3,301 ms
コンパイル使用メモリ 72,376 KB
実行使用メモリ 58,352 KB
最終ジャッジ日時 2023-09-02 09:11:16
合計ジャッジ時間 8,244 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 128 ms
56,088 KB
testcase_04 AC 129 ms
55,912 KB
testcase_05 AC 126 ms
55,812 KB
testcase_06 AC 128 ms
56,048 KB
testcase_07 AC 126 ms
55,784 KB
testcase_08 AC 126 ms
56,080 KB
testcase_09 WA -
testcase_10 AC 129 ms
55,660 KB
testcase_11 AC 125 ms
56,256 KB
testcase_12 AC 128 ms
55,688 KB
testcase_13 AC 126 ms
53,832 KB
testcase_14 AC 128 ms
55,688 KB
testcase_15 AC 128 ms
55,964 KB
testcase_16 AC 128 ms
55,648 KB
testcase_17 AC 129 ms
55,784 KB
testcase_18 AC 129 ms
55,588 KB
testcase_19 AC 127 ms
55,732 KB
testcase_20 AC 129 ms
55,872 KB
testcase_21 AC 130 ms
55,888 KB
testcase_22 AC 127 ms
55,632 KB
testcase_23 AC 125 ms
55,716 KB
testcase_24 AC 128 ms
56,204 KB
testcase_25 AC 128 ms
55,788 KB
testcase_26 AC 127 ms
56,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder87 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong() - 2014;
		long res = 57 * (N / 400);
		N = N % 400;
		// ツェラーの公式
		for (long i = 2015; i <= N + 2015; i++)
			if ((23 + (int) (26 * 8 / 10) + (i % 100) + (long) ((i % 100) / 4) + 5 * (long) (i / 100) + (long) (i / 100) / 4) % 7 == 4)
				res++;
		System.out.println(res);
	}
}
0