Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
def abs(k,l):
  if k>l:
    return k-l
  else:
    return l-k  
b=20000313
cnt=0
for i in range(n):
  if b>abs(a,t-0.006*h[i]):
    b=abs(a,t-0.006*h[i])
    cnt=i
  else:
    b=b
    cnt=cnt
print(cnt+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,inout().split())
h=list(map(int,input().split()))
def abs(k,l):
  if k>l:
    return k-l
  else:
    return l-k  
b=20000313
cnt=0
for i in range(n):
  if b>abs(a,t-0.006*h[i]):
    b=t-0.006*h[i]
    cnt=i
  else:
    b=b
    cnt=cnt
print(cnt+1)
Problem p03239 (python)

Fixed submission:
n,t=map(int,input().split())
a=[]
b=[]
for i in range(n):
  s,u=map(int,input().split())
  a.append(s)
  b.append(u)
c=[]
for j in range(n):
  if b[j]>t:
    c.append(1001)
  else:
    c.append(a[j])
if c==[1001]*n:
  print('TLE')
else:
  print(min(c))

Buggy submission (verdict: Runtime Error):
n,t=map(int,input().split())
a=[]
b=[]
for i in range(n):
  a.append(int(input()))
  b.append(int(input()))
c=[]
for j in range(n):
  if b[j]>t:
    c.append(1001)
  else:
    c.append(a[j])
if c==[1001]*n:
  print('TLE')
else:
  print(min(c))
Problem p03240 (python)

Fixed submission:
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])+abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==lst[l][2] for l in range(n)):
          print(j,k,H)
          sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])-abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==h[l] for l in range(n)):
          print([j,k,H])
          sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
def pita(a,b,c,d):
  return abs(a-b)+abs(c-d)
hm=float'inf'
for l in range(n):
  for j in range(101):
    for k in range(101):
      if lst[l][2]-pita(lst[l][0],j,lst[l][1],k)<=0:
        hm=min(hm,pita(lst[l][0],j,lst[l][1],k))
for l in range(hm+1):
  for j in range(101):
    for k in range(101):
      if lst[l][2]-pita(lst[l][0],j,lst[l][1],k)==0:
        print(j,k,lst[l][2])
        sys.exit()
Problem p03243 (python)

Fixed submission:
n=input()
m=n[0]
for i in range(len(n)-1):
  m+=n[0]
if int(n)>int(m):
  if n[0]!=str(9):
    a=str(int(n[0])+1)
    for j in range(len(n)-1):
      a+=str(int(n[0])+1)
    print(a)
  else:
    b=str(1)
    for k in range(len(n)):
      b+=str(1)
    print(b)
else:
  print(m)

Buggy submission (verdict: Runtime Error):
n=input()
m=n[0]
for i in range(len(n)-1):
  m+=n[0]
if int(n)>int(m):
  if n[0]!=9:
    a=str(int(n[0]+1))
    for j in range(len(n)-1):
      a+=str(int(n[0]+1))
    print(a)
  else:
    b=str(1)
    for k in range(len(n)):
      b+=str(1)
    print(b)
else:
  print(m)
Problem p03244 (python)

Fixed submission:
import collections,sys
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,2):
  a.append(v[i-1])
  b.append(v[i])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
