ZhenlongDai/ACPR huggingface dataset:
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
mi = 9999999
for i in range(len(S) - 2):
  mi = min(mi, int(S[i]+S[i+1]+S[i+2]))
print(mi)

Failing test case input:
1166

Expected output:
587


Actual output:
116


Fixed submission (verdict: Accepted):
S = input()
mi = 9999999
for i in range(len(S) - 2):
  mi = min(mi, abs(753 - int(S[i]+S[i+1]+S[i+2])))
print(mi)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
ans=1000
for i in range(len(s)-3):
  ans=min(ans,abs(int(s[i:i+3])-753))
print(ans)

Failing test case input:
139648651

Expected output:
102


Actual output:
105


Fixed submission (verdict: Accepted):
s=input()
ans=10000
for i in range(len(s)-2):
  ans=min(ans,abs(int(s[i:i+3])-753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
nums = []
num = 100000
for i in range(len(s)):
  if i+2>=len(s):
    break  
  nums.append(s[i])
  nums.append(s[i+1])
  nums.append(s[i+2])
  temp = int(''.join(nums))
  nums.clear()
  ans = min(abs(temp-753),num)
    
print(ans)

Failing test case input:
12089

Expected output:
545


Actual output:
664


Fixed submission (verdict: Accepted):
s = input()
nums = []
num = 100000
for i in range(len(s)):
  if i+2>=len(s):
    break  
  nums.append(s[i])
  nums.append(s[i+1])
  nums.append(s[i+2])
  temp = int(''.join(nums))
  nums.clear()
  num = min(abs(temp-753),num)
print(num)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
li=list(map(int,list((input()))))
print(min(abs(753-li[i]*100+li[i+1]*10+li[i+2]) for i in range(len(li)-2)))


Failing test case input:
139648651

Expected output:
102


Actual output:
18


Fixed submission (verdict: Accepted):
li=list(map(int,list((input()))))
print(min(abs(753-(li[i]*100+li[i+1]*10+li[i+2])) for i in range(len(li)-2)))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
m = 1e9
for i in range(len(S)-3):
  m = min(m, int(S[i:i+3]))
print(m)

Failing test case input:
3415

Expected output:
338


Actual output:
341


Fixed submission (verdict: Accepted):
S = input()
m = 1e9
for i in range(len(S)-2):
  m = min(m, abs(753 - int(S[i:i+3])))
print(m)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=len(s)
print(n)
ans=[]
for i in range(n-2):
    temp=int(s[i:i+3])
    ans.append(abs(temp-753))
print(min(ans))


Failing test case input:
1646883079

Expected output:
65


Actual output:
10
65


Fixed submission (verdict: Accepted):
s=input()
n=len(s)
ans=[]
for i in range(n-2):
    temp=int(s[i:i+3])
    ans.append(abs(temp-753))
print(min(ans))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
SS = int(S)
for i in range(0, len(S)):
    for j in range(0, i):
        for k in range(0, j):
            X = int(S[k] + S[j] + S[i])
            if abs(753 - X) < SS:
                SS = abs(753 - X)
print(SS)

Failing test case input:
58101

Expected output:
57


Actual output:
48


Fixed submission (verdict: Accepted):
S = input()
SS = int(S)
for i in range(0, len(S) - 2):
            X = int(S[i: i + 3])
            if abs(753 - X) < SS:
                SS = abs(753 - X)
print(SS)

Problem: p03211
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
Min = 1000
for i in range(len(s)-2):
    x = s[i:i+3]
    print(x, i)
    if abs(753-int(x)) < Min:
        Min = abs(753-int(x))
print(Min)     

Failing test case input:
89141

Expected output:
138


Actual output:
891 0
914 1
141 2
138


Fixed submission (verdict: Accepted):
s = input()
Min = 1000
for i in range(len(s)-2):
    x = s[i:i+3]
    if abs(753-int(x)) < Min:
        Min = abs(753-int(x))
print(Min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


if __name__ == '__main__':
    s = input()
    r = 1000
    for i in range(len(s)-3):
        t = int(s[i:i+3])
        t -= 753
        if t < 0:
            t = t * -1
        if t < r:
            r = t
    print(r)


Failing test case input:
1307

Expected output:
446


Actual output:
623


Fixed submission (verdict: Accepted):


if __name__ == '__main__':
    s = input()
    r = 1000
    for i in range(len(s)-2):
        t = int(s[i:i+3])
        t -= 753
        if t < 0:
            t = t * -1
        if t < r:
            r = t
    print(r)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
n = len(s)
ans = 0
for i in range(n-2):
  if abs(753-ans) > abs(753-int(s[i:i+3])):
    ans = int(s[i:i+3])
print(ans)

Failing test case input:
63510

Expected output:
118


Actual output:
635


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
ans = 10000
for i in range(n-2):
  x = int(s[i:i+3])
  ans = min(ans, abs(753-x))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans = 10000
for i in range(3,len(S)):
    ans = min(ans,abs(753 - int(S[i-3:i])))
print(ans)

Failing test case input:
1307

Expected output:
446


Actual output:
623


Fixed submission (verdict: Accepted):
S = input()
ans = 10000
for i in range(3,len(S)+1):
    ans = min(ans,abs(753 - int(S[i-3:i])))
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()

ans = float("inf")
for i in range(len(s)-2):
    num = int(s[i:i+3])
    if abs(754-num) < ans:
        ans = abs(754-num)

print(ans)

Failing test case input:
7868

Expected output:
33


Actual output:
32


Fixed submission (verdict: Accepted):
s = input()

ans = float("inf")
for i in range(len(s)-2):
    num = int(s[i:i+3])
    if abs(753-num) < ans:
        ans = abs(753-num)

print(ans)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

min = abs(int(S[0:3]) - 753)
for i in range(len(S) - 2):
    min_now = abs(int(S[i:i+3])- 753)
    if min > min_now:
        min = min_now
print(min_now)


Failing test case input:
89141

Expected output:
138


Actual output:
612


Fixed submission (verdict: Accepted):
S = str(input())

min = abs(int(S[0:3]) - 753)

for i in range(1, len(S) - 2):
    min_now = abs(int(S[i:i+3]) - 753)
    if min > min_now:
        min = min_now
print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=str(input())
min_dif = 1000
for i in range(len(S)-2):
  dif = abs( int(S[i:i+3]) - 754)
  if min_dif > dif:
    min_dif = dif
print(dif)


Failing test case input:
5306

Expected output:
223


Actual output:
448


Fixed submission (verdict: Accepted):
S=str(input())
min_dif = 1000
for i in range(len(S)-2):
  dif = abs( int(S[i:i+3]) - 753)
  if min_dif > dif:
    min_dif = dif
print(min_dif)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A = input()
N=len(str(A))
for i in range(N-2):
  if i ==0:
    B=A[i:i+3]
    V=int(B)
  else:
    B=int(A[i:i+3])
    if abs(753-B)<=abs(753-V):
      V=B
print(V)
    
    

Failing test case input:
177719

Expected output:
18


Actual output:
771


Fixed submission (verdict: Accepted):
A = input()
N=len(str(A))
for i in range(N-2):
  if i ==0:
    B=A[i:i+3]
    V=int(B)
  else:
    B=int(A[i:i+3])
    if abs(753-B)<=abs(753-V):
      V=B
print(abs(V-753))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans = 100000000000;
for i in range(len(S) - 3):
    X = int(S[i] + S[i + 1] + S[i + 2])
    ans = min(ans, abs(X - 753))
print(ans)    

Failing test case input:
1307

Expected output:
446


Actual output:
623


Fixed submission (verdict: Accepted):
S = input()
ans = 1000000000;
for i in range(len(S) - 2):
    X = int(S[i] + S[i + 1] + S[i + 2])
    ans = min(ans, abs(X - 753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


if __name__ == '__main__':
    s = input()
    r = 1000
    for i in range(len(s)-2):
        print(s[i:i+3])
        t = int(s[i:i+3])
        t -= 753
        if t < 0:
            t = t * -1
        if t < r:
            r = t
    print(r)


Failing test case input:
226242

Expected output:
129


Actual output:
226
262
624
242
129


Fixed submission (verdict: Accepted):


if __name__ == '__main__':
    s = input()
    r = 1000
    for i in range(len(s)-2):
        t = int(s[i:i+3])
        t -= 753
        if t < 0:
            t = t * -1
        if t < r:
            r = t
    print(r)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
l=len(s)
ans=99999
for i in range(0,l-2):
    
    a=abs(int(s[i:i+3])-753)
    
    if ans > a:
        ans=a
print(a)


    
    

Failing test case input:
12089

Expected output:
545


Actual output:
664


Fixed submission (verdict: Accepted):
s=input()
ans=99999
l=[]
for i in range(len(s)-2):
    
    a=abs(int(s[i:i+3])-753)
    l.append(a)
    

print(min(l))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
d=999
import re
for n in range(7,0,-1):
  for i in re.findall(str(n)+'..',s):
    d=min(d,abs(753-int(i)))
  if d<800:break
print(d)

Failing test case input:
19371

Expected output:
184


Actual output:
382


Fixed submission (verdict: Accepted):
s=input()
d=999
import re
l=[[7],[6,8],[5,9]]+[[x] for x in range(4,0,-1)]
for n in l:
  for j in n:
    for i in re.findall('(?=('+str(j)+'..))',s):
      d=min(d,abs(753-int(i)))
  if d<800:break
print(d)

Problem: p03211
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
ans = ''
m = 1000
for i in range(len(s)-3):
  _s = int(s[i:i+3])
  d = abs(_s - 753)
  if d < m:
    m = d
    ans = _s
print(ans)

Failing test case input:
39516

Expected output:
198


Actual output:
951


Fixed submission (verdict: Accepted):
s = input()
m = 1000
for i in range(len(s)-2):
  _s = int(s[i:i+3])
  d = abs(_s - 753)
  m = min(m, d)
print(m)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input().strip()

min_diff = 1000000

for i in range(len(s) - 2):
    num = int(s[i: i+3])
    print(num)
    diff = abs(753 - num)
    min_diff = min(diff, min_diff)

print(min_diff)


Failing test case input:
6648

Expected output:
89


Actual output:
664
648
89


Fixed submission (verdict: Accepted):
s = input().strip()

min_diff = 1000000

for i in range(len(s) - 2):
    num = int(s[i: i+3])
    diff = abs(753 - num)
    min_diff = min(diff, min_diff)

print(min_diff)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()

ans = 10**9
for i in range(len(S) - 3):
    x = S[i:i+3]
    now = abs(int(x) - 753)
    ans = min(ans, now)
print(ans)

Failing test case input:
7752

Expected output:
1


Actual output:
22


Fixed submission (verdict: Accepted):
S = input()

ans = 10**9
for i in range(len(S) - 2):
    x = S[i:i+3]
    now = abs(int(x) - 753)
    ans = min(ans, now)
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
min = 1000
for i in range(len(S) - 2):
	x = int(S[i:i+3])
	print(x)
	x = abs(753 - x)
	if min > x:
		min = x
print(min)

Failing test case input:
6377

Expected output:
116


Actual output:
637
377
116


Fixed submission (verdict: Accepted):
S = input()
min = 1000
for i in range(len(S) - 2):
	x = int(S[i:i+3])
	x = abs(753 - x)
	if min > x:
		min = x
print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = 753
res = float("inf")
l = len(a)

for i in range(0,l-2):
    n = abs(b-int(a[i:i+3]))
    if res > n:
        res = n
        
print(n)


Failing test case input:
211616271

Expected output:
126


Actual output:
482


Fixed submission (verdict: Accepted):
a = input()
b = 753
res = float("inf")
l = len(a)

for i in range(0,l-2):
    n = abs(b-int(a[i:i+3]))
    if res > n:
        res = n
        
print(int(res))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
len_s = len(S)
ans = 753
for i in range(len_s-2):
  ans = min(ans, int(S[i:i+3]))
print(ans)

Failing test case input:
177719

Expected output:
18


Actual output:
177


Fixed submission (verdict: Accepted):
S = input()
len_s = len(S)
ans = 753
for i in range(len_s-2):
  ans = min(ans, abs(753-int(S[i:i+3])))
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=list(input())
t=[int(a) for a in s]
n=int(len(t))
ans=0
b=0
list1=[]
s=1000
for i in range(n-2):
    u=[t[i],t[i+1],t[i+2]]
    v="".join(map(str, u))
    w=int(v)-753
    list1.append(w)
u=int(len(list1))
for i in range(u-1):
    if abs(list1[i])-abs(s)<0:
        s=list1[i]
    else :
        pass
print(abs(s))

Failing test case input:
12254

Expected output:
499


Actual output:
528


Fixed submission (verdict: Accepted):
s=list(input())
t=[int(a) for a in s]
n=int(len(t))
ans=0
b=0
list1=[]
s=1000
for i in range(n-2):
    u=[t[i],t[i+1],t[i+2]]
    v="".join(map(str, u))
    w=int(v)-753
    list1.append(w)
u=int(len(list1))
for i in range(u):
    if abs(list1[i])-abs(s)<=0:
        s=list1[i]
    else :
        pass
print(abs(s))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

leng = len(s)

con = 753

ans = 10000000000

for i in range(leng-2):
    temp = int(s[i:i+2])
    ans = ans if abs(temp-con) > ans else abs(temp-con)

print(ans)



Failing test case input:
21066

Expected output:
543


Actual output:
732


Fixed submission (verdict: Accepted):
s = input().rstrip()

leng = len(s)

con = 753

ans = 10000000000


for i in range(leng-2):
    temp = int(s[i:i+3])  
    ans = ans if abs(temp-con) > ans else abs(temp-con)

print(ans)

Problem: p03211
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
data = [int(i) for i in input()]
ans = 999

for i in range(len(data) - 3):
  x = (data[i] * 100) + (data[i + 1] * 10) + (data[i + 2])
  ans = min(ans, abs(753 - x))
  
print(ans)

Failing test case input:
3500

Expected output:
253


Actual output:
403


Fixed submission (verdict: Accepted):
data = [int(i) for i in input()]
ans = 999
 
for i in range(len(data) - 2):
  x = (data[i] * 100) + (data[i + 1] * 10) + (data[i + 2])
  ans = min(ans, abs(753 - x))
  
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
table = list(map(int, input()))
diff_nagomi = 1000
for i in range(len(table)-2):
    diff = table[i] * 100 + table[i + 1] * 10 + table[i + 2] - 753
    if diff_nagomi > diff:
        ans = diff
print(abs(ans))


Failing test case input:
18506

Expected output:
97


Actual output:
247


Fixed submission (verdict: Accepted):
table = list(map(int, input()))
diff_nagomi = 1000
ans = 0
for i in range(len(table)-2):
    diff = abs(table[i] * 100 + table[i + 1] * 10 + table[i + 2] - 753)
    if diff_nagomi > diff:
        ans = diff
        diff_nagomi = diff
print(ans)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

N = len(S)
Y = 753
ans =abs( Y - (int(S[0]) * 100 + int(S[1]) * 10 + int(S[2])))

for i in range(4,N):
    ans = min(ans, abs(Y - (int(S[i-2]) * 100 + int(S[i-1]) * 10 + int(S[i]))))
print(ans)
    

Failing test case input:
39516

Expected output:
198


Actual output:
237


Fixed submission (verdict: Accepted):
S = input()
 
N = len(S)
Y = 753
ans =abs( Y - (int(S[0]) * 100 + int(S[1]) * 10 + int(S[2])))
 
for i in range(3,N):
    ans = min(ans, abs(Y - (int(S[i-2]) * 100 + int(S[i-1]) * 10 + int(S[i]))))
    
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

ans = []

for i in range(2, len(S)):
    ans.append(abs(753 - int(S[i-2:i+1])))

print(min(ans), ans)
    


Failing test case input:
56594

Expected output:
94


Actual output:
94 [188, 94, 159]


Fixed submission (verdict: Accepted):
S = input()

ans = []

for i in range(2, len(S)):
    ans.append(abs(753 - int(S[i-2:i+1])))

print(min(ans))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
l = []
for i in range(len(S)-2):
  l.append(abs(int(S[i:i+2])-753))

print(min(l))

Failing test case input:
145224

Expected output:
231


Actual output:
701


Fixed submission (verdict: Accepted):
S = input()
l = []
for i in range(len(S)-2):
  l.append(abs(int(S[i:i+3])-753))
     
print(min(l))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
l = []

for i in range(len(S) - 2):
    a = S[i] + S[i + 1] + S[i + 2]
    l.append(a)
ans = int(l[0])
for j in l:
    ans = min(ans, abs(int(j) - 753))
print(ans)

Failing test case input:
145224

Expected output:
231


Actual output:
145


Fixed submission (verdict: Accepted):
S = input()
l = []
m = []

for i in range(len(S) - 2):
    a = S[i] + S[i + 1] + S[i + 2]
    l.append(a)

for j in l:
    
    m.append(abs(int(j) - 753))
    
    
print(min(m))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    S = input()
    mind = 1000
    for i in range(len(S) - 3 + 1):
        d = abs(753 - int(S[i:i+3]))
        if d < mind:
            mind = d
    print(d)
main()

Failing test case input:
53216

Expected output:
221


Actual output:
537


Fixed submission (verdict: Accepted):
def main():
    S = input()
    mind = 1000
    for i in range(len(S) - 3 + 1):
        d = abs(753 - int(S[i:i+3]))
        if d < mind:
            mind = d
    print(mind)
main()

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans = 0xdeadbeef
for i in range(len(S)-3):
    ans = min(ans, abs(int(S[i:i+3]) - 753))

print(ans)


Failing test case input:
144579

Expected output:
174


Actual output:
296


Fixed submission (verdict: Accepted):
S = input()
ans = 0xdeadbeef
for i in range(len(S)-2):
    ans = min(ans, abs(int(S[i:i+3]) - 753))

print(ans)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Sstr = list(input())
S = [int(i) for i in Sstr]

bit=[]
for i in range(len(S)):
    bit.append([abs(7-S[i]),i])


bit.sort(key=lambda x : x[0])

j=0
start=[]
while bit[0] == bit[j]:
    start.append(bit[j][1])
    j+=1
    
test=0
ans=1000
for st in start:
    if len(S)-st >= 3:
        test=abs(753-(S[st]*100+S[st+1]*10+S[st+2]))
        if ans > test:
            ans=test
print(ans)

Failing test case input:
12089

Expected output:
545


Actual output:
1000


Fixed submission (verdict: Accepted):
Sstr = list(input())
S = [int(i) for i in Sstr]

bit=[]
for i in range(0,len(S)-2):
    bit.append([abs(7-S[i]),i])


bit.sort(key=lambda x : x[0])

j=0
start=[]

for j in range(len(bit)):
    if bit[0][0] == bit[j][0]:
        start.append(bit[j][1])
        j+=1
    else:
        break

test=0
ans=1000
for st in start:
    if len(S)-st >= 3:
        test=abs(753-(S[st]*100+S[st+1]*10+S[st+2]))
        if ans > test:
            ans=test
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
a = 100000
for i in range(len(S) - 2):
    s = int(S[i:i + 3])
    print(s)
    a = min(a, abs(753 - s))
print(a)


Failing test case input:
1801

Expected output:
48


Actual output:
180
801
48


Fixed submission (verdict: Accepted):
S = input()
a = 100000
for i in range(len(S) - 2):
    s = int(S[i:i + 3])
    a = min(a, abs(753 - s))
print(a)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans = float("inf")
for i in range(len(s) - 3):
    x = int(s[i:i+3])
    ans = min(ans, abs(x - 753))
print(ans)

Failing test case input:
12458

Expected output:
295


Actual output:
508


Fixed submission (verdict: Accepted):
s = input()
ans = float("inf")
for i in range(len(s) - 2):
    x = int(s[i:i+3])
    ans = min(ans, abs(x - 753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

S = input()

log = math.floor(math.log10(int(S)))
m = 753
for i in range(0,log-2):
    now = int(S[i] + S[i+1] + S[i+2])
    m = min(m, abs(753-now))

print(m)
    


Failing test case input:
1166

Expected output:
587


Actual output:
637


Fixed submission (verdict: Accepted):
import math

S = input()

log = math.floor(math.log10(int(S)))
m = 753
for i in range(0,log-1):
    now = int(S[i] + S[i+1] + S[i+2])
    m = min(m, abs(753-now))

print(m)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    s = list(map(int,list(input())))
    n = len(s)
    ans = 1000
    for i in range(n-2):
        ans = min(ans,abs(753-100*s[i]+10*s[i+1]+s[i+2]))
    
    print(ans)

main()


Failing test case input:
978408132

Expected output:
31


Actual output:
7


Fixed submission (verdict: Accepted):

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    s = list(map(int,list(input())))
    n = len(s)
    ans = 1000
    for i in range(n-2):
        ans = min(ans,abs(753-(100*s[i]+10*s[i+1]+s[i+2])))
    
    print(ans)

main()

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
l=len(a)
if(l<=3):
    b=abs(753-int(a))
    print(b)
else:
    b=[0]*(l-3)
    for i in range(0,l-3):
        b[i]=abs(753-int(a[i]+a[i+1]+a[i+2]))
    print(min(b))
    

Failing test case input:
3500

Expected output:
253


Actual output:
403


Fixed submission (verdict: Accepted):
a=input()
l=len(a)
if(l<=3):
    b=abs(753-int(a))
    print(b)
else:
    b=[0]*(l-2)
    for i in range(0,l-2):
        b[i]=abs(753-int(a[i]+a[i+1]+a[i+2]))
    print(min(b))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans = 1000000000;
for i in range(len(S) - 3):
    X = int(S[i] + S[i + 1] + S[i + 2])
    ans = min(ans, abs(X - 753))
print(ans)    

Failing test case input:
12254

Expected output:
499


Actual output:
528


Fixed submission (verdict: Accepted):
S = input()
ans = 1000000000;
for i in range(len(S) - 2):
    X = int(S[i] + S[i + 1] + S[i + 2])
    ans = min(ans, abs(X - 753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
x = []
for i in range(len(s)-2):
    print(s[i:i+2]+s[i+2])
    x.append(abs(int(s[i:i+2]+s[i+2])-753))
print(min(x))

Failing test case input:
80343

Expected output:
50


Actual output:
803
034
343
50


Fixed submission (verdict: Accepted):
s = input()
x = []
for i in range(len(s)-2):
    
    x.append(abs(int(s[i:i+2]+s[i+2])-753))
print(min(x))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
c=1000
for b in range(len(a)):
  if (int(a[b:b+3])-753)<c:
    c = int(a[b:b+3])-753
print(c)   

Failing test case input:
1335

Expected output:
418


Actual output:
-748


Fixed submission (verdict: Accepted):
a=input()
c=1000
for b in range(len(a)):
  if abs(int(a[b:b+3])-753)<c:
    c = abs(int(a[b:b+3])-753)
print(c)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 0
  tempmin = 1000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if (min >= tempmin):
      break
    tempmin = min

  print(min)


      

Failing test case input:
177719

Expected output:
18


Actual output:
34


Fixed submission (verdict: Accepted):

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 10000000000000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    tempmin = abs(comp_num - temp)
    
    if tempmin <= min:
      min = tempmin
  print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
for i in range(len(S)-2):
    if i==0:
        a=abs(int(S[i:i+2])-753)
    else:
        if a>abs(int(S[i:i+3])-753):
            a=abs(int(S[i:i+3])-753)
    
print(a)

Failing test case input:
5152

Expected output:
238


Actual output:
601


Fixed submission (verdict: Accepted):
S=input()
for i in range(len(S)-2):
    if i==0:
        a=abs(int(S[i:i+3])-753)
    else:
        if a>abs(int(S[i:i+3])-753):
            a=abs(int(S[i:i+3])-753)
    
print(a)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n = input()

_min =sys.maxsize
for i in range(len(n)-2):
    tmp = int(n[i:i+3])
    tmp = abs(753-tmp)
    if tmp < _min:
        _min = tmp

print(tmp)

Failing test case input:
8228999

Expected output:
69


Actual output:
246


Fixed submission (verdict: Accepted):
import sys
n = input()

_min =sys.maxsize
for i in range(len(n)-2):
    tmp = int(n[i:i+3])
    tmp2 = abs(753-tmp)
    if tmp2 < _min:
        _min = tmp2

print(_min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(map(int, list(input())))
m = 1000
for i in range(len(s)-3):
  if abs(753 - (s[i]*100+s[i+1]*10+s[i+2])) < m:
    m = abs(753 - (s[i]*100+s[i+1]*10+s[i+2]))
print(m)

Failing test case input:
1339

Expected output:
414


Actual output:
620


Fixed submission (verdict: Accepted):
s = list(map(int, list(input())))
m = 1000
for i in range(len(s)-2):
  if abs(753 - (s[i]*100+s[i+1]*10+s[i+2])) < m:
    m = abs(753 - (s[i]*100+s[i+1]*10+s[i+2]))
print(m)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=len(a)
c=[a[0+i:3+i] for i in range(b-2)]
d=[abs(int(j)-754) for j in c ]
print(min(d))



Failing test case input:
18506

Expected output:
97


Actual output:
96


Fixed submission (verdict: Accepted):
a=input()
b=len(a)
c=[a[0+i:3+i] for i in range(b-2)]
d=[abs(int(j)-753) for j in c ]
print(min(d))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
mini = 800

for i in range(len(S)-2):
  s_num =  100 * int(S[i]) + 10 * int(S[i+1]) + int(S[i+2])
  a = abs(753 - s_num) 
  if a < mini:
    mini = a
    
print(a)

Failing test case input:
18511

Expected output:
98


Actual output:
242


Fixed submission (verdict: Accepted):
S = list(input())
mini = 800

for i in range(len(S)-2):
  s_num =  100 * int(S[i]) + 10 * int(S[i+1]) + int(S[i+2])
  a = abs(753 - s_num) 
  if a < mini:
    mini = a
    
print(mini)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
m = abs(753-int(s[0])*100+int(s[1])*10+int(s[2]))
for i in range(1,len(s)-2):
  a = int(s[i])*100+int(s[i+1])*10+int(s[i+2])
  m = min(m,abs(753-a))
  
print(m)
  


Failing test case input:
8947

Expected output:
141


Actual output:
47


Fixed submission (verdict: Accepted):
s = str(input())
m = abs(753-int(s[0])*100-int(s[1])*10-int(s[2]))
for i in range(1,len(s)-2):
  a = int(s[i])*100+int(s[i+1])*10+int(s[i+2])
  m = min(m,abs(753-a))
  
print(m)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
d=999
import re
l=[[7],[6,8],[5,9]]+[[x] for x in range(4,0,-1)]
for n in l:
  for j in n:
    for i in re.findall('(?=('+str(j)+'..))',s):
      print(i)
      d=min(d,abs(753-int(i)))
  if d<800:break
print(d)

Failing test case input:
2142

Expected output:
539


Actual output:
214
539


Fixed submission (verdict: Accepted):
s=input()
d=999
import re
l=[[7],[6,8],[5,9]]+[[x] for x in range(4,0,-1)]
for n in l:
  for j in n:
    for i in re.findall('(?=('+str(j)+'..))',s):
      d=min(d,abs(753-int(i)))
  if d<800:break
print(d)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s= input()
n = len(s)
min = 1000
for i in range(n-2):
    k = 100*int(s[i])+10*int(s[i+1])+int(s[i+2])
    if min > abs(753-k):
        min = abs(753-k)
        print(k)
    
print(min)

Failing test case input:
40601

Expected output:
152


Actual output:
406
601
152


Fixed submission (verdict: Accepted):
s= input()
n = len(s)
min = 1000
for i in range(n-2):
    k = 100*int(s[i])+10*int(s[i+1])+int(s[i+2])
    if min > abs(753-k):
        min = abs(753-k)
    
print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
text=input()
N=len(text)
ls=[]
for i in range(N):
  ls.append(int(text[i]))
print(ls)
ans=1000
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      a=100*i+10*j+k
      if abs(a-753)<ans:
        ans=abs(a-753)
print(ans)

Failing test case input:
77673

Expected output:
14


Actual output:
[7, 7, 6, 7, 3]
519


Fixed submission (verdict: Accepted):
text=input()
N=len(text)
ls=[]
for i in range(N):
  ls.append(int(text[i]))
ans=1000
for i in range(N-2):
  a=100*ls[i]+10*ls[i+1]+ls[i+2]
  if abs(a-753)<ans:
    ans=abs(a-753)
print(ans)
Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
table = list(map(int, input()))
diff_nagomi = 1000
for i in range(len(table)-2):
    diff = abs(table[i] * 100 + table[i + 1] * 10 + table[i + 2] - 753)
    if diff_nagomi > diff:
        ans = diff
print(ans)


Failing test case input:
38621

Expected output:
109


Actual output:
132


Fixed submission (verdict: Accepted):
table = list(map(int, input()))
diff_nagomi = 1000
ans = 0
for i in range(len(table)-2):
    diff = abs(table[i] * 100 + table[i + 1] * 10 + table[i + 2] - 753)
    if diff_nagomi > diff:
        ans = diff
        diff_nagomi = diff
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
x = 753
res = 1000
for i in range(len(s)-3):
    e_s = s[i:i+3]
    res = min(res, abs(x - int(e_s)))
print(res)

Failing test case input:
1514858721

Expected output:
32


Actual output:
105


Fixed submission (verdict: Accepted):
s = input()
x = 753
res = 1000
for i in range(len(s)-2):
    e_s = s[i:i+3]
    res = min(res, abs(x - int(e_s)))
print(res)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
str1 = input()

len1 = len(str1)
diff = 999

for x in range (len1-2):
    num = int(str1[x:x+3])
    print (num, diff)
    if abs(num-753) <diff:
        diff = abs(num-753)
print (diff)

Failing test case input:
8163944

Expected output:
63


Actual output:
816 999
163 63
639 63
394 63
944 63
63


Fixed submission (verdict: Accepted):
str1 = input()

len1 = len(str1)
diff = 999

for x in range (len1-2):
    num = int(str1[x:x+3])
    if abs(num-753) <diff:
        diff = abs(num-753)
print (diff)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=str(input())
ListNum=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUM=(Num-753)**2
    ListNum.append(Num)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))
print(NUM**(1/2))


Failing test case input:
38621

Expected output:
109


Actual output:
132.0


Fixed submission (verdict: Accepted):
S=str(input())
ListNum=[]
ListNUm=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUm=Num-753
    NUM=NUm**2
    ListNum.append(Num)
    ListNUm.append(NUm)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))

if ListNUm[posi]<0:
  ListNUm[posi]=ListNUm[posi]*(-1)
print(ListNUm[posi])

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

mn = abs(753 - int(S[0:3]))
for i in range(2, len(S)):
    mn = min(mn, abs(753 - int(S[i:i+3])))

print(mn)

Failing test case input:
56594

Expected output:
94


Actual output:
159


Fixed submission (verdict: Accepted):
S = input()

mn = int(S)
for i in range(len(S)-2):
    mn = min(mn, abs(753 - int(S[i:i+3])))

print(mn)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
ans = 1000
for i in range(len(S)-3):
  diff = abs(int(S[i:i+3]) - 753)
  ans = min(diff, ans)
print(ans)

Failing test case input:
144579

Expected output:
174


Actual output:
296


Fixed submission (verdict: Accepted):
S=input()
ans = 1000
for i in range(len(S)-2):
  diff = abs(int(S[i:i+3]) - 753)
  ans = min(diff, ans)
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
str = list(input())  
ans = 1000

for i in range(len(str)-1):
    sa = abs(int(str[i - 1]) * 100 + int(str[i]) * 10 + int(str[i + 1]) - 753)
    ans = min(ans, sa)

print(ans)


Failing test case input:
39516

Expected output:
198


Actual output:
114


Fixed submission (verdict: Accepted):
str = list(input())  
ans = 1000

for i in range(len(str) - 2):
    sa = abs(int(str[i]) * 100 + int(str[i+1]) * 10 + int(str[i + 2]) - 753)
    ans = min(ans, sa)

print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
lst = []
for i in range(len(S)-2):
    a = int(''.join(S[i:i+3]))
    lst.append(a)
mini = 1000
for j in lst:
    if abs(j-753) < mini:
        mini = abs(j-753)
print(mini, lst)

Failing test case input:
18511

Expected output:
98


Actual output:
98 [185, 851, 511]


Fixed submission (verdict: Accepted):
S = list(input())
lst = []
for i in range(len(S)-2):
    a = int(''.join(S[i:i+3]))
    lst.append(a)
mini = 1000
for j in lst:
    if abs(j-753) < mini:
        mini = abs(j-753)
print(mini)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
ans = 753 - int(s[0] + s[1] + s[2])
for i in range (len(s) - 2):
  num = s[i] + s[i+1] + s[i+2]
  if ans > abs(int(num)-753):
    ans = abs(int(num)-753)
print(ans)

Failing test case input:
89141

Expected output:
138


Actual output:
-138


Fixed submission (verdict: Accepted):
s = list(input())
ans = abs(753 - int(s[0] + s[1] + s[2]))
for i in range (len(s) - 2):
  num = s[i] + s[i+1] + s[i+2]
  if ans > abs(int(num)-753):
    ans = abs(int(num)-753)
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
a=300
for i in range(len(s)-2):
  x=int(s[i:i+3])
  a=min(a,abs(x-753))
print(a)

Failing test case input:
22036

Expected output:
533


Actual output:
300


Fixed submission (verdict: Accepted):
s=input()
a=1000
for i in range(len(s)-2):
  x=int(s[i:i+3])
  a=min(a,abs(x-753))
print(a)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=input()
b=753
for i in range(len(a)-2):
  if abs(int(a[i]+a[i+1]+a[i+2])-753)<b:
    b=abs(int(a[i]+a[i+1]+a[i+2]))
print(b)

Failing test case input:
3415

Expected output:
338


Actual output:
415


Fixed submission (verdict: Accepted):
a=input()
b=753
for i in range(len(a)-2):
  if abs(int(a[i]+a[i+1]+a[i+2])-753)<b:
    b=abs(int(a[i]+a[i+1]+a[i+2])-753)
print(b)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
dif = 999
for i in range(len(s)-3):
    num=int(s[i]+s[i+1]+s[i+2])
    dif_num = abs(num-753)
    if dif_num < dif:
        dif = dif_num
print(dif)


Failing test case input:
1514858721

Expected output:
32


Actual output:
105


Fixed submission (verdict: Accepted):
s = input()
dif = abs(int(s[0]+s[1]+s[2])-753)
for i in range(len(s)-2):
    num=int(s[i]+s[i+1]+s[i+2])
    dif_num = abs(num-753)
    if dif_num < dif:
        dif = dif_num
print(dif)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
min_ = 10**18
for i in range(len(s)-2):
  min_ = min(min_, abs(753 - int(s[i:i+3])))


Failing test case input:
93622

Expected output:
131


Actual output:

Fixed submission (verdict: Accepted):
s = input()
min_ = 10**18
for i in range(len(s)-2):
  min_ = min(min_, abs(753 - int(s[i:i+3])))

print(min_)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=str(input())
ListNum=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUM=(Num-753)**2
    ListNum.append(Num)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))
print(int(NUM**(1/2)))


Failing test case input:
79098

Expected output:
37


Actual output:
655


Fixed submission (verdict: Accepted):
S=str(input())
ListNum=[]
ListNUm=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUm=Num-753
    NUM=NUm**2
    ListNum.append(Num)
    ListNUm.append(NUm)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))

if ListNUm[posi]<0:
  ListNUm[posi]=ListNUm[posi]*(-1)
print(ListNUm[posi])

Problem: p03211
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=input()
l=len(s)-3
mn=10**100
for i in range(l):
  mn=min(mn,abs(753-int(s[i:i+3])))
print(mn)

Failing test case input:
40601

Expected output:
152


Actual output:
347


Fixed submission (verdict: Accepted):
def resolve():
	s=input()
	l=len(s)-2
	mn=10**100
	for i in range(l):
	  mn=min(mn,abs(753-int(s[i:i+3])))
	print(mn)

resolve()

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
num = ""
l = len(S)
dis = float("inf") 

for i in range(l-2):
    num = S[i:i+3]
    if abs(787-int(num)) < dis:
        dis = abs(753-int(num))

print(dis)

Failing test case input:
89141

Expected output:
138


Actual output:
161


Fixed submission (verdict: Accepted):
S = input()
num = ""
l = len(S)
dis = float("inf") 

for i in range(l-2):
    num = S[i:i+3]
    if abs(753-int(num)) < dis:
        dis = abs(753-int(num))
        
print(dis)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
vals = []
for i in range(len(S) - 2):
    vals.append(abs(754 - int(S[i:i+3])))
print(min(vals))


Failing test case input:
63510

Expected output:
118


Actual output:
119


Fixed submission (verdict: Accepted):
S = input()
vals = []
for i in range(len(S) - 2):
    vals.append(abs(753 - int(S[i:i+3])))
print(min(vals))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())

L = []
K = []

for i in range(len(S)-2):
    L.append(int(S[0+i]+S[1+i]+S[2+i]))

for i in range(len(L)):

    K.append(753-abs(L[i]))
print(min(K))


Failing test case input:
19371

Expected output:
184


Actual output:
-184


Fixed submission (verdict: Accepted):
S = str(input())

L = []
K = []

for i in range(len(S)-2):
    L.append(int(S[0+i]+S[1+i]+S[2+i]))

for i in range(len(L)):

    K.append(abs(753-(L[i])))
print(min(K))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans = 1000
for i in range(len(s) - 2):
  ans = min(ans, int(s[i:i+3]))
print(ans)

Failing test case input:
40601

Expected output:
152


Actual output:
60


Fixed submission (verdict: Accepted):
s = input()
ans = 1000
for i in range(len(s) - 2):
  ans = min(ans, abs(753 - int(s[i:i+3])))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
LN = 753
ans= 754

for i in range(len(s)-2):
    tmp = int(s[i:i+3])
    print(tmp)
    if abs(LN - tmp) < ans :
        ans = abs(LN - tmp)
print(ans)

Failing test case input:
26098

Expected output:
144


Actual output:
260
609
98
144


Fixed submission (verdict: Accepted):
s = input()
LN = 753
ans= 754

for i in range(len(s)-2):
    tmp = int(s[i:i+3])
    if abs(LN - tmp) < ans :
        ans = abs(LN - tmp)
print(ans)

Problem: p03211
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    S = list(input())
    mindiff = float("inf")
    for i in range(len(S)-2):
        val = int(S[i]+S[i+1]+S[i+2])
        print(val)
        mindiff = min(mindiff, abs(753-val))
    print(mindiff)

if '__main__' == __name__:
    resolve()

Failing test case input:
38621

Expected output:
109


Actual output:
386
862
621
109


Fixed submission (verdict: Accepted):
def resolve():
    S = list(input())
    mindiff = float("inf")
    for i in range(len(S)-2):
        val = int(S[i]+S[i+1]+S[i+2])
        mindiff = min(mindiff, abs(753-val))
    print(mindiff)

if '__main__' == __name__:
    resolve()

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
print([ abs(753-int(s[i:i+3])) for i in range(len(s)-2) ])

Failing test case input:
1335

Expected output:
418


Actual output:
[620, 418]


Fixed submission (verdict: Accepted):
s = input()
print(min(abs(753-int(s[i:i+3])) for i in range(len(s)-2)))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
lenlen=len(s)
sa=100000
for i in range(0,lenlen-2):
  sasa=abs(753-int(s[i:i+3]))
  if sasa<=sa:
    sa=sasa
print(sasa)
  

Failing test case input:
53216

Expected output:
221


Actual output:
537


Fixed submission (verdict: Accepted):
s=input()
lenlen=len(s)
sa=100000
for i in range(0,lenlen-2):
  sasa=abs(753-int(s[i:i+3]))
  if sasa<=sa:
    sa=sasa
print(sa)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
num = []

for i in range(0,int(len(S)-2)):
	num.append(abs(( int(S[i:i+3]) -  753)))	
	print(num[i])
	
print(min(num))

Failing test case input:
77673

Expected output:
14


Actual output:
23
14
80
14


Fixed submission (verdict: Accepted):

S = input()
num = []

for i in range(0,int(len(S)-2)):
	num.append(abs(( int(S[i:i+3]) -  753)))	

print(min(num))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
min = 1000
for i in range(len(S)-2):
    X = S[i:i+3]
    X = int(X)
    d = abs(753 - X)
    if d < min:
        min = d
    
print(d)

Failing test case input:
518385143

Expected output:
85


Actual output:
610


Fixed submission (verdict: Accepted):
S = input()
min = 1000
for i in range(len(S)-2):
    X = S[i:i+3]
    X = int(X)
    d = abs(753 - X)
    if d < min:
        min = d
    
print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans=99999
for i in range(len(s)-2):
    
    a=abs(int(s[i:i+3])-753)
    
    if ans > a:
        ans=a
print(a)


Failing test case input:
56594

Expected output:
94


Actual output:
159


Fixed submission (verdict: Accepted):
s=input()
ans=99999
l=[]
for i in range(len(s)-2):
    
    a=abs(int(s[i:i+3])-753)
    l.append(a)
    

print(min(l))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def B():
    S = (input())
    minA = 1000000000000000
    for i in range(3, len(S)):
        if abs(int(S[i - 3:i]) - 753) < minA:
            minA = abs(int(S[i - 3:i]) - 753)
    print(minA)
B()

Failing test case input:
1514858721

Expected output:
32


Actual output:
105


Fixed submission (verdict: Accepted):

def B():
    S = input()
    minA = 1000000000000000
    for i in range(3, len(S) + 1):
        if abs(int(S[i - 3:i]) - 753) < minA:
            minA = abs(int(S[i - 3:i]) - 753)
    print(minA)
B()

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  temp = 0
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if temp <= min:
      temp = min
  print(min)


      

Failing test case input:
8271

Expected output:
74


Actual output:
482


Fixed submission (verdict: Accepted):

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 10000000000000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    tempmin = abs(comp_num - temp)
    
    if tempmin <= min:
      min = tempmin
  print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input()
min = 999 - 753
for i in range(0, len(x) - 2):
    a = x[i] + x[i + 1] + x[i + 2]
    b = abs(753 - int(a))
    if b < min:
        min = b
print(min)

Failing test case input:
12351

Expected output:
402


Actual output:
246


Fixed submission (verdict: Accepted):
x = input()
min = 0
for i in range(0, len(x) - 2):
    a = x[i] + x[i + 1] + x[i + 2]
    b = abs(753 - int(a))
    if i == 0:
        min = b
    elif b < min:
        min = b
print(min)
Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
a = []
for i in range(len(s)-2):
  a.append(abs(753 - int(s[i:i+2])))
print(min(a))
  
  

Failing test case input:
33961

Expected output:
208


Actual output:
657


Fixed submission (verdict: Accepted):
s = input()
a = []
for i in range(len(s)-2):
  a.append(abs(753 - int(s[i:i+3])))
print(min(a))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans=1000
for i in range(len(s)-3):
  ans=min(ans,abs(753-int(s[i:i+3])))
print(ans)

Failing test case input:
15829

Expected output:
76


Actual output:
171


Fixed submission (verdict: Accepted):
s=input()
ans=1000
for i in range(len(s)-2):
  ans=min(ans,abs(753-int(s[i:i+3])))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
 
ans = 1000
for i in range(len(s)-2):
  if abs(int(s[i:i+2]) - 753) < ans:
    ans = abs(int(s[i:i+2]) - 753)
 
print(ans)
               

Failing test case input:
1646883079

Expected output:
65


Actual output:
665


Fixed submission (verdict: Accepted):
s = input()
 
ans = 100000
for i in range(len(s)-2):
  if (abs(int(s[i:i+3]) - 753) < ans):
    ans = abs(int(s[i:i+3]) - 753)
 
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def q754(S: str) -> int:
    nearest = 0
    for i in range(len(S) - 3):
        a, b, c = map(int, S[i:i+3])
        d = 100*a + 10*b + c
        if abs(753-nearest) > abs(753-d):
            nearest = d
    return abs(753-nearest)


if __name__ == "__main__":
    S = input()
    ans = q754(S)
    print(ans)


Failing test case input:
15829

Expected output:
76


Actual output:
171


Fixed submission (verdict: Accepted):
def q754(S: str) -> int:
    ans = float('inf')
    for i in range(len(S)):
        d = int(S[i:i+3])
        if abs(753 - d) < ans:
            ans = abs(753-d)
    return ans


if __name__ == "__main__":
    S = input()
    ans = q754(S)
    print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())

list_aaa =[]

for i in range(len(S)-2):
    list_aaa.append(int(S[i]+S[i+1]+S[i+2]))

print(min(list_aaa,key = lambda x: abs(753-x))-753)



Failing test case input:
211616271

Expected output:
126


Actual output:
-126


Fixed submission (verdict: Accepted):
S = str(input())

list_aaa =[]

for i in range(len(S)-2):
    list_aaa.append(int(S[i]+S[i+1]+S[i+2]))

print(abs(min(list_aaa,key = lambda x: abs(753-x))-753))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
lst = []
for i in range(len(S)-3):
    a = int(''.join(S[i:i+3]))
    lst.append(a)
min = 1000
for j in lst:
    if abs(j-753) < min:
        min = abs(j-753)
print(min)

Failing test case input:
1166

Expected output:
587


Actual output:
637


Fixed submission (verdict: Accepted):
S = list(input())
lst = []
for i in range(len(S)-2):
    a = int(''.join(S[i:i+3]))
    lst.append(a)
mini = 1000
for j in lst:
    if abs(j-753) < mini:
        mini = abs(j-753)
print(mini)