Submission #3209572


Source Code Expand

N = int(input())
A = [(int(input()), 0) for i in range(N)]
B = [(int(input()), 1) for i in range(N)]
Object = sorted(A + B)
mod = 10 ** 9 + 7

ans = 1
memo = [0, 0]
for n, x in Object:
    if memo[1 - x] > 0:
        ans = (ans * memo[1 - x]) % mod
        memo[1 - x] -= 1
    else:
        memo[x] += 1

print(ans)

Submission Info

Submission Time
Task A - 1D Matching
User AT274
Language Python (3.4.3)
Score 500
Code Size 333 Byte
Status AC
Exec Time 634 ms
Memory 27660 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 14
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 386 ms 17868 KB
001.txt AC 138 ms 8444 KB
002.txt AC 191 ms 10664 KB
003.txt AC 213 ms 11520 KB
004.txt AC 539 ms 25000 KB
005.txt AC 609 ms 27652 KB
006.txt AC 607 ms 27576 KB
007.txt AC 612 ms 27628 KB
008.txt AC 626 ms 27592 KB
009.txt AC 634 ms 27596 KB
010.txt AC 583 ms 27660 KB
011.txt AC 612 ms 27576 KB
example0.txt AC 17 ms 3064 KB
example1.txt AC 16 ms 3064 KB