Submission #1163800


Source Code Expand

n,c,k,*a=$<.read.split.map &:to_i
a.sort!
t=1
b=[a[0]]
1.upto(n-1) do |i|
  if b[0]+k>=a[i] && c>b.length
    b<< a[i]
  else
    t+=1
    b=[a[i]]
  end
end
p t

Submission Info

Submission Time
Task A - Airport Bus
User miraxial
Language Ruby (2.3.3)
Score 300
Code Size 173 Byte
Status AC
Exec Time 81 ms
Memory 12648 KB

Compile Error

./Main.rb:1: warning: `&' interpreted as argument prefix

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 12
Set Name Test Cases
Sample sample1.txt, sample2.txt
All sample1.txt, sample2.txt, in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, sample1.txt, sample2.txt
Case Name Status Exec Time Memory
in1.txt AC 7 ms 1788 KB
in2.txt AC 79 ms 10600 KB
in3.txt AC 80 ms 11880 KB
in4.txt AC 80 ms 11880 KB
in5.txt AC 8 ms 1788 KB
in6.txt AC 81 ms 12648 KB
in7.txt AC 71 ms 9676 KB
in8.txt AC 79 ms 11112 KB
sample1.txt AC 7 ms 1788 KB
sample2.txt AC 7 ms 1788 KB