結果

問題 No.653 E869120 and Lucky Numbers
ユーザー RyutoRyuto
提出日時 2018-03-19 17:15:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 862 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 76,944 KB
最終ジャッジ日時 2023-08-30 08:48:50
合計ジャッジ時間 4,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,088 KB
testcase_01 AC 75 ms
75,760 KB
testcase_02 AC 74 ms
76,196 KB
testcase_03 AC 74 ms
76,236 KB
testcase_04 AC 76 ms
76,712 KB
testcase_05 AC 74 ms
75,804 KB
testcase_06 WA -
testcase_07 AC 72 ms
71,372 KB
testcase_08 AC 75 ms
75,808 KB
testcase_09 AC 72 ms
71,376 KB
testcase_10 AC 72 ms
71,332 KB
testcase_11 AC 72 ms
71,176 KB
testcase_12 AC 72 ms
71,324 KB
testcase_13 AC 72 ms
71,088 KB
testcase_14 AC 72 ms
71,176 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 71 ms
71,332 KB
testcase_18 AC 71 ms
71,324 KB
testcase_19 AC 71 ms
71,192 KB
testcase_20 AC 72 ms
71,092 KB
testcase_21 AC 72 ms
71,288 KB
testcase_22 AC 71 ms
71,292 KB
testcase_23 AC 74 ms
71,284 KB
testcase_24 AC 71 ms
71,236 KB
testcase_25 AC 71 ms
71,196 KB
testcase_26 AC 71 ms
71,304 KB
testcase_27 AC 71 ms
71,540 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 76 ms
76,860 KB
testcase_31 AC 71 ms
71,356 KB
testcase_32 AC 69 ms
71,316 KB
testcase_33 AC 73 ms
71,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python

p = str(input())
plist = list(p)
plist = [int(x) for x in reversed(plist)]

if len(plist) == 1:
    print('No')
    quit()
elif len(plist) == 2:
    if 12 <= int(p) <= 14:
        print('Yes')
    else:
        print('No')
    quit()

if 1 >= plist[0] or plist[0] >= 5:
    print('No')
    quit()

if plist[-1] == 1:
    if max(plist[1:-1]) <= 5 and min(plist[1:-1]) >= 3:
        print('Yes')
    else:
        print('No')
    quit()
elif 6 <= plist[-1] <= 8:
    sw = 0 if plist[-1] == 6 else 1
    for ps in plist[1:-1]:
        if sw != 0 and 3 <= ps <= 5:
            sw = 2
            continue
        elif sw != 2 and 7 <= ps <= 8:
            sw = 1
            continue
        elif sw == 0 and ps == 6:
            continue
        else:
            print('No')
            quit()
else:
    print('No')
    quit()

print('Yes')
0