結果

問題 No.1708 Quality of Contest
ユーザー YamaguchiT6YamaguchiT6
提出日時 2021-11-05 03:27:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 665 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 59,596 KB
最終ジャッジ日時 2024-04-23 10:29:30
合計ジャッジ時間 8,466 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 534 ms
49,872 KB
testcase_01 AC 532 ms
44,108 KB
testcase_02 AC 532 ms
44,496 KB
testcase_03 RE -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
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 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
import numpy as np
def main():
  N,M,X=map(int,input().split( ))
  A=list(range(N))
  B=list(range(N))
  for num in range(N):
    A[num],B[num]=map(int,input().split( ))
  K=int(input())
  s=0
  t=0
  D=np.zeros((N,N))
  C=list(map(int,input().split()))
  for i in range(M):
    for j in range(N):
     if B[j]==i + 1:
       D[i][s]=A[j]
       s=s + 1
    s=0
  for i in range(len(collections.Counter(B))): 
   for j in range(N):
     if A[j]==max(D[i]) and B[j]==i+1:
       A[j]=A[j] + X
       break
  E=sorted(A,reverse=True)
  for i in range(K):
    for j in range(C[i]):
     t=t+E[j]
  print(t)
if __name__ == '__main__':
  main()       
0