Submission #3702096


Source Code Expand

Copy
S = gets.chomp
N = S.length
ans = 10000
(N-2).times do |i|
    num = S[i, 3].to_i
    ans = [ans, (num-753).abs].min
end
puts ans

Submission Info

Submission Time
Task B - 754
User betrue12
Language Ruby (2.3.3)
Score 200
Code Size 136 Byte
Status
Exec Time 7 ms
Memory 1788 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 200 / 200 a01, a02, a03, b04, b05, b06, b07, b08, b09, b10
Case Name Status Exec Time Memory
a01 7 ms 1788 KB
a02 7 ms 1788 KB
a03 7 ms 1788 KB
b04 7 ms 1788 KB
b05 7 ms 1788 KB
b06 7 ms 1788 KB
b07 7 ms 1788 KB
b08 7 ms 1788 KB
b09 7 ms 1788 KB
b10 7 ms 1788 KB