if len(set(v))==1:
  print(n//2)
  sys.exit()
if A!=B:
  for i in range(n//2):
    if a[i]!=A:
      cnt+=1
  for j in range(n//2):
    if b[j]!=B:
      cnt+=1
  print(cnt)
  sys.exit()
if A==B:
  totla=0
  A_=int(C[1][0]) if len(set(a))!=1 else A
  for i in range(n//2):
    if a[i]!=A_:
      totla+=1
  for j in range(n//2):
    if b[j]!=B:
      totla+=1
  totlb=0
  B_=int(D[1][0]) if len(set(b))!=1 else B
  for i in range(n//2):
    if a[i]!=A:
      totlb+=1
  for j in range(n//2):
    if b[j]!=B_:
      totlb+=1
  print(min(totla,totlb))
  sys.exit()

Buggy submission (verdict: Runtime Error):
import collections,sys
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,2):
  a.append(v[i-1])
  b.append(v[i])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
if A!=B:
  for i in range(n//2):
    if a[i]!=A:
      cnt+=1
  for j in range(n//2):
    if b[j]!=B:
      cnt+=1
  print(cnt)
  sys.exit()
if A==B:
  totla=0
  A_=int(C[1][0])
  for i in range(n//2):
    if a[i]!=A_:
      totla+=1
  for j in range(n//2):
    if b[j]!=B:
      totla+=1
  totlb=0
  B_=int(D[1][0])
  for i in range(n//2):
    if a[i]!=A:
      totlb+=1
  for j in range(n//2):
    if b[j]!=B_:
      totlb+=1
  print(min(totla,totlb))
  sys.exit()

Buggy submission (verdict: Runtime Error):
import collections
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,1):
  a.append(v[i])
  b.append(v[i+1])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
for i in range(n):
  if a[i]!=A:
    cnt+=1
for j in range(n):
  if b[j]!=B:
    cnt+=1
print(cnt)
Problem p03251 (python)

Fixed submission:
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and all(x[i]<z for i in range(n)) and all(y[j]>=z for j in range(m)):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and all(x[i]<z*(-1) for i in range(n)) and all(y[j]>=z*(-1) for j in range(m)):
    print('No War')
    sys.exit()
print('War')

Buggy submission (verdict: Runtime Error):
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and x[i]<z for i in range(n) and y[j]>=z for j in range(m):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and x[i]<z*(-1) for i in range(n) and y[j]>=z*(-1) for j in range(m):
    print('No War')
    sys.exit()
print('War')

Buggy submission (verdict: Runtime Error):
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<Y and x[i]<z for i in range(n) and y[j]>=z for j in range(m):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<Y and x[i]<z*(-1) for i in range(n) and y[j]>=z*(-1) for j in range(m):
    print('No War')
    sys.exit()
print('War')
Problem p03261 (python)

Fixed submission:
import sys
n=int(input())
w=[input() for i in range(n)]
if all(w[j][len(w[j])-1]==w[j+1][0] for j in range(n-1)) and len(set(w))==n:
  print('Yes')
  sys.exit()
print('No')

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
w=[input() for i in range(n)]
if all(w[j][len(w[j])]==w[j+1][0] for j in range(n-1)) and len(set(w))==n:
  print('Yes')
  sys.exit()
print('No')
Problem p03262 (python)

Fixed submission:
import fractions
import sys
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
if n==1:
  print(abs(x[0]-X))
  sys.exit()
for i in range(n):
  y.append(abs(x[i]-X))
G=100000000000
for j in range(n-1):
  G=min(G,fractions.gcd(y[j],y[j+1]))
print(G)

Buggy submission (verdict: Runtime Error):
import fractions,sys
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
if n==1:
  print(abs(x[0]-X))
  sys.exit()
for i in range(n):
  y.append(abs(x[i]-X))
G=float'inf'
for j in range(n-1):
  G=min(G,fractions.gcd(y[j],y[j+1]))
print(G)

Buggy submission (verdict: Runtime Error):
import fractions
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in range(n):
  y.append(abs(x[i]-X))
G=float'inf'
for j in range(n-1):
  G=min(G,fractions.gcd(y[j],y[j+1]))
print(G)

Buggy submission (verdict: Runtime Error):
import fractions
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in range(n):
  y.append(abs(x[i]-X))
G=float'inf'
for j in range(n):
  G=min(G,fractions.gcd(y[j],y[j+1]))
print(G)

Buggy submission (verdict: Runtime Error):
import fractions
n,X=map(int,input().split())
x=list(map(int,input().split()))
for i in range(n):
  x[i]=x[i]-X
G=float'inf'
for j in range(n):
  G=min(G,fractions.gcd(x[j],x[j+1]))
print(G)

Buggy submission (verdict: Runtime Error):
import fractions
n,X=map(int,input().split())
x=list(map(int,input().split()))
for i in range(n):
  x[i]=x[i]-X
print(fractions.gcd(*x))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in range(n):
  y.append(abs(x[i]-X))
def GCD(*numbers):
  return reduce(math.gcd,numbers)
print(GCD(*y))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in range(n):
  y.append(abs(x[i]-X))
def gcd(*numbers):
  return reduce(math.gcd,numbers)
print(gcd(*y))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in range(n):
  y.append(abs(x[i]-X))
def gcd(*numbers):
  return reduce(math.gcd,numbers)
print(gcd(y))

Buggy submission (verdict: Runtime Error):
from functools import reduce
import math
n,X=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in range(n):
  y.append(x[i]-X)
def gcd(*numbers):
  return reduce(math.gcd,numbers)
print(gcd(y))

Buggy submission (verdict: Runtime Error):
from functools import reduce
import math
n,X=map(int,input().split())
x=list(map(int,input().split()))
for i in range(n):
  x[i]=x[i]-X
def gcd(*numbers):
  return reduce(math.gcd,numbers)
print(gcd(x))
Problem p03274 (python)

Fixed submission:
n,k=map(int,input().split())
x=list(map(int,input().split()))
time=100000000000
for i in range(n-k+1):
  l=x[i]
  r=x[i+k-1]
  time=min(time,abs(l)+r-l,abs(r)+r-l)
print(time)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
x=list(map(int,input().split()))
time=float'inf'
for i in range(n-k+1):
  l=x[i]
  r=x[i+k-1]
  time=min(time,abs(l)+r-l,abs(r)+r-l)
print(time)
Problem p03281 (python)

Fixed submission:
def yakusu(m):
  cnt=1
  for i in range(1,(m//2)+1):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and j%2!=0:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
def yakusu(m):
  cnt=0
  for i in range(m//2):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and n%2!=0:
    ans+=1
print(ans)
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())
if s[0]!='1':
  print(s[0])
else:
  cnt=0
  idx=0
  for i in range(len(s)):
    if s[i]=='1':
      cnt+=1 
    else:
      idx=i
      break
  if cnt>k-1:
    print('1')
  else:
    print(s[idx])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
if s[0]!='1':
  print(s[0])
else:
  cnt=0
  for i in range(len(s)):
    if s[i]=='1':
      cnt+=1 
    else:
      idx=i
      break
  if cnt>k:
    print('1')
  else:
    print(s[idx])
Problem p03294 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

m=0
for i in range(n):
  m+=a[i]-1

print(m)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
a=list(map(int,input().split()))
A=np.array(a)
g=np.gcd.reduce(A)
m=1
for i in range(n):
  m*=a[i]
l=m//g
print(l+1)

Buggy submission (verdict: Runtime Error):
import numpy
n=int(input())
a=list(map(int,input().split()))
A=np.array(a)
g=np.gcd.reduce(A)
m=1
for i in range(n):
  m*=a[i]
l=m//g
print(l+1)

Buggy submission (verdict: Runtime Error):
import fractions
n=int(input())
a=list(map(int,input().split()))
g=fractions.gcd(*a)
m=1
for i in range(n):
  m*=a[i]
l=m//g
print(l+1)
Problem p03309 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
A=[]
for i in range(n):
  A.append(a[i]-i-1)
A.sort()
b=0
c=0
ans=0
Ans=0
if n%2!=0:
  b=n//2
  for i in range(n):
    ans+=abs(A[i]-A[b])
  print(ans)
else:
  b=n//2
  c=(n//2)-1
  for i in range(n):
    ans+=abs(A[i]-A[b])
    Ans+=abs(A[i]-A[c])
  print(min(ans,Ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
A=[]
for i in range(n):
  A.append(a[i]-i-1)
A.sort()
b=0
c=0
ans=0
Ans=0
if n%!=0:
  b=n//2
  for i in range(n):
    ans+=abs(A[i]-b)
  print(ans)
else:
  b=n//2
  c=(n//2)-1
  for i in range(n):
    ans+=abs(A[i]-b)
    Ans+=abs(A[i]-c)
  print(min(ans,Ans))
Problem p03325 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(1,x**(0.5)+1):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return list(set(lst))    
for i in range(n):
  y=yakusu(a[i])
  for j in range(len(y)):
    while y[j]%2==0:
      y[j]==y[j]//2
      m+=1
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(1,x**(0.5)+1):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return list(set(lst))    
for i in range(n):
  for j in range(len(yakusu(a[i]))):
    while (yakusu(a[i]))[j]%2==0:
      (yakusu(a[i]))[j]==(yakusu(a[i]))[j]//2
      m+=1
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(1,x**(0.5)+1):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  for j in range(len(yakusu(a[i]))):
    while yakusu(a[i])[j]%2==0:
      yakusu(a[i])[j]==yakusu(a[i])[j]//2
      m+=1
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(x**(0.5)):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  for j in range(len(yakusu(a[i]))):
    while yakusu(a[i])[j]%2==0:
      yakusu(a[i])[j]==yakusu(a[i])[j]//2
      m+=1
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(x**(0.5)):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  for j in len(yakusu(a[i])):
    while yakusu(a[i])[j]%2==0:
      yakusu(a[i])[j]==yakusu(a[i])[j]//2
      m+=1
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(x**(0.5)):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  Lst=yakusu(a[i])
  for j in len(Lst):
    while a[j]%2==0:
      a[j]==a[j]//2
      m+=1
print(m)
Problem p03401 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
list1=[abs(a[0])]*(n+1)
list2=[abs(a[n-1])]*(n+1)
for i in range(n-1):
  list1[i+1]=list1[i]+abs(a[i+1]-a[i])
  list2[i+1]=list2[i]+abs(a[n-i-1]-a[n-i-2])
list1[n]=abs(a[n-1])
list2[n]=abs(a[0])
print(list2[n-2]+abs(a[1]))
for i in range(1,n-1):
  print(list2[n-2-i]+list1[i-1]+abs(a[i+1]-a[i-1]))
print(list1[n-2]+abs(a[n-2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
lst1=[0]*(n+2)
lst2=[0]*(n+2)
lst1[1]=abs(a[0])
lst2[1]=abs(a[n-1])
for i in range(1,n):
  lst1[i+1]=lst1[i]+abs(a[i]-a[i-1])
  lst2[i+1]=lst2[i]+abs(a[n-i]-a[n-i-1])
lst1[n+1]=lst1[n]+abs(a[n-1])
lst2[n+1]=lst2[n]+abs(a[0])
print(lst2[n-1]+abs([1]))
for i in range(1,n-1):
  print(lst1[i]+lst2[n-i]+abs(a[i+1]-a[i-1]))
print(lst1[n-1]+abs([n-2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
lst1=[0]*(n+2)
lst2=[0]*(n+2)
lst1[1]=abs(a[0])
lst2[1]=abs(a[n-1])
for i in range(1,n):
  lst1[i+1]=lst1[i]+abs(a[i]-a[i-1])
  lst2[i+1]=lst2[i]+abs(a[n-i]-a[n-i-1])
lst1[n+1]=lst[n]+abs(a[n-1])
lst2[n+1]=lst[n]+abs(a[0])
for i in range(n):
  print(lst1[i]+lst2[n-i]+abs(a[min(n-1,i+1)]-a[max(0,i-1)]))
Problem p03449 (python)

Fixed submission:
n=int(input())
a=[]
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.append(b)
a.append(c)
d=[]
cnd=a[0][0]
for i in range(n):
  for j in range(n):
    if i>j:
      cnd+=a[0][j]
    else:
      cnd+=a[1][j]
  d.append(cnd)
  cnd=a[0][min(n-1,i+1)]
print(max(d))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.append(b)
a.append(c)
d=[]
cnd=a[0][0]
for i in range(n):
  for j in range(n):
    if i<j+1:
      cnd+=a[0][j]
    else:
      cnd+=a[1][j]
  d.append(cnd)
  cnd=a[0][i+1]
print(max(d))
Problem p03457 (python)

Fixed submission:
import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
if (abs(lst[0][1])+abs(lst[0][2]))%2==lst[0][0]%2:
  if abs(lst[0][1])+abs(lst[0][2])<=lst[0][0]:
    pass
  else:
    print('No')
    sys.exit()
else:
  print('No')
  sys.exit()

for j in range(n-1):
  if (abs(lst[j][1]-lst[j+1][1])+abs(lst[j][2]-lst[j+1][2]))%2==(lst[j+1][0]-lst[j][0])%2:
    if abs(lst[j][1]-lst[j+1][1])+abs(lst[j][2]-lst[j+1][2])<=(lst[j+1][0]-lst[j][0]):
      pass
    else:
      print('No')
      sys.exit()
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
lst.sort(reverse=False,lambda x:x[0])
for j in range(n-1):
  if abs(lst[j][1]-lst[j+1][1])==1:
    if lst[j][2]==lst[j+1][2]:
      pass
    else:
      print('No')
      sys.exit()
  if abs(lst[j][2]-lst[j+1][2])==1:
    if lst[j][1]==lst[j+1][1]:
      pass
    else:
      print('No')
      sys.exit()    
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
lst.sort(lambda x:x[0])
for j in range(n-1):
  if (abs(lst[j][1]-lst[j+1][1])==1) or (abs(lst[j][2]-lst[j+1][2])==1) :
    pass 
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
lst.sort(lambda x:x[0])
for j in range(n-1):
  if abs(lst[j][1]-lst[j+1][1])==1 or abs(lst[j][2]-lst[j+1][2])==1:
    lst=lst  
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
lst.sort(lambda x:x[0])
for j in range(n-1):
  if abs(lst[j][1]-lst[j+1][1])==1 or abs(lst[j][2]-lst[j+1][2])==1:
    pass
  else:
    print('No')
    sys.exit()
print('Yes')
Problem p03471 (python)

Fixed submission:
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
      if i*10000+j*5000+(n-i-j)*1000==y:
        print(*[i,j,n-i-j])
        sys.exit()
print(*[-1,-1,-1])

Buggy submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
      if i*10000+j*5000+(n-i-j)*1000==y:
        print(i j n-i-j)
        sys.exit()
print(-1 -1 -1)

Buggy submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    for k in range(n-i-j+1):
      if i*10000+j*5000+k*1000==y:
        print(i j k)
        sys.exit()
print(-1 -1 -1)

Buggy submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-j+1):
    for k in range(n-i-j+1):
      if i*10000+j*5000+k*1000==y:
        print(i j k)
        sys.exit()
print(-1 -1 -1)
Problem p03475 (python)

Fixed submission:
n=int(input())
lst=[]
for i in range(n-1):
  c,s,f=map(int,input().split())
  lst.append([c,s,f])
for j in range(n-1):
  time=lst[j][0]+lst[j][1]
  ind=j
  for k in range(n-j-2):
    if time<=lst[ind+1][1] :
      time=lst[ind+1][0]+lst[ind+1][1]
      ind+=1
    elif (time-lst[ind+1][1])%lst[ind+1][2]==0:
      time+=lst[ind+1][0]
      ind+=1
    else:
      time+=lst[ind+1][0]+lst[ind+1][2]-(time-lst[ind+1][1])%lst[ind+1][2]
      ind+=1
  print(time)
print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n):
  c,s,f=map(int,input().split())
  lst.append([c,s,f])
for j in range(n-1):
  time=lst[j][0]+lst[j][1]
  ind=j
  for k in range(n-j-2):
    if time<=lst[ind+1][1] :
      time=lst[ind+1][0]+lst[ind+1][1]
      ind+=1
    elif (time-lst[ind+1][1])%lst[ind+1][2]==0:
      time+=lst[ind+1][2]
      ind+=1
    else:
      time+=lst[ind+1][2]+lst[ind+1][2]-(time-lst[ind+1][1])%lst[ind+1][2]
      ind+=1
  print(time)
print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n):
  c,s,f=map(int,input().split())
  lst.append([c,s,f])
time=0
ind=0
for j in range(n-1):
  time=lst[j][0]+lst[j][1]
  ind=j
  for k in range(n-j-1):
    if time<=lst[ind+1][1] :
      time=lst[ind+1][0]+lst[ind+1][1]
      ind+=1
    elif (time-lst[ind+1][1])%lst[ind+1][2]==0:
      time+=lst[ind+1][2]
      ind+=1
    else:
      time+=lst[ind+1][2]+lst[ind+1][2]-(time-lst[ind+1][1])%lst[ind+1][2]
      ind+=1
  print(time)
print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n):
  c,s,f=map(int,input().split())
  lst.append([c,s,f])
for j in range(n-1):
  time=lst[j][0]+lst[j][1]
  ind=j
  for k in range(n-j-1):
    if time<=lst[ind+1][1] :
      time=lst[ind+1][0]+lst[ind+1][1]
      ind+=1
    elif (time-lst[ind+1][1])%lst[ind+1][2]==0:
      time+=lst[ind+1][2]
      ind+=1
    else:
      time+=lst[ind+1][2]+lst[ind+1][2]-(time-lst[ind+1][1])%lst[ind+1][2]
      ind+=1
  print(time)
print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n):
  c,s,f=map(int,input().split())
  lst.append([c,s,f])
for j in range(n-1):
  time=lst[j][0]+lst[j][1]
  for k in range(n-j-1):
    if time<=lst[j+1][1] :
      time=lst[j+1][0]+lst[j+1][1]
    elif (time-lst[j+1][1])%lst[j+1][2]==0:
      time+=lst[j+1][2]
    else:
      time+=lst[j+1][2]+lst[j+1][2]-(time-lst[j+1][1])%lst[j+1][2]
  print(time)
print(0)
Problem p03495 (python)

Fixed submission:
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=Counter(a).values()
d=list(b)
d.sort()
c=set(a)
num=0
for i in range(len(c)-k):
  num+=d[i]
print(num)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=Counter(a).values()
b.sort()
c=set(a)
num=0
for i in range(len(c)-k):
  num+=b[i]
print(num)
Problem p03549 (python)

Fixed submission:
n,m=map(int,input().split())
print((1800*m+100*n)*(2**m))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print((1800*m+100*n)*2(**m))
Problem p03607 (python)

Fixed submission:
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
from collections import Counter
b=list(Counter(a).values())
cnt=0
for i in range(len(b)):
  if b[i]%2==1:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
from collentions import Counter
b=list(Counter(a).values())
cnt=0
for i in range(len(b)):
  if b[i]%2==0:
    cnt+=1
print(cnt)