結果

問題 No.632 穴埋め門松列
ユーザー nebukuro09
提出日時 2018-01-20 06:40:17
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 1,000 ms
コード長 345 bytes
コンパイル時間 630 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2024-12-24 20:29:17
合計ジャッジ時間 730 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

def ok(x):
    if x[0] < x[1] and x[1] > x[2] and x[0] != x[2]:
        return True
    if x[0] > x[1] and x[1] < x[2] and x[0] != x[2]:
        return True
    return False

S = raw_input()
A = map(int, S.replace('?', '1').split())
B = map(int, S.replace('?', '4').split())

ans = ''
if ok(A):
    ans += '1'
if ok(B):
    ans += '4'
print ans
0