結果

問題 No.653 E869120 and Lucky Numbers
ユーザー RyutoRyuto
提出日時 2018-03-19 17:32:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 915 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 76,872 KB
最終ジャッジ日時 2023-10-11 19:27:23
合計ジャッジ時間 4,687 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,364 KB
testcase_01 AC 79 ms
75,588 KB
testcase_02 AC 83 ms
76,180 KB
testcase_03 AC 82 ms
76,284 KB
testcase_04 AC 80 ms
76,172 KB
testcase_05 AC 80 ms
76,152 KB
testcase_06 AC 81 ms
76,184 KB
testcase_07 AC 76 ms
71,212 KB
testcase_08 AC 78 ms
76,136 KB
testcase_09 AC 74 ms
71,392 KB
testcase_10 AC 75 ms
71,464 KB
testcase_11 AC 74 ms
71,204 KB
testcase_12 AC 75 ms
71,196 KB
testcase_13 AC 75 ms
71,200 KB
testcase_14 AC 74 ms
71,072 KB
testcase_15 AC 73 ms
71,360 KB
testcase_16 AC 74 ms
71,320 KB
testcase_17 AC 75 ms
71,356 KB
testcase_18 AC 76 ms
71,364 KB
testcase_19 AC 76 ms
71,348 KB
testcase_20 AC 76 ms
71,268 KB
testcase_21 AC 76 ms
71,368 KB
testcase_22 AC 76 ms
71,288 KB
testcase_23 AC 73 ms
71,104 KB
testcase_24 AC 76 ms
71,364 KB
testcase_25 AC 74 ms
71,420 KB
testcase_26 AC 75 ms
71,336 KB
testcase_27 AC 75 ms
71,408 KB
testcase_28 AC 88 ms
76,872 KB
testcase_29 AC 86 ms
76,824 KB
testcase_30 AC 85 ms
76,856 KB
testcase_31 AC 74 ms
71,416 KB
testcase_32 AC 74 ms
71,412 KB
testcase_33 AC 74 ms
71,360 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 <= 1 and ps == 7:
            sw = 1
            continue
        elif 0 <= sw <= 1 and ps == 8:
            sw = 2
            continue
        else:
            print('No')
            quit()
else:
    print('No')
    quit()

print('Yes')
0