Submission #66134212
Source Code Expand
import numpy as np
T = int(input())
for _ in range(T):
N = int(input())
A = []
for __ in range(2 * N):
A.append(int(input()))
A = np.array(A)
iA = A.argsort().argsort()
thres = N
nl = nr = 0
ans = 0
for a, ia in zip(A, iA):
if nl == N:
break
if nl == nr:
ans += a
nl += 1
if ia < N:
thres += 1
else:
if ia >= thres:
ans += a
nl += 1
else:
nr += 1
print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | E - Most Valuable Parentheses |
| User | PannacottaFGK |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 0 |
| Code Size | 501 Byte |
| Status | WA |
| Exec Time | 1293 ms |
| Memory | 283980 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 450 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt |
| All | 00-sample-01.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 473 ms | 137236 KiB |
| 01-01.txt | AC | 497 ms | 138380 KiB |
| 01-02.txt | WA | 528 ms | 138668 KiB |
| 01-03.txt | WA | 535 ms | 139300 KiB |
| 01-04.txt | WA | 534 ms | 138956 KiB |
| 01-05.txt | WA | 1284 ms | 201500 KiB |
| 01-06.txt | WA | 1275 ms | 249880 KiB |
| 01-07.txt | WA | 1293 ms | 282476 KiB |
| 01-08.txt | WA | 977 ms | 181192 KiB |
| 01-09.txt | WA | 1282 ms | 202996 KiB |
| 01-10.txt | WA | 1200 ms | 282908 KiB |
| 01-11.txt | WA | 1190 ms | 246500 KiB |
| 01-12.txt | AC | 1022 ms | 283980 KiB |
| 01-13.txt | AC | 1010 ms | 214112 KiB |
| 01-14.txt | WA | 1113 ms | 283044 KiB |
| 01-15.txt | WA | 1157 ms | 240916 KiB |
| 01-16.txt | WA | 1209 ms | 250628 KiB |
| 01-17.txt | WA | 1230 ms | 246884 KiB |