結果
| 問題 |
No.1708 Quality of Contest
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-26 13:15:01 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 866 bytes |
| コンパイル時間 | 125 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 17,444 KB |
| 最終ジャッジ日時 | 2024-10-05 07:18:26 |
| 合計ジャッジ時間 | 4,158 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 23 |
ソースコード
import itertools
class Task:
def run(self):
N, M, X = map(int, input().split())
questions = [list(map(int, input().split())) for _ in range(N)]
K = int(input())
C = list(map(int, input().split()))
max_satisfy_score = 0
for ptn in itertools.permutations(questions):
satisfy_score_sum = 0
for c in C:
answered = ptn[:c]
quality_sum = sum([q for q, g in answered])
number_of_genre = len(set([g for q, g in answered]))
satisfy_score = quality_sum + X * number_of_genre
satisfy_score_sum += satisfy_score
if max_satisfy_score < satisfy_score_sum:
max_satisfy_score = satisfy_score_sum
print(max_satisfy_score)
if __name__ == "__main__":
task = Task()
task.run()