第二题 ac: N = int(input()) staff = [int(x) for x in input().split()] jobb = [int(y) for y in input().split()] M = int(input()) staff.sort() jobb.sort() count = [0 for i in range(N)] cc = 0 ii = 0 j = 0 while j < N and ii < N:     if staff[ii] >= jobb[j]:         cc += 1         j += 1     else:         count[ii] = cc         ii += 1 while ii < N:     count[ii] = cc     ii += 1 # print(count) mm = 0 m = 0 output = 1 while m < N:     output = (count[m]-mm) * output     mm +=1     m += 1 output = output % M print(output)