Submission #3768613


Source Code Expand

N=int(input())
A=[(int(input()),"a") for i in range(N)]
B=[(int(input()),"b") for i in range(N)]
C=sorted(A+B)
mod=10**9+7
a,b=0,0
ans=1
for c in C:
  if c[1]=="a":
    if b>0:
      ans*=(ans*b)%mod
      b-=1
    else:
      a+=1
  if c[1]=="b":
    if a>0:
      ans=(ans*a)%mod
      a-=1
    else:
      b+=1
print(ans)      
    

Submission Info

Submission Time
Task A - 1D Matching
User Chanyuh
Language PyPy3 (2.4.0)
Score 0
Code Size 356 Byte
Status WA
Exec Time 2108 ms
Memory 73944 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
AC × 3
WA × 2
TLE × 9
Set Name Test Cases
Sample example0.txt, example1.txt
All 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 TLE 2107 ms 62552 KB
001.txt WA 543 ms 52440 KB
002.txt TLE 2107 ms 55128 KB
003.txt WA 964 ms 55640 KB
004.txt TLE 2108 ms 71000 KB
005.txt TLE 2107 ms 73600 KB
006.txt TLE 2108 ms 73944 KB
007.txt TLE 2108 ms 73944 KB
008.txt TLE 2108 ms 73944 KB
009.txt TLE 2108 ms 73932 KB
010.txt TLE 2108 ms 73816 KB
011.txt AC 1445 ms 73560 KB
example0.txt AC 180 ms 38256 KB
example1.txt AC 173 ms 38256 KB