結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,252 KB
testcase_01 AC 72 ms
75,748 KB
testcase_02 AC 72 ms
75,836 KB
testcase_03 AC 72 ms
75,856 KB
testcase_04 AC 78 ms
76,340 KB
testcase_05 AC 73 ms
76,044 KB
testcase_06 WA -
testcase_07 AC 70 ms
71,484 KB
testcase_08 AC 73 ms
75,956 KB
testcase_09 AC 69 ms
71,120 KB
testcase_10 WA -
testcase_11 AC 69 ms
71,476 KB
testcase_12 AC 68 ms
71,512 KB
testcase_13 AC 71 ms
71,256 KB
testcase_14 AC 72 ms
71,192 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 72 ms
71,588 KB
testcase_18 AC 70 ms
71,280 KB
testcase_19 AC 70 ms
71,604 KB
testcase_20 AC 70 ms
71,280 KB
testcase_21 AC 68 ms
71,644 KB
testcase_22 AC 68 ms
71,164 KB
testcase_23 AC 69 ms
71,540 KB
testcase_24 AC 69 ms
71,332 KB
testcase_25 AC 69 ms
71,608 KB
testcase_26 AC 68 ms
71,440 KB
testcase_27 AC 69 ms
71,492 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 75 ms
77,188 KB
testcase_31 AC 68 ms
71,604 KB
testcase_32 AC 68 ms
71,332 KB
testcase_33 AC 68 ms
71,280 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 2 >= plist[0] and plist[0] >= 4:
    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