結果

問題 No.2109 Special Week
ユーザー june19312june19312
提出日時 2022-10-28 21:58:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 1,106 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 71,604 KB
最終ジャッジ日時 2023-09-20 04:54:43
合計ジャッジ時間 5,793 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,360 KB
testcase_01 AC 91 ms
71,508 KB
testcase_02 AC 91 ms
71,392 KB
testcase_03 AC 89 ms
71,376 KB
testcase_04 AC 91 ms
71,244 KB
testcase_05 AC 90 ms
71,552 KB
testcase_06 AC 91 ms
71,124 KB
testcase_07 AC 90 ms
71,460 KB
testcase_08 AC 90 ms
71,512 KB
testcase_09 AC 90 ms
71,484 KB
testcase_10 AC 92 ms
71,500 KB
testcase_11 AC 92 ms
71,136 KB
testcase_12 AC 91 ms
71,244 KB
testcase_13 AC 90 ms
71,208 KB
testcase_14 AC 89 ms
71,372 KB
testcase_15 AC 91 ms
71,268 KB
testcase_16 AC 91 ms
71,516 KB
testcase_17 AC 92 ms
71,604 KB
testcase_18 AC 93 ms
71,520 KB
testcase_19 AC 98 ms
71,212 KB
testcase_20 AC 95 ms
71,136 KB
testcase_21 AC 96 ms
71,460 KB
testcase_22 AC 95 ms
71,252 KB
testcase_23 AC 96 ms
71,164 KB
testcase_24 AC 97 ms
71,388 KB
testcase_25 AC 96 ms
71,144 KB
testcase_26 AC 93 ms
71,364 KB
testcase_27 AC 90 ms
71,352 KB
testcase_28 AC 91 ms
71,408 KB
testcase_29 AC 90 ms
71,140 KB
testcase_30 AC 89 ms
71,128 KB
testcase_31 AC 90 ms
71,516 KB
testcase_32 AC 89 ms
71,396 KB
testcase_33 AC 91 ms
71,144 KB
testcase_34 AC 91 ms
71,140 KB
testcase_35 AC 92 ms
71,256 KB
testcase_36 AC 91 ms
71,484 KB
testcase_37 AC 91 ms
71,400 KB
testcase_38 AC 93 ms
71,364 KB
testcase_39 AC 92 ms
71,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import datetime

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

ans = [0]*10

nokori = 0

for i in range(7):
    Y = 2022

    tmp = datetime.datetime(Y,M,D+i)
    tmp2 = str(tmp)[5:7]
    tmp3 = str(tmp)[8:10]
    tmp4 = tmp2+tmp3
#    print("tmp4",tmp4)
    for ii,v in enumerate(tmp4):
        tmp5 = int(v)
        ans[tmp5]+=1

    if M == 12 and D+i == 31:
        nokori = 6-i
        break
    elif (M == 4 or M == 6 or M == 6 or M == 9 or M ==11) and D+i == 30:
        nokori = 6-i
        break
    elif (M == 1 or M == 3 or M == 5 or M == 7 or M == 8 or M == 10) and D+i == 31:
        nokori = 6-i
        break
    elif M == 2 and D+i == 28:
        nokori = 6-i
        break

if M == 12:
    M = 1
else:
    M+=1

D = 1

for i in range(nokori):
    Y = 2022
    tmp = datetime.datetime(Y,M,D+i)
    tmp2 = str(tmp)[5:7]
    tmp3 = str(tmp)[8:10]
    tmp4 = tmp2+tmp3
#    print("tmp4",tmp4)
    for ii,v in enumerate(tmp4):
        tmp5 = int(v)
        ans[tmp5]+=1

ans2 = 0
for ii,vv in enumerate(ans):
    if vv != 0:
        ans2+=1

if ans2 >=K:
    print("Yes") #ans
else:
    print("No") #ans


0