Submission #1966910


Source Code Expand

n,*a=$<.map &:to_i
mod=10**9+7
res=1
c=[0,0]
a.map.with_index{|x,i|[x,i<n ? 0 : 1]}.sort.each{ |x,i| c[i]>0 ? (res=res*c[i]%mod; c[i]-=1) : c[1-i]+=1 }
p res

Submission Info

Submission Time
Task A - 1D Matching
User hogeover30
Language Ruby (2.3.3)
Score 500
Code Size 162 Byte
Status AC
Exec Time 1121 ms
Memory 18680 KB

Compile Error

./Main.rb:1: warning: `&' interpreted as argument prefix

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 644 ms 11716 KB
001.txt AC 217 ms 5280 KB
002.txt AC 312 ms 6808 KB
003.txt AC 348 ms 7392 KB
004.txt AC 985 ms 17016 KB
005.txt AC 1115 ms 18680 KB
006.txt AC 1115 ms 18680 KB
007.txt AC 1119 ms 18680 KB
008.txt AC 1120 ms 18680 KB
009.txt AC 1121 ms 18680 KB
010.txt AC 1076 ms 18680 KB
011.txt AC 1109 ms 18680 KB
example0.txt AC 7 ms 1788 KB
example1.txt AC 7 ms 1788 KB