結果

問題 No.2109 Special Week
ユーザー shojin_proshojin_pro
提出日時 2022-10-28 22:06:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 795 bytes
コンパイル時間 4,540 ms
コンパイル使用メモリ 77,728 KB
実行使用メモリ 59,168 KB
最終ジャッジ日時 2023-09-20 05:05:09
合計ジャッジ時間 14,625 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 210 ms
56,416 KB
testcase_01 AC 220 ms
56,668 KB
testcase_02 AC 209 ms
56,468 KB
testcase_03 AC 209 ms
56,888 KB
testcase_04 AC 220 ms
58,100 KB
testcase_05 AC 210 ms
56,348 KB
testcase_06 AC 220 ms
56,488 KB
testcase_07 AC 223 ms
56,596 KB
testcase_08 AC 219 ms
56,692 KB
testcase_09 AC 209 ms
56,668 KB
testcase_10 AC 222 ms
55,768 KB
testcase_11 AC 242 ms
58,172 KB
testcase_12 AC 222 ms
56,524 KB
testcase_13 AC 220 ms
56,676 KB
testcase_14 AC 245 ms
57,800 KB
testcase_15 AC 225 ms
56,584 KB
testcase_16 AC 224 ms
56,364 KB
testcase_17 AC 244 ms
58,172 KB
testcase_18 AC 245 ms
58,148 KB
testcase_19 AC 223 ms
56,704 KB
testcase_20 AC 223 ms
56,628 KB
testcase_21 AC 216 ms
56,284 KB
testcase_22 AC 223 ms
58,060 KB
testcase_23 AC 214 ms
56,688 KB
testcase_24 AC 223 ms
56,888 KB
testcase_25 AC 227 ms
56,696 KB
testcase_26 AC 252 ms
59,168 KB
testcase_27 AC 216 ms
56,632 KB
testcase_28 AC 222 ms
56,540 KB
testcase_29 AC 222 ms
56,600 KB
testcase_30 AC 234 ms
57,952 KB
testcase_31 AC 227 ms
57,912 KB
testcase_32 AC 222 ms
56,540 KB
testcase_33 AC 213 ms
57,040 KB
testcase_34 AC 223 ms
56,628 KB
testcase_35 AC 244 ms
57,716 KB
testcase_36 AC 221 ms
56,792 KB
testcase_37 AC 224 ms
57,960 KB
testcase_38 AC 225 ms
56,672 KB
testcase_39 AC 223 ms
56,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.text.SimpleDateFormat;
import java.sql.Timestamp;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String start = String.format("%02d", sc.nextInt())+String.format("%02d", sc.nextInt());
        int K = sc.nextInt();
        SimpleDateFormat sdf = new SimpleDateFormat("MMdd");
        Calendar cal = Calendar.getInstance();
        cal.setTime(sdf.parse(start));
        HashSet<Character> set = new HashSet<>();
        for(int i = 0; i < 7; i++){
            for(char c : sdf.format(cal.getTime()).toCharArray()){
                set.add(c);
            }
            cal.add(Calendar.DATE, 1);
        }
        System.out.println(set.size() >= K ? "Yes" : "No");
    }
}
0