結果

問題 No.2623 Room Allocation
ユーザー fiblonariafiblonaria
提出日時 2024-02-10 05:58:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 85,300 KB
最終ジャッジ日時 2024-02-10 05:58:27
合計ジャッジ時間 5,832 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 WA -
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 35 ms
53,460 KB
testcase_06 AC 185 ms
78,092 KB
testcase_07 AC 184 ms
78,476 KB
testcase_08 AC 185 ms
78,476 KB
testcase_09 AC 183 ms
78,476 KB
testcase_10 AC 44 ms
64,760 KB
testcase_11 AC 44 ms
64,760 KB
testcase_12 AC 42 ms
61,652 KB
testcase_13 WA -
testcase_14 AC 195 ms
85,300 KB
testcase_15 AC 162 ms
75,892 KB
testcase_16 AC 90 ms
75,892 KB
testcase_17 AC 61 ms
68,832 KB
testcase_18 AC 167 ms
75,892 KB
testcase_19 AC 156 ms
75,892 KB
testcase_20 AC 160 ms
75,892 KB
testcase_21 AC 163 ms
75,892 KB
testcase_22 AC 139 ms
75,892 KB
testcase_23 AC 108 ms
75,892 KB
testcase_24 AC 160 ms
75,892 KB
testcase_25 AC 148 ms
75,892 KB
testcase_26 AC 71 ms
75,892 KB
testcase_27 AC 208 ms
84,132 KB
testcase_28 AC 118 ms
80,904 KB
testcase_29 AC 91 ms
79,408 KB
testcase_30 AC 207 ms
82,740 KB
testcase_31 AC 74 ms
77,456 KB
testcase_32 AC 80 ms
81,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())
diff = [0 for i in range(X + Y)]
ans = 0
for i in range(N):
	P, c = input().split()
	P = int(P)
	c = {'A': 1, 'B': -1}[c]
	diff[i % (X + Y)] += P * c
	ans += P * (1 - c) // 2
diff = sorted(diff)
ans += sum(diff[-X:])
print(ans)
0