結果
| 問題 |
No.2422 regisys?
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 19:45:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,121 bytes |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 82,640 KB |
| 実行使用メモリ | 187,564 KB |
| 最終ジャッジ日時 | 2025-06-12 19:45:23 |
| 合計ジャッジ時間 | 10,949 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 28 WA * 33 |
ソースコード
import sys
def main():
input = sys.stdin.read().split()
ptr = 0
N = int(input[ptr])
ptr += 1
M = int(input[ptr])
ptr += 1
A = list(map(int, input[ptr:ptr+N]))
ptr += N
B = list(map(int, input[ptr:ptr+N]))
ptr += N
regular = []
mma = []
for _ in range(M):
T = int(input[ptr])
ptr += 1
C = int(input[ptr])
ptr += 1
if T == 0:
regular.append(C)
else:
mma.append(C)
def max_sell(group_prices, customers):
group_prices.sort()
customers.sort()
m = len(customers)
n = len(group_prices)
i = j = count = 0
while i < n and j < m:
if group_prices[i] <= customers[j]:
count += 1
i += 1
j += 1
else:
j += 1
return count
reg_prices = A
mma_prices = B
r_count = max_sell(reg_prices, regular)
m_count = max_sell(mma_prices, mma)
total = r_count + m_count
min_left = N - total
print(min_left)
if __name__ == "__main__":
main()
gew1fw