Submission #15262088


Source Code Expand

Copy
n = int(input())
M = 10**9+7
L = []
for _ in range(n):
  a = int(input())
  L.append((a, 1))
for _ in range(n):
  b = int(input())
  L.append((b, 0))
L.sort()
C = [0, 0]
ans = 1
for d, f in L:
  if C[f^1]:
    ans *= C[f^1]
    ans %= M
    C[f^1] -= 1
  else:
    C[f] += 1
print(ans)

Submission Info

Submission Time
Task A - 1D Matching
User Rssll_Krkgrd
Language Python (3.8.2)
Score 500
Code Size 304 Byte
Status
Exec Time 508 ms
Memory 30336 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0.txt, example1.txt
All 500 / 500 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt 300 ms 21600 KB
001.txt 118 ms 13684 KB
002.txt 158 ms 15348 KB
003.txt 169 ms 16276 KB
004.txt 439 ms 28160 KB
005.txt 503 ms 29984 KB
006.txt 502 ms 30164 KB
007.txt 493 ms 30100 KB
008.txt 508 ms 30336 KB
009.txt 496 ms 30296 KB
010.txt 490 ms 29984 KB
011.txt 478 ms 29984 KB
example0.txt 27 ms 9212 KB
example1.txt 23 ms 8916 KB