#895824

Solution for 10031: Search II by saburou

Source Code Status Test Cases
    Policy: public     Reviewed: 128    
00.37 sec    16808 KB    23 lines     410 bytes    2014-03-25 05:59
def solve s, t
  count = 0
  until s.empty? or t.empty?
    if s.first < t.first
      s.delete_at(0)
    elsif t.first < s.first
      t.delete_at(0)
    else
      count += 1
      s.delete_at(0)
      t.delete_at(0)
    end
  end
  count
end

while input = $stdin.gets
  s = $stdin.gets.chomp.split(" ").map(&:to_i).sort!
  $stdin.gets
  t = $stdin.gets.chomp.split(" ").map(&:to_i).sort!
  p solve(s,t)
end

Compile Error Logs:
You are not authorized to see the message.

Status
Judge: 2/2 Ruby CPU: 00.37 sec Memory: 16808 KB Length: 410 B 2014-03-25 05:59 2014-03-25 05:59
Results for testcases
Case # Verdict CPU Time Memory In Out Case Name
Case #1: : Accepted 00.03 sec 6436 KB
Case #2: : Accepted 00.37 sec 16808 KB
< prev | / | next >  
 
Judge Input #  ( | ) Judge Output #  ( | )


Comments
 
 Under Construction.
 
Categories
 
 
Free Tags