Submission #1082187


Source Code Expand

n=gets.to_i
h=Hash.new(0)
a=gets.split.map &:to_i
a.each do |e|
  h[e]+=1
end
b=[0,0]
g=h.length
j=false
h.each do |e,v|
  vv=v
  if v>=3
    j=true
    vv=v%2
  end
  if vv%3==0 || vv%3==1
    b[0]+=1
  else
    b[1]+=1
  end
end
p (j&&b[1]%2==1)||(!j&&b[1]%2==0) ? g:g-1

Submission Info

Submission Time
Task D - Card Eater
User miraxial
Language Ruby (2.3.3)
Score 0
Code Size 293 Byte
Status WA
Exec Time 98 ms
Memory 14604 KB

Compile Error

./Main.rb:3: warning: `&' interpreted as argument prefix
./Main.rb:1: warning: assigned but unused variable - n

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 2
AC × 9
WA × 8
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 10 ms 1788 KB
00_example_02.txt AC 10 ms 1788 KB
01.txt WA 10 ms 1788 KB
02.txt AC 14 ms 2044 KB
03.txt AC 11 ms 1788 KB
04.txt AC 11 ms 1788 KB
05.txt AC 10 ms 1788 KB
06.txt WA 64 ms 8076 KB
07.txt WA 64 ms 8076 KB
08.txt WA 71 ms 8716 KB
09.txt AC 65 ms 8076 KB
10.txt WA 64 ms 8076 KB
11.txt AC 69 ms 8588 KB
12.txt WA 64 ms 8076 KB
13.txt WA 67 ms 8204 KB
14.txt AC 98 ms 14604 KB
15.txt WA 62 ms 8076 KB