Submission #3234848


Source Code Expand

N = int(input())
a = [(int(input()), 1) for _ in range(N)]
b = [(int(input()), 0) for _ in range(N)]
X = sorted(a + b)

ls = 0
stack = []
ans = 1
for v, f in X:
    if stack and stack[-1] != f:
        ans *= ls
        stack.pop()
        ls -= 1
    else:
        stack.append(f)
        ls += 1

print(ans)

Submission Info

Submission Time
Task A - 1D Matching
User poina
Language Python (3.4.3)
Score 0
Code Size 326 Byte
Status WA
Exec Time 2105 ms
Memory 27664 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
AC × 3
WA × 4
TLE × 7
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 1245 ms 17964 KB
001.txt WA 231 ms 8444 KB
002.txt WA 353 ms 10664 KB
003.txt WA 409 ms 11524 KB
004.txt TLE 2105 ms 24984 KB
005.txt TLE 2105 ms 27648 KB
006.txt TLE 2105 ms 27576 KB
007.txt TLE 2105 ms 27624 KB
008.txt TLE 2105 ms 27600 KB
009.txt TLE 2105 ms 27596 KB
010.txt TLE 2105 ms 27664 KB
011.txt AC 611 ms 27592 KB
example0.txt AC 17 ms 2940 KB
example1.txt AC 17 ms 3060 KB