Submission #3276587
Source Code Expand
from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,datetime sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, input().split())) def inpls(): return list(input().split()) N = int(input()) points = [] for i in range(N): a = int(input()) points.append([a,True]) for i in range(N): b = int(input()) points.append([b,False]) points.sort() fac = [1]*(10**5+3) for i in range(2,10**5+3): fac[i] = fac[i-1]*i%mod tmp = MAX = 0 ans = 1 for x,c in points: if c: tmp += 1 else: tmp -= 1 MAX = max(MAX,abs(tmp)) if tmp == 0: ans *= fac[MAX] ans %= mod print(ans)
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | simamumu |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 760 Byte |
Status | WA |
Exec Time | 915 ms |
Memory | 35076 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 509 ms | 24616 KB |
001.txt | WA | 208 ms | 14052 KB |
002.txt | WA | 273 ms | 16384 KB |
003.txt | WA | 297 ms | 17352 KB |
004.txt | WA | 778 ms | 32188 KB |
005.txt | WA | 865 ms | 35008 KB |
006.txt | WA | 869 ms | 35076 KB |
007.txt | WA | 899 ms | 35000 KB |
008.txt | WA | 857 ms | 35068 KB |
009.txt | WA | 868 ms | 35076 KB |
010.txt | AC | 817 ms | 35004 KB |
011.txt | AC | 915 ms | 34952 KB |
example0.txt | AC | 60 ms | 8176 KB |
example1.txt | AC | 58 ms | 8176 KB |