Submission #3282756


Source Code Expand

M = 1000000009
N = gets.to_i
xs = []
(0...N).each{
  x = gets.to_i
  xs << [x, 0]
}
(0...N).each{
  x = gets.to_i
  xs << [x, 1]
}
xs.sort!

ans = 1
box = 0
bt = nil
xs.each{ |x,t|
  #p [ans, box, bt, [x,t]]
  if !bt
    box = 1
    bt = t
    next
  end
  
  if t == bt
    box += 1
  else
    ans = (ans * box) % M
    box -= 1
    if box == 0
      bt = nil
    end
  end
}
p ans

Submission Info

Submission Time
Task A - 1D Matching
User Corvvs
Language Ruby (2.3.3)
Score 0
Code Size 416 Byte
Status WA
Exec Time 1100 ms
Memory 18424 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
AC × 3
WA × 11
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 638 ms 11204 KB
001.txt WA 217 ms 5408 KB
002.txt WA 305 ms 6648 KB
003.txt WA 344 ms 7032 KB
004.txt WA 969 ms 17528 KB
005.txt WA 1100 ms 18424 KB
006.txt WA 1093 ms 18424 KB
007.txt WA 1089 ms 18424 KB
008.txt WA 1090 ms 18424 KB
009.txt WA 1089 ms 18424 KB
010.txt WA 1055 ms 18424 KB
011.txt AC 1092 ms 18424 KB
example0.txt AC 7 ms 1788 KB
example1.txt AC 7 ms 1788 KB