結果

問題 No.2109 Special Week
ユーザー shika_126
提出日時 2022-10-30 21:19:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-07 13:05:23
合計ジャッジ時間 2,311 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

m, d, k = map(int, input().split())
a = str(m)
for i in range(7):
    t = d+i
    if m == 2:
        t = t % 28
        if t == 0:
            t = 28
            a += str((m+1) % 12)
        a += str(t).zfill(2)
    elif m in [4, 6, 9, 11]:
        t = t % 30
        if t == 0:
            t = 30
            a += str((m+1) % 12)
        a += str(t).zfill(2)
    else:
        t = t % 31
        if t == 0:
            t = 31
            a += str((m+1) % 12)
        a += str(t).zfill(2)
if len(set(list(a))) < k:
    print("No")
else:
    print("Yes")
0