結果

問題 No.632 穴埋め門松列
ユーザー nebukuro09nebukuro09
提出日時 2018-01-20 06:40:17
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 1,000 ms
コード長 345 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 6,024 KB
最終ジャッジ日時 2023-08-26 05:34:49
合計ジャッジ時間 861 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,024 KB
testcase_01 AC 11 ms
5,932 KB
testcase_02 AC 11 ms
5,856 KB
testcase_03 AC 11 ms
5,980 KB
testcase_04 AC 11 ms
5,976 KB
testcase_05 AC 11 ms
5,956 KB
権限があれば一括ダウンロードができます

ソースコード

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