TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = list(map(int, input().split()))

a.sort()
ans = 0:
for i in range(1, 3):
    ans += abs(a[i] - a[i - 1])

print(ans)

a = list(map(int, input().split()))

a.sort()
ans = 0
for i in range(1, 3):
    ans += abs(a[i] - a[i - 1])

print(ans)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c = map(int,input().split())
A = [a,b,c]
A.sort()
print(a[2]-a[0])


a,b,c = map(int,input().split())
A = [a,b,c]
A.sort()
print(A[2]-A[0])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
*a=map(int,input().split())
print(max(a)-min(a))

list1=list(map(int,input().split()))
list1.sort()
print(list1[-1]-list1[0])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.remove(max(tasks))
cost += 0
print(tasks)
task = min(tasks)
tasks.remove(task)
print(task, tasks)
cost += task

cost += (tasks[0] - task)

print(cost)


cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.remove(max(tasks))
cost += 0

task = min(tasks)
tasks.remove(task)
cost += task

cost += (tasks[0] - task)
print(cost)


cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.remove(max(tasks))
cost += 0

task = min(tasks)
cost += task

cost += tasks[0] - task

print(cost)


cost = 0
a, b, c = (map(int, input().split()))
tasks = [a, b, c]

tasks.sort()

j = min(tasks)
tasks.remove(j)

for i in tasks:
    cost += (i - j)
    j = i

print(cost)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
Not found

A = list(map(int, input().split()))
print(max(A)-min(A))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a1, a2, a3=map(int, input().split())
temp=[a1, a2, a3]
print(a3-a1)

a1, a2, a3=map(int, input().split())
temp=[a1, a2, a3]
temp.sort()
print(temp[2]-temp[0])

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
# coding: utf-8

S = input()
T = input()
f=0
for i in range(len(S)+1):
    if S == T:
        print('Yes')
        f=1
        break
    S = (S[-1]+S)[:-1]
if f==0:
    print('No')

# coding: utf-8

S = input()
T = input()
f=0
for i in range(len(S)+1):
    if S == T:
        f=1
    S = (S[-1]+S)[:-1]
    
if f==0:
    print('No')
else:
    print('Yes')

# coding: utf-8

A = list(map(int,input().split()))
A.sort(reverse = True)
ans = 0
A.append(A[-1])
for i in range(len(A)-1):
    ans +=A[i]-A[i+1]
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import numpy as np
N = int(input())
a = list(map(int,input().split()))
a = np.array(a)
a = np.sort(a)[::-1]
MAX = np.abs(np.prod(a))
#print (MAX)
Flag = True
q = 0
add = a[0]
sum = 0
max = np.sum(a)-len(a)
n = a[0]*q+a[0]-1
while True:
    st = np.sum(n%a)
    if sum < st:
        sum = st
    if sum == max:
        break
    ind = np.where(a - n%a == 1)[0]
    #print (ind)
    c = a[ind]
    n += np.prod(c)
    if n > MAX:
        break
    #print (sum)
print (sum)


import numpy as np
N = int(input())
a = list(map(int,input().split()))
a = np.array(a)
a = np.sort(a)[::-1]
MAX = np.abs(np.prod(a))
#print (MAX)
Flag = True
q = 0
add = a[0]
sum = 0
max = np.sum(a)-len(a)
n = a[0]*q+a[0]-1
while True:
    st = np.sum(n%a)
    if sum < st:
        sum = st
    if sum == max:
        break
    ind = np.where(a - n%a == 1)[0]
    #print (ind)
    c = a[ind]
    n += np.prod(c)
    if n > MAX:
        break
    #print (sum)
print (sum)


import numpy as np
a = list(map(int,input().split()))
a = np.array(a)
a = np.sort(a)[::-1]
sum = a[0]-a[2]
print (sum)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import math
a, b, c = (int(i) for i in input().split()) 
l = []
l.extend([abs(a-b),abs(b-c),abs(c-a)])
l.sort()
ans = l[0] + l[1]

