結果

問題 No.653 E869120 and Lucky Numbers
ユーザー rlangevinrlangevin
提出日時 2023-09-22 12:32:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 756 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 76,692 KB
最終ジャッジ日時 2023-09-22 12:32:16
合計ジャッジ時間 5,404 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 77 ms
75,796 KB
testcase_02 WA -
testcase_03 AC 76 ms
75,660 KB
testcase_04 AC 78 ms
75,632 KB
testcase_05 WA -
testcase_06 AC 81 ms
76,260 KB
testcase_07 AC 75 ms
71,360 KB
testcase_08 WA -
testcase_09 AC 85 ms
71,404 KB
testcase_10 AC 75 ms
70,924 KB
testcase_11 AC 74 ms
71,364 KB
testcase_12 AC 74 ms
70,928 KB
testcase_13 AC 73 ms
71,200 KB
testcase_14 WA -
testcase_15 AC 75 ms
71,076 KB
testcase_16 AC 75 ms
71,132 KB
testcase_17 AC 77 ms
71,128 KB
testcase_18 AC 76 ms
70,932 KB
testcase_19 AC 75 ms
71,428 KB
testcase_20 AC 76 ms
71,308 KB
testcase_21 AC 85 ms
71,244 KB
testcase_22 AC 75 ms
71,084 KB
testcase_23 AC 77 ms
71,196 KB
testcase_24 AC 74 ms
71,208 KB
testcase_25 WA -
testcase_26 AC 77 ms
71,228 KB
testcase_27 AC 75 ms
71,364 KB
testcase_28 AC 85 ms
76,456 KB
testcase_29 AC 86 ms
76,300 KB
testcase_30 AC 83 ms
76,604 KB
testcase_31 AC 74 ms
71,412 KB
testcase_32 AC 74 ms
71,180 KB
testcase_33 AC 85 ms
70,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def No():
    print("No")
    exit()


A = [int(s) for s in input()]
A.reverse()
f0, f1 = 1, 0
for a in A:
    if a == 0:
        No()
    elif a == 1:
        if f1:
            f0, f1 = 1, 0
        else:
            No()
    elif a == 2:
        if f0:
            f0, f1 = 0, 1
        else:
            No()
    elif a == 3:
        f0, f1 = 0, 1
    elif a == 4:
        f0, f1 = 0, 1
    elif a == 5:
        if f1:
            f0, f1 = 0, 1
        else:
            No()
    elif a == 6:
        if f0:
            f0, f1 = 1, 0
        else:
            No()
    elif a == 7:
        f0, f1 = 1, 0
    elif a == 8:
        if f1:
            f0, f1 = 1, 0
        else:
            No()
    else:
        No()

print("Yes") if f0 else print("No")
0