Submission #22101328


Source Code Expand

Copy
MOD = 10**9 + 7
N = int(input())
A = []
for _ in range(N):
    A.append((int(input()), "p"))

B = []
for _ in range(N):
    A.append((int(input()), "c"))

All = sorted(A+B)
P = 0
C = 0

ans = 1
for _, s in All:
    if s == "p":
        if C:
            ans *= C
            C -= 1
        else:
            P += 1
    else:
        if P:
            ans *= P
            P -= 1
        else:
            C += 1
print(ans)

Submission Info

Submission Time
Task A - 1D Matching
User shinitao
Language PyPy3 (7.3.0)
Score 0
Code Size 452 Byte
Status WA
Exec Time 2211 ms
Memory 168884 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
AC × 3
WA × 10
TLE × 1
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 925 ms 90644 KB
001.txt WA 284 ms 75248 KB
002.txt WA 358 ms 77196 KB
003.txt WA 407 ms 78976 KB
004.txt WA 1515 ms 107476 KB
005.txt WA 1632 ms 109716 KB
006.txt WA 1746 ms 112164 KB
007.txt WA 1740 ms 112648 KB
008.txt WA 1859 ms 116640 KB
009.txt WA 1692 ms 111412 KB
010.txt TLE 2211 ms 168884 KB
011.txt AC 693 ms 96756 KB
example0.txt AC 54 ms 61704 KB
example1.txt AC 49 ms 61724 KB