Submission #4386807
Source Code Expand
N = int(input()) A = [(int(input()), 0) for i in range(N)] B = [(int(input()), 1) for i in range(N)] mod = 10 ** 9 + 7 X = A + B X.sort() ans = 1 Ar, Br = 0, 0 for x, i in X: if i == 0: if Br > 0: ans *= Br ans %= mod Br -= 1 else: Ar += 1 else: if Ar > 0: ans *= Ar ans %= mod Ar -= 1 else: Br += 1 print(ans)
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | AT274 |
Language | Python (3.4.3) |
Score | 500 |
Code Size | 485 Byte |
Status | AC |
Exec Time | 658 ms |
Memory | 26096 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 | 371 ms | 16932 KB |
001.txt | AC | 135 ms | 8072 KB |
002.txt | AC | 185 ms | 11952 KB |
003.txt | AC | 205 ms | 10944 KB |
004.txt | AC | 574 ms | 23612 KB |
005.txt | AC | 658 ms | 26096 KB |
006.txt | AC | 640 ms | 26056 KB |
007.txt | AC | 628 ms | 26096 KB |
008.txt | AC | 640 ms | 26060 KB |
009.txt | AC | 632 ms | 26060 KB |
010.txt | AC | 602 ms | 25988 KB |
011.txt | AC | 620 ms | 26056 KB |
example0.txt | AC | 18 ms | 3064 KB |
example1.txt | AC | 18 ms | 3064 KB |