結果

問題 No.632 穴埋め門松列
コンテスト
ユーザー kohei2019
提出日時 2022-02-17 22:42:01
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 520 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 152 ms
コンパイル使用メモリ 85,508 KB
実行使用メモリ 53,624 KB
最終ジャッジ日時 2026-03-18 18:47:50
合計ジャッジ時間 774 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

ls = input().split()
def  ok(lsl):
    if lsl[0] < lsl[1] and lsl[1] > lsl[2] and lsl[0] != lsl[2]:
        return True
    if lsl[0] > lsl[1] and lsl[1] < lsl[2] and lsl[0] != lsl[2]:
        return True
    return False
ans = ''
ls2 = []
for i in range(3):
    if ls[i] == '?':
        ls2.append(1)
    else:
        ls2.append(int(ls[i]))
if ok(ls2):
    ans += '1'
ls2 = []
for i in range(3):
    if ls[i] == '?':
        ls2.append(4)
    else:
        ls2.append(int(ls[i]))
if ok(ls2):
    ans += '4'
print(ans)
0