close
思路: 排序,比大小。水題
代碼:
for _ in range(int(input())):
m = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort(key=lambda x: -x)
b.sort()
a_w, b_w = 0, 0
for i in range(m):
a_w += a[i] > b[i]
b_w += b[i] > a[i]
print(f'{a_w} {b_w}')
文章標籤
全站熱搜