結果

問題 No.2109 Special Week
ユーザー tamato
提出日時 2022-10-28 21:23:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 683 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-07-06 00:20:09
合計ジャッジ時間 3,016 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    M, D, K = map(int, input().split())

    S = set()
    for _ in range(7):
        S.add(M // 10)
        S.add(M % 10)
        S.add(D // 10)
        S.add(D % 10)

        D += 1
        if M == 2:
            if D == 29:
                M += 1
                D = 1
        elif M in [4, 6, 9, 11]:
            if D == 31:
                M += 1
                D = 1
        else:
            if D == 32:
                M += 1
                D = 1
        if M == 13:
            M = 1
    if len(S) >= K:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
0