結果

問題 No.188 HAPPY DAY
ユーザー n_gojon_gojo
提出日時 2020-04-09 11:06:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 593 bytes
コンパイル時間 3,809 ms
コンパイル使用メモリ 75,740 KB
実行使用メモリ 49,388 KB
最終ジャッジ日時 2023-09-29 12:22:45
合計ジャッジ時間 4,063 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.time.LocalDate;
import java.util.Scanner;

public class No188 {
    public static void main(String[] args) {
        LocalDate targetDate = LocalDate.of(2015, 1, 1);
        LocalDate endDate = LocalDate.of(2016, 1, 1);

        int ans = 0;
        while (targetDate.isBefore(endDate)) {
            int month = targetDate.getMonth().getValue();
            int day = targetDate.getDayOfMonth();
            if (month == (day/10 + day%10)) {
                ans++;
            }
            targetDate = targetDate.plusDays(1);
        }

        System.out.println(ans);
    }
}
0