Submission #4064277


Source Code Expand

n=int(input())
a=[[int(input()),1] for i in range(n)]+[[int(input()),-1] for i in range(n)]
a.sort()
c=0
b=a[0][1]
d=[]
for i,j in a:
    if j!=b and c*j<0:d.append(abs(c))
    c+=j
    b=j
ans=1
kai=[1]
for i in range(2,10**5+1):
    kai.append((kai[-1]*i)%(10**9+7))
for i in d:
    ans*=kai[i-1]%(10**9+7)
print(ans)

Submission Info

Submission Time
Task A - 1D Matching
User chun1182
Language Python (3.4.3)
Score 0
Code Size 335 Byte
Status WA
Exec Time 2106 ms
Memory 35276 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
AC × 4
WA × 3
TLE × 7
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 2105 ms 24532 KB
001.txt WA 386 ms 13264 KB
002.txt WA 625 ms 15780 KB
003.txt WA 750 ms 16856 KB
004.txt TLE 2105 ms 31768 KB
005.txt TLE 2106 ms 34636 KB
006.txt TLE 2106 ms 34760 KB
007.txt TLE 2106 ms 34752 KB
008.txt TLE 2106 ms 35144 KB
009.txt TLE 2106 ms 34640 KB
010.txt AC 746 ms 33740 KB
011.txt AC 873 ms 35276 KB
example0.txt AC 45 ms 7060 KB
example1.txt AC 47 ms 7060 KB