結果

問題 No.653 E869120 and Lucky Numbers
ユーザー 👑 rin204rin204
提出日時 2022-10-30 16:52:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,528 KB
実行使用メモリ 77,060 KB
最終ジャッジ日時 2023-10-11 19:32:29
合計ジャッジ時間 4,297 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,880 KB
testcase_01 AC 78 ms
75,372 KB
testcase_02 AC 76 ms
75,556 KB
testcase_03 AC 76 ms
75,560 KB
testcase_04 AC 78 ms
75,488 KB
testcase_05 AC 78 ms
75,460 KB
testcase_06 AC 86 ms
76,240 KB
testcase_07 AC 79 ms
74,684 KB
testcase_08 AC 78 ms
75,560 KB
testcase_09 AC 76 ms
71,236 KB
testcase_10 AC 73 ms
70,712 KB
testcase_11 AC 74 ms
71,208 KB
testcase_12 AC 75 ms
71,204 KB
testcase_13 AC 75 ms
71,196 KB
testcase_14 AC 75 ms
71,316 KB
testcase_15 AC 74 ms
70,984 KB
testcase_16 AC 74 ms
71,044 KB
testcase_17 AC 74 ms
71,140 KB
testcase_18 AC 75 ms
70,916 KB
testcase_19 AC 74 ms
71,012 KB
testcase_20 AC 74 ms
71,388 KB
testcase_21 AC 73 ms
71,204 KB
testcase_22 AC 74 ms
71,208 KB
testcase_23 AC 73 ms
71,092 KB
testcase_24 AC 74 ms
71,016 KB
testcase_25 AC 73 ms
71,212 KB
testcase_26 AC 75 ms
71,000 KB
testcase_27 AC 73 ms
71,244 KB
testcase_28 AC 91 ms
77,060 KB
testcase_29 AC 91 ms
76,992 KB
testcase_30 AC 85 ms
76,792 KB
testcase_31 AC 75 ms
70,992 KB
testcase_32 AC 74 ms
71,044 KB
testcase_33 AC 75 ms
70,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(map(int, input()))[::-1]
t = 2
n = len(S)
S += [0, 0, 0, 0]
for i in range(n):
    if S[i] == 0:
        break
    elif S[i] in [2, 3, 4]:
        if t == 1:
            print("No")
            exit()
        S[i] = 0
        S[i + 1] -= 1
    elif S[i] in [6, 7]:
        if i == 0:
            print("No")
            exit()
        t = 1
        S[i] = 0
    else:
        print("No")
        exit()

if all(s == 0 for s in S):
    print("Yes")
else:
    print("No")
0