Submission #4064166
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 r=0 b=a[0][1] d=[] for i,j in a: if j!=b and c*j<0:d.append(abs(r)) c+=j if c*j>0:r+=1 else:r=0 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 | 309 Byte |
Status | WA |
Exec Time | 2106 ms |
Memory | 31344 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||||
Status |
|
|
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 | WA | 492 ms | 20228 KB |
001.txt | WA | 168 ms | 9244 KB |
002.txt | WA | 236 ms | 11644 KB |
003.txt | WA | 267 ms | 12652 KB |
004.txt | WA | 808 ms | 28304 KB |
005.txt | WA | 928 ms | 31340 KB |
006.txt | WA | 991 ms | 31336 KB |
007.txt | WA | 917 ms | 31340 KB |
008.txt | WA | 984 ms | 31340 KB |
009.txt | WA | 917 ms | 31340 KB |
010.txt | TLE | 2106 ms | 31340 KB |
011.txt | AC | 840 ms | 31344 KB |
example0.txt | AC | 18 ms | 3064 KB |
example1.txt | AC | 18 ms | 3060 KB |