結果

問題 No.653 E869120 and Lucky Numbers
ユーザー takenta
提出日時 2018-02-23 23:55:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 722 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-10-10 05:00:57
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 11 RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

p = list(map(int, list(input())))
u1 = (2, 3, 4)
u2 = (3, 4, 5, 6, 7, 8)
u3 = (1, 6, 7, 8)

p.reverse()
print(p)

if p[-1] == 1 and p[0] in (2, 3, 4) and all([e in (3, 4, 5) for e in p[1:-1]]):
    print('Yes')
elif p[-1] in (6, 7, 8) and p[0] in (2, 3, 4):
    if 8 in p[:-1]:
        if all([e in (6, 7) for e in p[-1:p.index(8, -1):-1]]) and all([e in (3, 4, 5) for e in p[:p.index(8, -1)+1:-1]]):
            print('Yes')
        else:
            print('No')
    elif 7 in p[-1]:
        if all([e in (6, 7) for e in p[-1:p.index(7, -1):-1]]) and all([e in (3, 4, 5) for e in p[:p.index(7, -1)+1:-1]]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
0