Submission #3285112
Source Code Expand
n = gets.to_i a = n.times.map{gets.to_i}.sort b = n.times.map{gets.to_i}.sort $mod = 10**9+7 $fact = Array.new(100010,1) for i in 2..100000 $fact[i] = $fact[i-1]*i%$mod end def clac(a,b,n) ret = 1 p = 0 for i in 0..n-1 if a[i] > b[p] ret *= $fact[i-p] ret %= $mod p = i end end ret *= $fact[n-p] ret %= $mod return ret end p (clac(a,b,n)*clac(b,a,n))%$mod
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | koikotya |
Language | Ruby (2.3.3) |
Score | 0 |
Code Size | 427 Byte |
Status | WA |
Exec Time | 186 ms |
Memory | 6120 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 | 116 ms | 5276 KB |
001.txt | WA | 54 ms | 3788 KB |
002.txt | WA | 68 ms | 4160 KB |
003.txt | WA | 73 ms | 4332 KB |
004.txt | WA | 162 ms | 5748 KB |
005.txt | WA | 181 ms | 6120 KB |
006.txt | WA | 180 ms | 6120 KB |
007.txt | WA | 179 ms | 6048 KB |
008.txt | WA | 178 ms | 6048 KB |
009.txt | WA | 179 ms | 6048 KB |
010.txt | AC | 179 ms | 6120 KB |
011.txt | AC | 186 ms | 6120 KB |
example0.txt | AC | 18 ms | 2556 KB |
example1.txt | AC | 19 ms | 2556 KB |