import math
a, b, c = (int(i) for i in input().split()) 
l = []
l.extend([abs(a-b),abs(b-c),abs(c-a)])
l.sort()
ans = l[0] + l[1]


import math
a, b, c = (int(i) for i in input().split()) 
l = []
l.extend([abs(a-b),abs(b-c),abs(c-a)])
l.sort()
ans = l[0] + l[1]
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = list(map(int,input().split()))
ans = []
a = abs(A(0)-A(1))+abs(A(1)-A(2))
b = abs(A(0)-A(2))+abs(A(2)-A(1))
c = abs(A(1)-A(0))+abs(A(0)-A(2))
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))


A = list(map(int,input().split()))
ans = []
a = abs(A[0]-A[1])+abs(A[1]-A[2])
b = abs(A[0]-A[2])+abs(A[2]-A[1])
c = abs(A[1]-A[0])+abs(A[0]-A[2])
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
cost_list=list(map(int,input().split())
cost_list.sort(reverse=True)
sum=0
for i in range(len(cost_list)-1):
  sum+=(cost_list[i]-cost_list[i+1])
print(sum)

cost_list=list(map(int,input().split())
cost_list.sort(reverse=True)
sum=0
for i in range(len(cost_list)-1):
  sum+=cost_list[i]-cost_list[i+1]
print(sum)

*cost_list=map(int,input().split())
cost_list.sort(reverse=True)
sum=0
for i in range(len(cost_list)-1):
  sum+=(cost_list[i]-cost_list[i+1])
print(sum)

*cost_list,=map(int,input().split())
print(max(cost_list)-min(cost_list))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):

S=list(map(int,input().split()))
S.sort
sum=0
sum += (S[2]-S[0])
print(sum)


S=list(map(int,input().split()))
S.sort
sum=0
sum += (S[1]-S[0])+(S[2]-S[1])
print(sum)


S=list(map(int,input().split()))
S.sort()
sum=0
sum += (S[2]-S[0])
print(sum)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import sys

def solve(a,b,c):
    f = [a,b,c]
    f.sort()
    #print(f)
    x = 0
    y = 0

    if a == b and b == c :
        return 0
    else:
        x = f[1] - f[0]
        y = f[2] - f[1]
        return x+y

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    a = int(ws[0])
    b = int(ws[1])
    c = int(ws[2])
    return (a, b, c,)

def main():
    solve(*readQuestion())

# Uncomment before submission
    main()

import sys


def solve(a,b,c):
    f = [a,b,c]
    f.sort()
    #print(f)
    x = 0
    y = 0

    if a == b and b == c :
        return 0
    else:
        x = f[1] - f[0]
        y = f[2] - f[1]
        return x+y

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
line = input()
words = line.split()
num_list = []
for word in words:
    num_list.append(int(word))
ans = 0
for num in num_list:
    ans = ans + num-1

print(ans)

line = input()
words = line.split()

num_list = []
for elm in words:
    num_list.append(int(elm))

num_list.sort()
score = 0
for i, num in enumerate(num_list):
    if i < (len(num_list) - 1):
        score += (abs(num_list[i] - num_list[i+1]))
    else:
        break

print(score)


Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a, b, c = map(int, input().split())

print(max(abs(a-b), abs(b-c), abs(c-a))

a, b, c = map(int, input().split())

print(max(abs(a-b), abs(b-c), abs(c-a)))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = list(map(int, input().split())
A.sort()
print(-A[0] + A[2])

A = list(map(int, input().split()))
A.sort()
print(A[2] - A[0])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import numpy

s = list(input())
t = input()

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == t:
        print('Yes')
        exit()
print('No')


arr = [int(i) for i in input().split()]
arr.sort()
arr.reverse()

result = (arr[0] - arr[1]) + (arr[1] - arr[2])
print(result)


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
# -*- coding: utf-8 -*-

a = list(map(int,print().split()))

a.list()

print(+a[i+2]- a[i])


# -*- coding: utf-8 -*-

a = list(map(int,print().split()))

a.list()

print(+a[i+2]- a[i])
# -*- coding: utf-8 -*-

a = list(map(int,input().split()))

a.list()

print(+a[i+2]- a[i])

# -*- coding: utf-8 -*-

a = list(map(int,input().split()))

a.sort()

print(a[2]- a[0])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = map(int, input())
A = sorted(A)
ans = 0
for i in range(1, 3):
    ans += abs(A[i - 1] - A[i])
print(ans)


A = map(int, input().split())
A = sorted(A)
ans = 0
for i in range(1, 3):
    ans += abs(A[i - 1] - A[i])
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a, b, c = map(int, input().split())
print(abs(b-a)+abs(c-b))

a = list(map(int, input().split()))
print(max(a) - min(a))

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = list(map(int, input().split()))

s1 = 0
s2 = 0

s1 = abs(a[1] - a[0]) + abs(a[1] - a[2])
s2 = abs(a[2] - a[0]) + abs(a[2] - a[1])

print(max(s1,s2))

n = int(input())
a = list(map(int, input().split()))
s = []
m = 1

def f(m, a):
    s_tmp = 0
    for i in range(n):
        s_tmp = s_tmp + m % a[i]
    return s_tmp

for i in range(n):
    m = m * a[i]

print(f(m-1, a))

a = list(map(int, input().split()))

a.sort()

print(a[2]- a[0])

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
Tmp = []
Tmp = input().rstrip().split(' ')

Ans = []

for i in range(3):
  nTmp = int(Tmp[i])
  
  Ans.append(nTmp)

Ans.sort()

nAns = (Ans[1]-Ans[0])
nAns += Ans[2]-Ans[1]





Tmp = []
Tmp = input().rstrip().split(' ')
 
Ans = []
 
for i in range(3):
  nTmp = int(Tmp[i])
  
  Ans.append(nTmp)
 
Ans.sort()
 
nAns = (Ans[1]-Ans[0])
nAns += Ans[2]-Ans[1]

print(nAns)



Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c=map(int,input().split())
d,e,f=abs(a-b),abs(a-c),abs(b-c)
print(d+e+f-min(d,e,f))

a,b,c=map(int,input().split())
d,e,f=map(abs,a-b,a-c,b-c)
print(d+e+f-min(d,e,f))

L = list(map(int,input().split()))
L.sort()
s=0
for i in range(1,3):
  s+=L[i]-L[i-1]
print(s)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a=list(map(int,input().split()))
b=[]
c=[1]*(a[0]-1)
for i in range(a[1]):
  b.append(list(map(int,input().split())))
b=sorted(b,key=lambda b:b[1])
for i in range(a[1]):
  if i!=0 and b[i-1][0]>=b[i][0]:
    continue
  if 0 in c[(b[i][0]-1):b[i][1]]:
    continue
  else:
    c[(b[i][1])-2]=0

print(c.count(0))

a=list(map(int,input().split()))
out=abs(a[0]-a[1])
for i in range(3):
    if i ==0:
        b=a[1]
        c=a[2]
    elif i==1:
        b=a[0]
        c=a[2]
    else:
        b=a[0]
        c=a[1]
    if (abs(b-c)<out):
        out=abs(b-c)
    if (abs(c-b)<out):
        out=abs(c-b)
print(out)

a=list(map(int,input().split()))
out=abs(a[1]-a[0])+abs(a[2]-a[1])
for i in range(3):
    if i ==0:
        b=a[1]
        c=a[2]
    elif i==1:
        b=a[0]
        c=a[2]
    else:
        b=a[0]
        c=a[1]
    if ((abs(b-a[i])+abs(c-b))<out):
        out=abs(b-a[i])+abs(c-b)
    if ((abs(c-a[i])+abs(b-c))<out):
        out=abs(c-a[i])+abs(b-c)
print(out)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
# coding:utf-8

a = list(map(int, input().split()))
a.sort()
print(a)

num = 0
for i in range(len(a)-1):
    num += a[i+1] - a[i]

print(num)


# coding:utf-8

a = list(map(int, input().split()))
a.sort()

num = 0
for i in range(len(a)-1):
    num += a[i+1] - a[i]

print(num)


Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
nums = map(int, input().split(' '))
nums.sort()
map(-nums[0], nums)
print(nums[2] - nums[1])

nums = list(map(int, input().split(' ')))
nums.sort()
buf = nums[0]
nums = list(map(lambda x: x - buf, nums))
print(nums[2])


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A=sorted(list(map(int,input())))
print(A[2]-A[0])

A=sorted(list(map(int,input().split())))
print(A[2]-A[0])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import sys
n, m = map(int, input().split())
demands = [
    tuple(map(int,
              line.strip().split())) for line in sys.stdin.readlines()
]
demands.sort(key=lambda demand: demand[1])

bridge = -1
cnt = 0
for ai, bi in demands:

    if ai <= bridge:
        continue

    else:
        bridge = bi - 1
        cnt += 1

print(cnt)


# -*- coding: utf-8 -*-
from itertools import permutations

ary = map(int, input().split())

min_val = float('inf')
for vals in permutations(ary):
    tmp_val = 0
    for i, val in enumerate(vals):
        if i > 0:
            tmp_val += abs(val - vals[i - 1])

    if min_val > tmp_val:
        min_val = tmp_val

print(min_val)


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import math
import functools


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)

def lcm_list(*numbers):
    return functools.reduce(lcm_base, numbers, 1)

def main() :
    n = int(input())
    a = list(map(int, input().split()))
    lcm = lcm_list(*a)

    ans = 0
    for aa in a :
        ans += (lcm-1) % aa

    print(ans)

main()

a = list(map(int, input().split()))
a = sorted(a)
ans = 0
L = len(a)
for i in range(1,L) :
    ans += abs(a[i]-a[i-1])

print(ans)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = sorted(list(map(int, input().split())))
print(A[0]-A[2])

A = sorted(list(map(int, input().split())))
print(abs(A[0]-A[2]))


Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
As = input().split()
print(max(As)-min(As))

As = input().split()
result =  int(max(As)) - int(min(As))
print(-result if result<0 else result)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
list = list(map(int(input().split())))
print(max(list)-min(list))

list = list(map(int, input().split()))
print(max(list)-min(list))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = list(map(int, input().split()))

ans = 10**5
for i in range(3):
    for j in range(3):
        for k in range(3):
            if i != j and j != k and i != k:
                cost = abs(a[j] - a[i]) + abs(a[k] - a[j])
                print(cost, i, j, k)
                if ans > cost:
                    ans = cost
print(ans)

a = list(map(int, input().split()))

ans = 10**5
for i in range(3):
    for j in range(3):
        for k in range(3):
            if i != j and j != k and i != k:
                cost = abs(a[j] - a[i]) + abs(a[k] - a[j])
                if ans > cost:
                    ans = cost
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A=map(int,input().split());print(max(A)-min(A))

A=list(map(int,input().split()));print(max(A)-min(A))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A=list(map(int,input().split()))
A.sort()
for i in range(len(A)):
  if i==0:
    continue
  else:
    res=res+A[i]-A[i-1]
print(res)

A=list(map(int,input().split()))
A.sort()
for i in range(len(A)):
  if i==0:
    continue
  else:
    res=A[i]-A[i-1]
print(res)

A=list(map(int,input().split()))
A.sort()
for i in range(len(A)):
  if i=0:
    continue
  else:
    res=A[i]-A[i-1]
print(res)


A=list(map(int,input().split()))
A.sort()
res=0
for i in range(len(A)):
  if i==0:
    continue
  else:
    res=res+A[i]-A[i-1]
print(res)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = list(map(int, input().split()))

B = A.sort(reverse=True)

print(B[0] - B[2])

A = list(map(int, input().split()))

A.sort(reverse=True)

print(A[0]-A[2])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
*a = map(int,input().split())
print(max(a)-min(a))

*a, = map(int,input().split())
print(max(a)-min(a))


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a =list(map(int,input().split()))
print(max(a)-min(b))


a =list(map(int,input().split()))
print(max(a)-min(a))


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import sys

def main():
  input = sys.stdin.readline
  A = list(map(int, input().split()))
  A = sorted(A)
  ans = 0
  for i in range(1, len(A)-1):
    ans += A[i+1] - A[i]
  print(ans)


if __name__ == '__main__':
  main()

import sys

def main():
  input = sys.stdin.readline
  A = list(map(int, input().split()))
  A = sorted(A)
  ans = 0
  for i in range(len(A)-1):
    ans += A[i+1] - A[i]
  print(ans)


if __name__ == '__main__':
  main()


Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A1, A2, A3 = map(int, input().split())
print(min(abs(A1 - A2) + abs(A2 - A3), abs(A1 - A3) + abs(A2 - A3), abs(A2 - A1) + abs(A1 - A3), abs(A2 - A3) + abs(A3 - A1), abs(A3 - A1) + abs(A1 - A2), abs(A3 - A2) + abs(A2 - A1))

A1, A2, A3 = map(int, input().split())
print(min(abs(A1 - A2) + abs(A2 - A3), abs(A1 - A3) + abs(A2 - A3), abs(A2 - A1) + abs(A1 - A3), abs(A2 - A3) + abs(A3 - A1), abs(A3 - A1) + abs(A1 - A2), abs(A3 - A2) + abs(A2 - A1))
     )

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
tsk=list(map(int,input().split()))
tsk.sort(reverse=True)
ans=0
for i in range(2):
  ans+=tsk[i]-tsk[i+1]

tsk=list(map(int,input().split()))
print(max(tsk)-min(tsk))



Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c=map(int,input().split())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
s1=d+e
s2=e+f
s3=f+d
l=[s1,s2,s3]
l.sort()
print(sum(l[1:]))

a,b,c=map(int,input().split())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
s1=d+e
s2=e+f
s3=f+d
l=[s1,s2,s3]
l.sort()
print(sum(l[:2]))

a,b,c=map(int,input().split())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
s1=d+e
s2=e+f
s3=f+d
l=[s1,s2,s3]
l.sort()
print(l[0])


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
x = map(int, input().split())
print(max(x) - min(x))

a=list(map(int,split(input())))
print(max(a)-min(a))

x = list(map(int, input().split()))
print(max(x) - min(x))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a1,a2,a3=map(int,input().split())
l=[a1,a2,a3]
l.sort()
print(l[2]+l[0])


a1,a2,a3=map(int,input().split())
l=[a1,a2,a3]
l.sort()
print(l[2]-l[1]*2+l[0])


a1,a2,a3=map(int,input().split())
l=[a1,a2,a3]
l.sort()
print(l[2]-l[0])


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
import unittest

from app.ABC103_A import run


class TestSample(unittest.TestCase):
    def test_run(self):
        self.assertEqual(run([1, 6, 3]), 5)
        self.assertEqual(run([11, 5, 5]), 6)
        self.assertEqual(run([100, 100, 100]), 0)


if __name__ == '__main__':
    unittest.main()


def run(a):
    return max(a) - min(a)


def read_line():
    a = list(map(int, input().split()))
    return a


def main():
    a = read_line()
    print(run(a))


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A,B=map(int,input().split())
print("Yay!" if A<=8 and B<=8 else ":(")

A=list(map(int,input().split()))
A=sorted(A)
print(abs(A[2]-A[0]))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
# x = input()
# print(x[-1]+x[:-1])

# print(y[-1]+y[:-1])

count=0

def check():
	count=0
	for i in range(len(a[0])):
		if(a[0][i]!=a[1][i]):
			break
		if(i==int(len(a[0])-1)):
			count=1
			print("Yes")
	return count


def change():
	b=[]
	for i in range(len(a[0])-1):
		b.append(a[1][i+1])
	b.append(a[1][0])

	a[1]=b



a = []
for i in range(2):
    a.append(input())



check()

if(count==0):
	for i in range(len(a[0])-1):
		change()
		count=check()

		if(count==1):
			break

if(count==0):
	print("No")


# x = input()
# print(x[-1]+x[:-1])

# print(y[-1]+y[:-1])

count=0

def check():
	count=0
	for i in range(len(a[0])):
		if(a[0][i]!=a[1][i]):
			break
		if(i==int(len(a[0])-1)):
			count=1
			print("Yes")
	return count


def change():
	b=[]
	for i in range(len(a[0])-1):
		b.append(a[1][i+1])
	b.append(a[1][0])

	a[1]=b



a = []
for i in range(2):
    a.append(input())



check()

if(count==0):
	for i in range(len(a[0])-1):
		change()
		count=check()

		if(count==1):
			break

if(count==0):
	print("No")


x=list(map(int,input().split()))
y=sorted(x)
print(y)
print(abs(y[0]-y[1])+abs(y[2]-y[1]))
#print(int(x[3]-x[2]))


x=list(map(int,input().split()))
y=sorted(x)
#print(y)
print(abs(y[0]-y[1])+abs(y[2]-y[1]))
#print(int(x[3]-x[2]))


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
#coding:utf-8
a=[int(i) for i in input().split()]
count=0
for i in range(1,2):
  count+=a[i+1]-a[i]
print(count)

#coding:utf-8
a=[int(i) for i in input().split()]
count=0
a.sort()
for i in range(2):
  count+=abs(a[i+1]-a[i])
print(count)

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
s1 = input()
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")


import numpy as np
A = np.array(sorted(map(int, input().split())))
print((A[1:] - A[:-1]).sum())


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = map(int, input().split())
a.sort()
ans = 0
for i, j in zip(a, a[1:]):
  ans += abs(j - i)
print(ans)

a = sorted(map(int, input().split()))
ans = 0
for i, j in zip(a, a[1:]):
  ans += abs(j - i)
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
task = list(map(int, input().split()))
cost = 0
for i in range(2):
  cost += task[i+1] - task[i]
print(cost)

task = list(map(int, input().split()))
task = sorted(task)
cost = 0
for i in range(2):
  cost += task[i+1] - task[i]
print(cost)

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
n, m = map(int, input().split())
a, b = [0] * m, [0] * m
for i in range(m):
    a[i], b[i] = map(int, input().split())
bridge = []
for i in range(m):
    bridge.append(list(range(a[i], b[i])))
cnt = 0

while True:
    cnt_passed = [0] * (n - 1)
    for bri in bridge:
        for j in bri:
            cnt_passed[j - 1] += 1
    removed = cnt_passed.index(max(cnt_passed)) + 1
    for bri in bridge[:]:
        if removed in bri:
            bridge.remove(bri)
    cnt += 1
    if len(bridge) == 0:
        print(cnt)
        exit(0)

a = list(map(int, input().split()))
print(max(a) - min(a))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A=list(map(int,input89.split()))
A.sort()
print(A[2]-A[0])


A=list(map(int,input().split()))
A.sort()
print(A[2]-A[0])


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
L = list[map(int,input().split())]
M = L.sort()
print(L[2]-L[0])

l=sorted(map(int,input().split()))
print(l[-1]-l[0])


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
  a=list(map(int,input().split()))
  print(max(a)-min(a))
         


a=list(map(int,input().split()))
print(max(a)-min(a))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
n = int(input())
a = [int(i) for i in input().split()]
print(max(a)-min(a))


a = [int(i) for i in input().split()]
print(max(a)-min(a))


Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a=map(int,input().split());
print(max(a)-min(a))

a=list(map(int,input().split()));print(max(a)-min(a))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a1,a2,a3 = map(int,input().split())
if abs(a1-a2) < abs(a1-a3):
    print(abs(a2-a1)+abs(a3-a2))
else:
    print(abs(a3-a1)+abs(a1-a2))

a = list(map(int,input().split()))
a.sort()[2]
print(a[2]-a[0])


a = list(map(int,input().split()))
a.sort()
print(a[2]-a[0])

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
S = input()
T = input()

for i in range(len(S)-1):
    x = S[-1]
    S = list(S)
    S.pop(-1)
    S.insert(0,x)
    S = ''.join(S)
    if S == T:
        print('Yes')
        exit()

print('No')

S = input()
T = input()

for i in range(len(S)-1):
    if S == T:
        print('Yes')
        exit()
    x = S[-1]
    S = list(S)
    S.pop(-1)
    S.insert(0,x)
    S = ''.join(S)


print('No')

A,B,C = map(int, input().split())
num_list = [A,B,C]
num_sorted_list = sorted(num_list)
print(num_sorted_list[1]-num_sorted_list[0] + num_sorted_list[2]-num_sorted_list[1])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
str1 = input()
str2 = input()

if str1 == str2:
    print('Yes')

for i in range(len(str1) - 1):

    str1 = str1[-1] + str1[:-1]

    if str1 == str2:
        print('Yes')
        break

if str1 != str2:
    print('No')

str1 = input()
str2 = input()

if str1 == str2:
    print('Yes')

for i in range(len(str1) - 1):
    
    str1 = str1[-1] + str1[:-1]
    
    if str1 == str2:
        print('Yes')

print('No')

n = int(input())

arr = [int(a) for a in input().split()]

max_mod = 0
for i in range(1, max(arr)):

    cur_mod = 0
    for a in arr:
        cur_mod += i % a

    max_mod = max(max_mod, cur_mod)

print(max_mod)



tasks = input()

tasks = [int(t) for t in tasks.split()]

# 0, 1, 2
cost0 = abs(tasks[1] - tasks[0]) + abs(tasks[2] - tasks[1])

# 0, 2, 1
cost1 = abs(tasks[2] - tasks[0]) + abs(tasks[2] - tasks[1])

# 1, 0, 2
cost2 = abs(tasks[1] - tasks[0]) + abs(tasks[2] - tasks[0])

# 1, 2, 0
cost3 = abs(tasks[1] - tasks[2]) + abs(tasks[2] - tasks[0])

# 2, 0, 1
cost4 = abs(tasks[2] - tasks[0]) + abs(tasks[0] - tasks[1])

# 2, 1, 0
cost5 = abs(tasks[2] - tasks[1]) + abs(tasks[0] - tasks[1])

min_cost = min([cost0, cost1, cost2, cost3, cost4, cost5])

print(min_cost)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c = map(int,input().split())
ans = abs(b-a) + abs(c-b)
ans = min(ans,b + abs(c-b))
ans = min(ans,a + c)
ans = min(ans,abs(b-a) + b)
print(ans)

lis = list(map(int,input().split()))
print(max(lis) - min(lis))

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c=map(int,input().split())
abc = sorted(list(n))
print(max(abc) - min(abc))

a,b,c=map(int,input().split())
print(max(a,b,c) - min(a,b,c))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A1,A2,A3=map(int,input().split())
print(A3-A1)

A=list(map(int,input().split()))
print(max(A)-min(A))

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
n = input().split(" ")

a = sorted([int(n[1]),int(n[0]),int(n[2])])

print(a[2]-a[1])

n = input().split(" ")

a = abs((int(n[1])-int(n[0]))+abs((int(n[2])-int(n[1]))
b = abs((int(n[2])-int(n[0]))+abs((int(n[1])-int(n[2]))
c = abs((int(n[2])-int(n[1]))+abs((int(n[0])-int(n[2]))
d = abs((int(n[0])-int(n[1]))+abs((int(n[2])-int(n[0]))
e = abs((int(n[1])-int(n[2]))+abs((int(n[0])-int(n[1]))
f = abs((int(n[0])-int(n[2]))+abs((int(n[1])-int(n[0]))

w = min(a,b,c,d,e,f)

print(w)

n = input().split(" ")
a = sorted([int(n[1]),int(n[0]),int(n[2])])

print(a[1]-a[0])

n = list(map(int,input().split()))
n.sort()
ans = n[2]-n[0]
print(ans)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = list(map(int, input().split()))
a.sort()
t = a[0]
count = 0
for i in range(1,2):
  count += abs(a[i] - t)
  t = a[i]
print(count)

a = list(map(int, input().split()))
a.sort()
print(a[-1] - a[0])

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
c= list(map(int, input().split()))
print(max(list)-min(list))

list=list(map(int, input().split()))
list.sort()
print(list[2]-list[0])

Verdicts: Runtime Error

Accepted