結果

問題 No.653 E869120 and Lucky Numbers
ユーザー rin204
提出日時 2022-10-30 16:51:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 68,700 KB
最終ジャッジ日時 2024-07-07 08:05:18
合計ジャッジ時間 2,104 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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