結果

問題 No.653 E869120 and Lucky Numbers
ユーザー 👑 rin204rin204
提出日時 2022-10-30 16:51:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 77,268 KB
最終ジャッジ日時 2023-09-21 14:18:54
合計ジャッジ時間 3,930 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,200 KB
testcase_01 AC 70 ms
75,592 KB
testcase_02 AC 70 ms
75,664 KB
testcase_03 AC 71 ms
75,640 KB
testcase_04 AC 70 ms
75,748 KB
testcase_05 AC 69 ms
75,612 KB
testcase_06 AC 77 ms
76,536 KB
testcase_07 AC 69 ms
75,000 KB
testcase_08 AC 70 ms
75,908 KB
testcase_09 AC 68 ms
71,248 KB
testcase_10 AC 70 ms
71,152 KB
testcase_11 AC 68 ms
71,260 KB
testcase_12 AC 66 ms
71,348 KB
testcase_13 AC 66 ms
71,164 KB
testcase_14 WA -
testcase_15 AC 68 ms
71,304 KB
testcase_16 AC 66 ms
71,052 KB
testcase_17 AC 67 ms
71,380 KB
testcase_18 AC 68 ms
71,380 KB
testcase_19 AC 68 ms
71,296 KB
testcase_20 AC 69 ms
71,300 KB
testcase_21 AC 68 ms
71,152 KB
testcase_22 AC 69 ms
71,228 KB
testcase_23 AC 68 ms
71,384 KB
testcase_24 AC 69 ms
71,188 KB
testcase_25 AC 69 ms
71,300 KB
testcase_26 AC 68 ms
71,440 KB
testcase_27 AC 67 ms
71,420 KB
testcase_28 AC 82 ms
77,268 KB
testcase_29 AC 83 ms
77,232 KB
testcase_30 AC 78 ms
76,896 KB
testcase_31 AC 68 ms
71,436 KB
testcase_32 AC 69 ms
71,244 KB
testcase_33 AC 67 ms
71,328 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]:
        t = 1
        S[i] = 0
    else:
        print("No")
        exit()

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