結果

問題 No.653 E869120 and Lucky Numbers
ユーザー RyutoRyuto
提出日時 2018-03-19 17:29:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 915 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 77,368 KB
最終ジャッジ日時 2023-08-30 20:29:50
合計ジャッジ時間 4,200 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,524 KB
testcase_01 AC 73 ms
75,720 KB
testcase_02 AC 78 ms
76,396 KB
testcase_03 AC 80 ms
76,576 KB
testcase_04 AC 80 ms
76,452 KB
testcase_05 AC 75 ms
76,404 KB
testcase_06 AC 79 ms
76,452 KB
testcase_07 AC 72 ms
71,296 KB
testcase_08 AC 77 ms
76,240 KB
testcase_09 AC 70 ms
71,480 KB
testcase_10 AC 70 ms
71,448 KB
testcase_11 AC 70 ms
71,372 KB
testcase_12 AC 71 ms
71,456 KB
testcase_13 AC 70 ms
71,404 KB
testcase_14 AC 71 ms
71,392 KB
testcase_15 AC 69 ms
71,372 KB
testcase_16 AC 70 ms
71,376 KB
testcase_17 AC 70 ms
71,336 KB
testcase_18 AC 71 ms
71,376 KB
testcase_19 WA -
testcase_20 AC 74 ms
71,456 KB
testcase_21 AC 72 ms
71,388 KB
testcase_22 AC 72 ms
71,444 KB
testcase_23 AC 71 ms
71,368 KB
testcase_24 AC 71 ms
71,320 KB
testcase_25 AC 69 ms
71,448 KB
testcase_26 AC 72 ms
71,256 KB
testcase_27 AC 70 ms
71,504 KB
testcase_28 AC 85 ms
76,976 KB
testcase_29 AC 87 ms
77,368 KB
testcase_30 AC 84 ms
76,936 KB
testcase_31 AC 73 ms
71,448 KB
testcase_32 AC 72 ms
71,452 KB
testcase_33 AC 72 ms
71,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python

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

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[-1] or plist[-1] >= 5:
    print('No')
    quit()

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

print('Yes')
0