結果

問題 No.2109 Special Week
ユーザー shojin_proshojin_pro
提出日時 2022-10-28 21:55:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 279 ms / 2,000 ms
コード長 821 bytes
コンパイル時間 2,606 ms
コンパイル使用メモリ 82,808 KB
実行使用メモリ 62,036 KB
最終ジャッジ日時 2023-09-20 04:49:59
合計ジャッジ時間 15,228 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 249 ms
59,792 KB
testcase_01 AC 249 ms
59,788 KB
testcase_02 AC 268 ms
60,200 KB
testcase_03 AC 245 ms
60,352 KB
testcase_04 AC 279 ms
59,792 KB
testcase_05 AC 244 ms
59,880 KB
testcase_06 AC 259 ms
60,080 KB
testcase_07 AC 269 ms
60,452 KB
testcase_08 AC 266 ms
61,836 KB
testcase_09 AC 269 ms
60,452 KB
testcase_10 AC 261 ms
60,044 KB
testcase_11 AC 272 ms
60,420 KB
testcase_12 AC 251 ms
60,424 KB
testcase_13 AC 267 ms
60,164 KB
testcase_14 AC 254 ms
59,752 KB
testcase_15 AC 277 ms
59,992 KB
testcase_16 AC 242 ms
59,716 KB
testcase_17 AC 252 ms
59,564 KB
testcase_18 AC 269 ms
58,464 KB
testcase_19 AC 267 ms
60,004 KB
testcase_20 AC 267 ms
60,076 KB
testcase_21 AC 267 ms
62,036 KB
testcase_22 AC 244 ms
59,760 KB
testcase_23 AC 250 ms
59,736 KB
testcase_24 AC 257 ms
59,712 KB
testcase_25 AC 243 ms
59,752 KB
testcase_26 AC 273 ms
60,068 KB
testcase_27 AC 251 ms
59,772 KB
testcase_28 AC 249 ms
59,836 KB
testcase_29 AC 250 ms
59,752 KB
testcase_30 AC 270 ms
60,248 KB
testcase_31 AC 245 ms
59,724 KB
testcase_32 AC 272 ms
60,176 KB
testcase_33 AC 271 ms
60,432 KB
testcase_34 AC 242 ms
59,776 KB
testcase_35 AC 255 ms
59,736 KB
testcase_36 AC 253 ms
59,932 KB
testcase_37 AC 260 ms
59,540 KB
testcase_38 AC 267 ms
57,592 KB
testcase_39 AC 250 ms
59,568 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 = "2022"+String.format("%02d", sc.nextInt())+String.format("%02d", sc.nextInt());
        int K = sc.nextInt();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        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()).substring(4,8).toCharArray()){
                set.add(c);
            }
            cal.add(Calendar.DATE, 1);
        }
        System.out.println(set.size() >= K ? "Yes" : "No");
    }
}
0