結果
問題 | No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい |
ユーザー | ichibanshibori |
提出日時 | 2016-10-14 23:39:00 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,474 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 43,584 KB |
最終ジャッジ日時 | 2024-11-22 06:47:00 |
合計ジャッジ時間 | 189,528 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | TLE | - |
testcase_02 | TLE | - |
testcase_03 | TLE | - |
testcase_04 | TLE | - |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | TLE | - |
testcase_08 | TLE | - |
testcase_09 | TLE | - |
testcase_10 | TLE | - |
testcase_11 | TLE | - |
testcase_12 | TLE | - |
testcase_13 | TLE | - |
testcase_14 | TLE | - |
testcase_15 | AC | 3,799 ms
33,440 KB |
testcase_16 | TLE | - |
testcase_17 | TLE | - |
testcase_18 | TLE | - |
testcase_19 | TLE | - |
testcase_20 | TLE | - |
testcase_21 | TLE | - |
testcase_22 | TLE | - |
testcase_23 | TLE | - |
testcase_24 | TLE | - |
testcase_25 | TLE | - |
testcase_26 | TLE | - |
testcase_27 | TLE | - |
testcase_28 | TLE | - |
testcase_29 | TLE | - |
testcase_30 | AC | 31 ms
17,828 KB |
testcase_31 | AC | 31 ms
37,504 KB |
testcase_32 | TLE | - |
testcase_33 | TLE | - |
testcase_34 | TLE | - |
testcase_35 | AC | 30 ms
23,424 KB |
testcase_36 | AC | 31 ms
23,424 KB |
testcase_37 | AC | 32 ms
10,880 KB |
testcase_38 | AC | 32 ms
11,008 KB |
testcase_39 | AC | 90 ms
11,008 KB |
testcase_40 | AC | 72 ms
11,136 KB |
testcase_41 | AC | 1,387 ms
12,416 KB |
testcase_42 | AC | 2,388 ms
12,416 KB |
testcase_43 | AC | 2,503 ms
12,544 KB |
testcase_44 | AC | 1,435 ms
12,544 KB |
testcase_45 | AC | 109 ms
11,008 KB |
testcase_46 | TLE | - |
testcase_47 | TLE | - |
ソースコード
def get_max_S(team_lst): max_S = 0 for team in team_lst: _, S, _, _ = team if S > max_S: max_S = S return max_S def get_min_U(team_lst, school_dic): min_U = -1 for team in team_lst: _, _, _, U = team if U not in school_dic: return 0 elif min_U == -1 or school_dic[U] < min_U: min_U = school_dic[U] return min_U def get_min_P(team_lst): min_P = -1 for team in team_lst: _, _, P, _ = team if min_P == -1 or P < min_P: min_P = P return min_P def sel_next(team_lst, school_dic): max_S = get_max_S(team_lst) r1_lst = [r for r in team_lst if r[1] == max_S] if len(r1_lst) == 1: return r1_lst[0] min_U = get_min_U(r1_lst, school_dic) r2_lst = [r for r in r1_lst if school_dic.get(r[3], 0) == min_U] if len(r2_lst) == 1: return r2_lst[0] min_P = get_min_P(r2_lst) r3_lst = [r for r in r2_lst if r[2] == min_P] return r3_lst[0] N, K = tuple(int(i) for i in input().split()) team_lst = [] school_dic = {} for i in range(N): sn, pn, un = tuple(int(i) for i in input().split()) team_lst += [(i, sn, pn, un)] for i in range(K): next_team = sel_next(team_lst, school_dic) idx, _, _, u = next_team print(idx) school_dic[u] = school_dic.get(u, 0) + 1 for r in range(len(team_lst)): if team_lst[r][0] == idx: del team_lst[r] break