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}')

arrow
arrow
    創作者介紹
    創作者 尾玉 的頭像
    尾玉

    louisfghbvc的部落格

    尾玉 發表在 痞客邦 留言(0) 人氣()