Submission #2879151


Source Code Expand

Copy
#
# File    : A.rb
# Author  : Kazune Takahashi
# Created : 2018-7-21 20:51:33
# Powered by Visual Studio Code
#

a = gets.chomp.split(" ").map{|i| i.to_i}.sort

puts [(a[1] - a[0]).abs + (a[2] - a[1]).abs,
(a[1] - a[2]).abs + (a[2] - a[0]).abs,
(a[1] - a[0]).abs + (a[2] - a[0]).abs].min


Submission Info

Submission Time
Task A - Task Scheduling Problem
User kazunetakahashi
Language Ruby (2.3.3)
Score 100
Code Size 305 Byte
Status
Exec Time 7 ms
Memory 1788 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01, sample_02, sample_03
All 100 / 100 0_small_rand_0, 0_small_rand_1, 0_small_rand_2, 0_small_rand_3, 1_rand_0, 1_rand_1, 1_rand_2, 1_rand_3, 2_hand_0, 2_hand_1, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_small_rand_0 7 ms 1788 KB
0_small_rand_1 7 ms 1788 KB
0_small_rand_2 7 ms 1788 KB
0_small_rand_3 7 ms 1788 KB
1_rand_0 7 ms 1788 KB
1_rand_1 7 ms 1788 KB
1_rand_2 7 ms 1788 KB
1_rand_3 7 ms 1788 KB
2_hand_0 7 ms 1788 KB
2_hand_1 7 ms 1788 KB
sample_01 7 ms 1788 KB
sample_02 7 ms 1788 KB
sample_03 7 ms 1788 KB