Submission #4243975


Source Code Expand

Copy
K = gets.to_i

def sim(as, k)
  as.map.with_index{|a, i|
    i == k ? a-50 : a+1
  }
end

div, mod = K/50, K%50
x = 49 + div + 1
as = [x]*50
(50 - mod).times do |k|
  as = sim(as, k)
end

puts as.size
puts as.join(' ')

Submission Info

Submission Time
Task D - Decrease (Contestant ver.)
User yhara
Language Ruby (2.3.3)
Score 600
Code Size 236 Byte
Status
Exec Time 7 ms
Memory 1788 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0, example1, example2, example3, example4
All 600 / 600 corner0, corner1, corner2, corner3, corner4, corner5, corner6, corner7, corner8, corner9, example0, example1, example2, example3, example4, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9
Case Name Status Exec Time Memory
corner0 7 ms 1788 KB
corner1 7 ms 1788 KB
corner2 7 ms 1788 KB
corner3 7 ms 1788 KB
corner4 7 ms 1788 KB
corner5 7 ms 1788 KB
corner6 7 ms 1788 KB
corner7 7 ms 1788 KB
corner8 7 ms 1788 KB
corner9 7 ms 1788 KB
example0 7 ms 1788 KB
example1 7 ms 1788 KB
example2 7 ms 1788 KB
example3 7 ms 1788 KB
example4 7 ms 1788 KB
rand0 7 ms 1788 KB
rand1 7 ms 1788 KB
rand2 7 ms 1788 KB
rand3 7 ms 1788 KB
rand4 7 ms 1788 KB
rand5 7 ms 1788 KB
rand6 7 ms 1788 KB
rand7 7 ms 1788 KB
rand8 7 ms 1788 KB
rand9 7 ms 1788 KB