結果

問題 No.632 穴埋め門松列
ユーザー shamioshamio
提出日時 2020-02-01 10:01:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 669 ms / 1,000 ms
コード長 358 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 70,848 KB
最終ジャッジ日時 2023-10-18 23:49:12
合計ジャッジ時間 6,734 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 669 ms
42,576 KB
testcase_01 AC 470 ms
42,564 KB
testcase_02 AC 463 ms
42,564 KB
testcase_03 AC 464 ms
42,564 KB
testcase_04 AC 459 ms
42,564 KB
testcase_05 AC 460 ms
70,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

c = input()
c = c.replace(" ", "", 2)


def is_kadomatsu(s):
    li = list(s)
    rank = np.argsort(li)
    if rank[0] == 1 or rank[2] == 1:
        return True
    else:
        return False


c1 = c.replace("?", "1")
c4 = c.replace("?", "4")

ans = ""
if is_kadomatsu(c1):
    ans += "1"
if is_kadomatsu(c4):
    ans += "4"

print(ans)
0