Submission #4064201


Source Code Expand

import math
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
for i in d:
    ans*=math.factorial(i)
print(ans)

Submission Info

Submission Time
Task A - 1D Matching
User chun1182
Language Python (3.4.3)
Score 0
Code Size 271 Byte
Status TLE
Exec Time 2105 ms
Memory 32704 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
AC × 3
TLE × 11
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 20228 KB
001.txt TLE 2104 ms 9616 KB
002.txt TLE 2104 ms 11916 KB
003.txt TLE 2104 ms 12880 KB
004.txt TLE 2105 ms 28308 KB
005.txt TLE 2105 ms 31344 KB
006.txt TLE 2105 ms 31340 KB
007.txt TLE 2105 ms 32704 KB
008.txt TLE 2105 ms 31340 KB
009.txt TLE 2105 ms 31340 KB
010.txt TLE 2105 ms 31340 KB
011.txt AC 934 ms 31344 KB
example0.txt AC 18 ms 3064 KB
example1.txt AC 18 ms 3064 KB