Submission #1528206


Source Code Expand

Copy
n,*a=`dd`.split.map &:to_i;h=Hash.new 0;a.map{|e|h[e]+=1};p [(h.keys.select{|e|h[e]>3}.max||0)**2,h.keys.select{|e|h[e]>1}.max(2).reduce(:*)||0].max

Submission Info

Submission Time
Task C - Make a Rectangle
User leafmoon
Language Ruby (2.3.3)
Score 300
Code Size 148 Byte
Status
Exec Time 115 ms
Memory 18184 KB

Compile Error

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

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt, sample3.txt
All 300 / 300 sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt 107 ms 15748 KB
2.txt 41 ms 6148 KB
3.txt 115 ms 18184 KB
4.txt 94 ms 13700 KB
5.txt 40 ms 6144 KB
6.txt 70 ms 10116 KB
7.txt 69 ms 10116 KB
8.txt 32 ms 4996 KB
9.txt 61 ms 10108 KB
sample1.txt 8 ms 2044 KB
sample2.txt 8 ms 2044 KB
sample3.txt 8 ms 2044 KB