Submission #3285131
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 l = r = 0 while r < n if a[r] < b[l] r += 1 else ret *= $fact[r-l] ret %= $mod r += 1 if l == r l = r end end return (ret*$fact[n-l])%$mod end puts (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 | 460 Byte |
Status | WA |
Exec Time | 189 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 | 113 ms | 5276 KB |
001.txt | WA | 53 ms | 3788 KB |
002.txt | WA | 67 ms | 4104 KB |
003.txt | WA | 72 ms | 4260 KB |
004.txt | WA | 158 ms | 5620 KB |
005.txt | WA | 175 ms | 6048 KB |
006.txt | WA | 176 ms | 6120 KB |
007.txt | WA | 175 ms | 6048 KB |
008.txt | WA | 174 ms | 6120 KB |
009.txt | WA | 175 ms | 6120 KB |
010.txt | AC | 175 ms | 6048 KB |
011.txt | AC | 189 ms | 6120 KB |
example0.txt | AC | 19 ms | 2556 KB |
example1.txt | AC | 19 ms | 2556 KB |