Submission #3524529
Source Code Expand
N=int(input()) A=[] mod=10**9+7 for i in range(N): a=int(input()) A.append((a,-1)) for i in range(N): a=int(input()) A.append((a,1)) A.sort() a=0 s=A[0][1] ans=1 for i in range(2*N): if A[i][1]==s: a+=1 else: ans*=a ans%=mod a-=1 if a==0 and i<2*N-1: s=A[i+1][1] #print(a,s,ans) print(ans)
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | okumura |
Language | PyPy3 (2.4.0) |
Score | 500 |
Code Size | 384 Byte |
Status | AC |
Exec Time | 1408 ms |
Memory | 68696 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 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 | AC | 955 ms | 61144 KB |
001.txt | AC | 497 ms | 51416 KB |
002.txt | AC | 592 ms | 53208 KB |
003.txt | AC | 640 ms | 54232 KB |
004.txt | AC | 1261 ms | 66008 KB |
005.txt | AC | 1395 ms | 68696 KB |
006.txt | AC | 1407 ms | 68568 KB |
007.txt | AC | 1384 ms | 68568 KB |
008.txt | AC | 1408 ms | 68312 KB |
009.txt | AC | 1388 ms | 68312 KB |
010.txt | AC | 1356 ms | 67928 KB |
011.txt | AC | 1368 ms | 68568 KB |
example0.txt | AC | 162 ms | 38256 KB |
example1.txt | AC | 163 ms | 38256 KB |