結果

問題 No.507 ゲーム大会(チーム決め)
ユーザー shikenagashikenaga
提出日時 2017-05-01 19:29:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 16,552 KB
最終ジャッジ日時 2023-10-12 02:10:10
合計ジャッジ時間 6,115 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
12,368 KB
testcase_01 AC 17 ms
8,100 KB
testcase_02 AC 16 ms
8,100 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,916 KB
testcase_05 AC 17 ms
7,996 KB
testcase_06 WA -
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n, m = map(int, input().rstrip().split())
k_pts = int(input())
pts_list = []
for i in range(n - 1):
    bisect.insort(pts_list, int(input()))

def solve(k_pts, m, pts_list):
    for i in range(len(pts_list)):
        x = pts_list[i]
        del pts_list[i]
        counter = 0
        for j in range(len(pts_list)):
            if counter == m:
                break
            elif len(pts_list) - j - 1 <= bisect.bisect_right(pts_list, k_pts + x - pts_list[- j - 1]):
                return x
            else:
                counter += 1
        bisect.insort(pts_list, x)
    return -1
    
print(solve(k_pts, m, pts_list))
0