結果

問題 No.87 Advent Calendar Problem
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-05-17 16:04:22
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 709 bytes
コンパイル時間 3,927 ms
コンパイル使用メモリ 94,728 KB
実行使用メモリ 57,440 KB
最終ジャッジ日時 2023-10-17 07:22:09
合計ジャッジ時間 10,681 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package _0087;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        
        int month = 7;
        int day = 23;
        DayOfWeek first = LocalDate.of(2014, month, day).getDayOfWeek();
        
        long ans = IntStream.rangeClosed(2015, n)
                            .mapToObj(year -> LocalDate.of(year, month, day).getDayOfWeek())
                            .filter(dayOfWeek -> dayOfWeek == first)
                            .count();
        System.out.println(ans);
    }

}
0