CODE FESTIVAL 2016 Grand Final(Parallel)

Submission #3234867

Source codeソースコード

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

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

print(ans)

Submission

Task問題 A - 1D Matching
User nameユーザ名 poina
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 500
Source lengthソースコード長 356 Byte
File nameファイル名
Exec time実行時間 632 ms
Memory usageメモリ使用量 27648 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - example0.txt,example1.txt
All 500 / 500 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
000.txt AC 367 ms 17964 KB
001.txt AC 139 ms 8444 KB
002.txt AC 193 ms 10640 KB
003.txt AC 220 ms 11520 KB
004.txt AC 563 ms 24984 KB
005.txt AC 626 ms 27648 KB
006.txt AC 621 ms 27576 KB
007.txt AC 632 ms 27628 KB
008.txt AC 608 ms 27596 KB
009.txt AC 618 ms 27592 KB
010.txt AC 604 ms 27636 KB
011.txt AC 624 ms 27576 KB
example0.txt AC 17 ms 3064 KB
example1.txt AC 16 ms 3060 KB