結果

問題 No.507 ゲーム大会(チーム決め)
ユーザー shikenagashikenaga
提出日時 2017-05-01 15:56:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-10-12 02:05:13
合計ジャッジ時間 5,403 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,872 KB
testcase_01 AC 17 ms
7,956 KB
testcase_02 AC 17 ms
8,064 KB
testcase_03 WA -
testcase_04 AC 16 ms
8,060 KB
testcase_05 AC 16 ms
7,940 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_right(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 < 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