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()))

atlist = []
for i in h:
    atlist.append(abs(a - (t - i * 0.006)))

print(atlist.index(min(atlist)) + 1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(int,input().split())
h = list(map(int,input().split()))

counter = 0
diff = abs(a - (t - h[0] * 0.006))

for x in h:
    average_temple = t - x * 0.006
    counter += 1
    if diff > abs(a - average_temple):
        poss = counter

print(poss)
Problem p02719 (python)

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

print(min(n%k, abs(n%k-k)))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
print(min(n%k, abs(n%k-k))
Problem p02981 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a*b <= c:
    print(a*b)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
import math

n, d = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1, n):
        dis = 0
        for k in range(d):
            dis += (x[i][k]-x[j][k])**2
        if math.sqrt(dis) % 1 == 0:
            cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a*b <= c:
    print(a*b)
    else:
        print(c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
s = a*b
if s <= c:
    print("{}".format(s))
   else:
       print("{}".format(c))
Problem p02982 (python)

Fixed submission:
import math

n, d = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1, n):
        dis = 0
        for k in range(d):
            dis += (x[i][k]-x[j][k])**2
        if math.sqrt(dis) % 1 == 0:
            cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import math

n, d = map(int, input().split())
x = [list(int, input().split()) for i in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1, n):
        for k in range(d):
            dis = 0
            dis += (x[i][k]-x[j][k])**2
            if math.sqrt(dis) % 1 == 0:
                cnt += 1
print(cnt)
Problem p03455 (python)

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

if ((a*b)%2==0):
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = int(a*b)

if(c%2=0)
   print("Even")
  else
   print("Odd")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = int(a*b)

if(c%2==0)
   print("Even")
  else
   print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input().split)

c = int(a*b)

if(c%2==0)
   print("Even")
  else
   print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input().split)

c = a*b

if(c%2==0)
   print("Even")
  else
   print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

c = a*b

if(c%2==0)
   print("Even")
  else
   print("Odd")
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

cnt = 0
while True: 
    odd_flag = False
    for i in range(N):
        if A[i] % 2 == 1:
            odd_flag = True
    if odd_flag:
        break
    for i in range(N):
        A[i] = A[i] // 2
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int, input().split()))

cnt = 0
while True: 
    odd_flag = False
    for i in range(N):
        if A[i] % 2 == 1:
            odd_flag = True
    if odd_flag:
        break
    for i in range(N):
        A[i] = A[i] // 2
    cnt += 1

print(cnt)
Problem p03644 (python)

Fixed submission:
N = int(input())
cnt_max = 0

for i in range(N):
    num = i+1
    cnt = 0
    while True :
        if num % 2 == 0:
            cnt += 1
            num /= 2
        else:
            break
    if cnt_max < cnt:
        cnt_max = cnt

print(2**cnt_max)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

cnt = 0
while True: 
    odd_flag = False
    for i in range(N):
        if A[i] % 2 == 1:
            odd_flag = True
    if odd_flag:
        break
    for i in range(N):
        A[i] = A[i] // 2
    cnt += 1

print(cnt)
Problem p03369 (python)

Fixed submission:
to = list(input())
counter = 0

if to[0] == "o":
  counter += 1
if to[1] == "o":
  counter += 1
if to[2] == "o":
  counter += 1
    
price = 700 + 100 * int(counter)

print(price)

Buggy submission (verdict: Runtime Error):
to = list(input())
counter = 0

if to[0] == "o":
  counter += 1
if to[1] == "o":
  counter += 1:
if to[2] == "o":
  counter += 1:
    
price = 700 + 100 * int(counter)

print(price)
Problem p03448 (python)

Fixed submission:
a,b,c,x = map(int,open(0).read().split())

ans = 0 
counta = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      ans = ((i*500) + (j*100) + (k*50))
      if ans == x:
        counta += 1
      else:
        pass
      
print(counta)

Buggy submission (verdict: Runtime Error):
a,b,c,x = map(int,open(0).read().split())

ans = 0 
counta = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      ans = ((i*500 + (j*100 + (k*50)
      if ans == x:
        counta += 1
      else:
        pass
      
print(counta)
Problem p03407 (python)

Fixed submission:
a,b,c=map(int,input().split())
if  (a+b)>=c:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=list(int,input().split())
if  (a+b)>=c:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=[int(input()) for i in range(3)]
if  (a+b)>=c:
    print("Yes")
else:
    print("No")
Problem p03415 (python)

Fixed submission:
a,b,c=[input() for i in range(3)]
print(a[0]+b[1]+c[2])

Buggy submission (verdict: Runtime Error):
a,b,c=[input() for i range(3)]
print(a[0]+b[1]+c[2])

Buggy submission (verdict: Runtime Error):
a,b,c=list(input().split())
print(a[0]+b[1]+c[2])
Problem p03433 (python)

Fixed submission:
n,a=[int(input()) for i in range(2)]
b=n%500
if a>=b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,a=[int(input())for i range(2)]
b=n%500
if a>=b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
b=n%500
if a>=b:
    print("Yes")
else:
    print("No")
Problem p03447 (python)

Fixed submission:
x,a,b=[int(input()) for i in range(3)]
c=x-a
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=[int(input())for i in range(3)
c=int(x-a)
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=[int(input()) for i range(3)]
c=int(x-a)
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=[int(input()) for i range(3)]
c=x-a
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=[int, input for i range(3)]
c=x-a
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
c=x-a
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
c=int(x-a)
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=list(int,input().split())
c=x-a
print(c%b)

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
c=x-a
print(c%b)
Problem p03485 (python)

Fixed submission:
import math
a,b=map(int,input().split())
c=(a+b)/2
print(math.ceil(c))

Buggy submission (verdict: Runtime Error):
import math
a=int(input())
b=int(input())
c=(a+b)/2
print(math.ceil(c))

Buggy submission (verdict: Runtime Error):
import math
a=int(input())
b=int(input())
c=(a+b)/2
print(math.ceil(c))
Problem p03547 (python)

Fixed submission:
X,Y=input().split()
if X>Y:
    print(">")
elif X<Y:
    print("<")
else:
    print("=")

Buggy submission (verdict: Runtime Error):
X=input()
Y=input()
if X>Y:
  print('>')
elif X<Y:
  print('<')
else:
  print('=')

Buggy submission (verdict: Runtime Error):
X=input()
Y=input()
if X>Y:
    print(">")
elif X<Y:
    print("<")
else:
    print("=")

Buggy submission (verdict: Runtime Error):
X=int(input(),16)
Y=int(input(),16)
if X>Y:
  print('>')
elif X<Y:
  print('<')
else:
  print('=')

Buggy submission (verdict: Runtime Error):
X=int(input(),16)
Y=int(input(),16)
if X>Y:
    print('>')
elif X<Y:
    print('<')
else:
    print('=')

Buggy submission (verdict: Runtime Error):
X=int(input(),16)
Y=int(input(),16)
if X>Y:
 print(">")
elif X<Y:
 print("<")
else:
 print("=")

Buggy submission (verdict: Runtime Error):
X=int(input(),16)
Y=int(input(),16)
if X>Y:
  print(">")
elif X<Y:
  print("<")
else:
  print("=")

Buggy submission (verdict: Runtime Error):
X=int(input(),16)
Y=int(input(),16)
if X>Y:
    print(">")
elif X<Y:
    print("<")
else:
    print("=")
Problem p03563 (python)

Fixed submission:
r=int(input())
g=int(input())
print(2*g-r)

Buggy submission (verdict: Runtime Error):
r,g=list(map(int,input().split()))
print(2*g-r)

Buggy submission (verdict: Runtime Error):
r,g=map(int,input().split())
print(2*g-r)

Buggy submission (verdict: Runtime Error):
R, G= map(int,input().split())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R,G= map(int,input().split())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R, G=map(int,input().split())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R,G=map(int,input().split())
  print(2*G-R)

Buggy submission (verdict: Runtime Error):
  R,G=map(int,input().split())
  print(2*G-R)

Buggy submission (verdict: Runtime Error):
R,G=map(int,input().split())
print(G*2-R)

Buggy submission (verdict: Runtime Error):
R,G=map(int,input().split())
print((2*G)-R)

Buggy submission (verdict: Runtime Error):
R,G=map(int,input().split())

print(2*G-R)

Buggy submission (verdict: Runtime Error):
R,G=map(int,input().split())
print(2*G-R)
Problem p03573 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b:
    print(c)
elif b==c:
  print(a)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
if a==b:
  print(int(c))
elif a==c:
  print(int(b))
elif b==c:
  print(int(a))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
 
if a == b:
  print(int(c))
elif a == c:
  print(int(b))
elif b == c:
  print(int(a))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
if a == b:
 print(int(c))
elif a == c:
 print(int(b))
elif b == c:
 print(int(a))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()

if a == b:
    print(int(c))
elif a == c:
    print(int(b))
elif b == c:
    print(int(a))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
if a == b:
    print(int(c))
elif a == c:
    print(int(b))
elif b == c:
    print(int(a))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
s1=set(a)
s2=set(b)
s3=set(c)
if s1&s2:
    print(s3)
elif s1&s3:
    print(s2)
elif s2&s3:
    print(s1)
Problem p03605 (python)

Fixed submission:
if input().find('9')>-1:
  print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if input().find("9")>-1:
  print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
if input().find('9')>-1:
  print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
if input().find("9")>-1:
  print("Yes")
 else:
    print("No")

Buggy submission (verdict: Runtime Error):
if input().find("9")>-1:
  print("Yes")
  else:
    print("No")
Problem p02732 (python)

Fixed submission:
import collections
from collections import defaultdict

n = int(input())
l = list(map(int, input().split()))

dict = defaultdict(int)
for i in l:
    dict[i]+=1

ans = 0
for v in dict.values():
    ans += int((v*(v-1)) // 2)

for k in l:
    print(ans - (dict[k] - 1))

Buggy submission (verdict: Runtime Error):
import collections
from collections import defaultdict
from math import factorial
n = int(input())
l = list(map(int, input().split()))

dict = defaultdict(int)
for i in l:
    dict[i]+=1



for j in l:
    ans = 0
    k = dict.copy()
    k[j] -= 1
    # print(k)
    for v in k.values():
        if v > 1:
            ans += int(factorial(v) / factorial(2) / factorial(v - 2))
    print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
n = int(input())
l = list(map(int, input().split()))

dict = defaultdict(int)
for i in l:
    dict[i]+=1



for j in l:
    ans = 0
    k = dict.copy()
    k[j] -= 1
    # print(k)
    for v in k.values():
        if v > 1:
            ans += int(factorial(v) / factorial(2) / factorial(v - 2))
    print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
n = int(input())
l = list(map(int, input().split()))

dict = {}
for i in l:
    if i not in dict:
        dict[i] = 1
    else:
        dict[i] += 1

for j in l:
    ans = 0
    k = dict.copy()
    k[j] -= 1
    for v in k.values():
        if v > 1:
            ans += int(factorial(v) / factorial(2) / factorial(v - 2))
    print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
n = int(input())
l = list(map(int, input().split()))

dict = {}
for i in l:
    if i not in dict:
        dict[i] = 1
    else:
        dict[i] += 1



for j in l:
    ans = 0
    k = dict.copy()
    k[j] -= 1
    # print(k)
    for v in k.values():
        if v > 1:
            ans += int(factorial(v) / factorial(2) / factorial(v - 2))
    print(ans)
Problem p02743 (python)

Fixed submission:
from decimal import Decimal
a, b, c = map(int, input().split())

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
from decimal import Decimal
a, b, c = map(int, input().split())

if Decimal(c).sqrt() - (Decimal(a).sqrt() + Decimal((b).sqrt())) > 0:
    print("Yes")
else:
    print("No")
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if (abs(a-b) <= d and abs(b-c) <= d) or abs(a-c) <= d:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if abs(a-c) <= d:
    print('Yes')
elif abs(a-b) <= d and abs(b-c) <= d:
    print('Yes')
else:
    print('No')
Problem p02614 (python)

Fixed submission:
import copy
h,w,k=map(int,input().split())
c=[[] for i in range(h)]
for i in range(h):
  S=input()
  for j in range(w):
    c[i].append(S[j])
b1=2**h
b2=2**w
cnt=0
tori=0
for i in range(b1):
  s=(str(bin(i))[2:]).zfill(h)
  for j in range(b2):
    d=[]
    d=copy.deepcopy(c)
    cnt=0
    t=(str(bin(j))[2:]).zfill(w)
    for l in range(h):
      if s[l]=='1':
        for unchi in range(w):
          d[l][unchi]='r'
    for m in range(w):
      if t[m]=='1':
        for unchi in range(h):
          d[unchi][m]='r'
    for ch in range(h):
      cnt+=d[ch].count('#')
    if cnt==k:
      tori+=1
print(tori)

Buggy submission (verdict: Runtime Error):
h,w,k=map(int,input().split())
c=[[] for i in range(h)]
for i in range(h):
  S=input()
  for j in range(w):
    c[i].append(S[j])
b1=2**h
b2=2**w
cnt=0
tori=0
for i in range(b1):
  s=(str(bin(i))[2:]).zfill(h)
  for j in range(b2):
    d=[]
    d=copy.deepcopy(c)
    cnt=0
    t=(str(bin(j))[2:]).zfill(w)
    for l in range(h):
      if s[l]=='1':
        for unchi in range(w):
          d[l][unchi]='r'
    for m in range(w):
      if t[m]=='1':
        for unchi in range(h):
          d[unchi][m]='r'
    for ch in range(h):
      cnt+=d[ch].count('#')
    if cnt==k:
      tori+=1
print(tori)
Problem p02747 (python)

Fixed submission:
import sys
s=input()
l=len(s)
if l%2==1:
  print('No')
  sys.exit()
for i in range(0,l,2):
  if s[i]=='h':
    if s[i+1]!='i':
      print('No')
      sys.exit()
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
s=input()
l=len(s)
if l==1:
  print('No')
  sys.exit()
for i in range(0,l,2):
  if s[i]=='h':
    if s[i+1]!='i':
      print('No')
      sys.exit()
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
s=input()
l=len(s)
for i in range(0,l,2):
  if s[i]=='h':
    if s[i+1]!='i':
      print('No')
      sys.exit()
  else:
    print('No')
    sys.exit()
print('Yes')
Problem p02748 (python)

Fixed submission:
a,b,m=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
lst=[]
for i in range(m):
  x,y,c=map(int,input().split())
  lst.append([x,y,c])
v=min(A)+min(B)
for i in range(m):
  V=A[lst[i][0]-1]+B[lst[i][1]-1]-lst[i][2]
  if v>V:
    v=V
print(v)

Buggy submission (verdict: Runtime Error):
a,b,m=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
lst=[]
for i in range(m):
  x,y,c=map(int,input().split())
  lst.append([x,y,c])
v=min(A)+min(B)
for i in range(m):
  V=a[A[i][0]-1]+B[lst[i][1]-1]-lst[i][2]
  if v>V:
    v=V
print(v)
Problem p02803 (python)

Fixed submission:
from collections import deque

h,w=map(int,input().split())
S=[]
pos=[]
for i in range(h):
  l=input()
  L=[]
  for j in range(w):
    if l[j]=='.':
      L.append('.')
      pos.append((i,j))
    else:
      L.append('#')
  S.append(L)
Maze=[[float('inf')]*w for i in range(h)]
def bfs(h,w,S,Maze,sy,sx):
    maze=Maze
    maze=[[float('inf')]*w for i in range(h)]
    maze[sy][sx]=0
    que=deque([[sy,sx]])
    while que: #キューの中に入っているということはまだ調べる余地有り
        y,x=que.popleft()
        for (i,j) in [(1,0),(0,1),(-1,0),(0,-1)]:
            nexty,nextx=y+i,x+j
            if 0<=nexty<=h-1 and 0<=nextx<=w-1:
              dist=maze[nexty][nextx]
              if S[nexty][nextx]!='#':
                if dist>maze[y][x]+1: #今の経路から(nexty,nextx)に進む方が距離が短くなるなら
                    maze[nexty][nextx]=maze[y][x]+1
                    que.append([nexty,nextx])
    m=0
    for i in range(h):
      for j in range(w):
        if maze[i][j]!=float('inf'):
          if m<maze[i][j]:
            m=maze[i][j]
            
    return m
        
M=0
for (sy,sx) in pos:
  if bfs(h,w,S,Maze,sy,sx)>M:
    M=bfs(h,w,S,Maze,sy,sx)

print(M)

Buggy submission (verdict: Runtime Error):
from collections import deque

h,w=map(int,input().split())
S=[]
pos=[]
for i in range(h):
  l=input()
  L=[]
  for j in range(w):
    if l[j]=='.':
      L.append('.')
      pos.append((i,j))
    else:
      L.append('#')
  S.append(L)
Maze=[[float('inf')]*w for i in range(h)]
def bfs(h,w,S,maze,sy,sx,gy,gx):
    maze=Maze
    maze=[[float('inf')]*w for i in range(h)]
    maze[sy][sx]=0
    que=deque([[sy,sx]])
    while que: #キューの中に入っているということはまだ調べる余地有り
        y,x=que.popleft()
        for (i,j) in [(1,0),(0,1),(-1,0),(0,-1)]:
            nexty,nextx=y+i,x+j
            if 0<=nexty<=h-1 and 0<=nextx<=w-1:
              dist=maze[nexty][nextx]
              if S[nexty][nextx]!='#':
                if dist>maze[y][x]+1: #今の経路から(nexty,nextx)に進む方が距離が短くなるなら
                    maze[nexty][nextx]=maze[y][x]+1
                    que.append([nexty,nextx])

    return maze[gy][gx]
M=0
for (sy,sx) in pos:
  for (gy,gx) in pos:
    if bfs(h,w,S,maze,sy,sx,gy,gx)>M:
      M=bfs(h,w,S,maze,sy,sx,gy,gx)

print(M)
Problem p02806 (python)

Fixed submission:
n=int(input())
lst=[]
for i in range(n):
  s,t=input().split()
  T=int(t)
  lst.append([s,T])
x=input()
for j in range(n):
  if lst[j][0]==x:
    k=j
    break
totl=0
for j in range(k+1,n):
  totl+=lst[j][1]
print(totl)

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n):
  s,t=input().split()
  T=int(t)
  lst.append([s,t])
x=input()
for j in range(n):
  if lst[j][0]==x:
    k=j
    break
totl=0
for j in range(k+1,n):
  totl+=lst[j][1]
print(totl)
Problem p02848 (python)

Fixed submission:
n=int(input())
s=input()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
S=list(s)
for i in range(len(S)):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%(len(lst))]
t=''.join(S)
print(t)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
S=list(s)
for i in range(len(list(s))):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%len(lst)]
t=''.join(S)
print(t)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
S=list(s)
for i in range(len(s)):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%len(lst)]
t=''.join(S)
print(t)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
S=list(s)
for i in range(n):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%len(lst)]
t=''.join(S)
print(t)
Problem p02899 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
a=[]
for i in range(n):
  a.append([i+1,A[i]])
b=sorted(a,key=lambda x:x[1])
lst=[]
for k in range(n):
  lst.append(b[k][0])
print(*lst)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
a=[]
for i in range(n):
  a.append([i+1])
for j in range(n):
  a[j].append(A[j])
a.sort(key=lambda x:x[1])
lst=[]
for k in range(n):
  lst.append(a[k][0])
print(''.join(lst))
Problem p02900 (python)

Fixed submission:
a,b=map(int,input().split())
if a<b:
  a,b=b,a
def gcd(m,n):
  while n!=0:
    m,n=n,m%n
  return m
def div(l):
  division=[]
  for i in range(1,int(l**0.5)+1):
    if l%i==0:
      division.append(i)
      if i!=(l//i):
        division.append(l//i)
  return division
lst=div(gcd(a,b))
cnt=1
for i in range(len(lst)):
  if len(div(lst[i]))==2:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a<b:
  a,b=b,a
def gcd(m,n):
  while n!=0:
    m,n=n,m%n
  return m
def div(n):
  division=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      division.append(i)
      if i!=(n//i):
        div.append(n//i)
  return division
lst=div(gcd(a,b))
cnt=1
for i in range((len(lst)+1)//2):
  if len(div(lst[i]))==2:
    cnt+=1
print(cnt)
Problem p02923 (python)

Fixed submission:
import sys
n=int(input())
h=list(map(int,input().split()))
cnt=0
lst=[]
if n==1:
  print(0)
  sys.exit()
for i in range(n-1):
  if h[i+1]<=h[i]:
    cnt+=1
    if i==(n-2):
      lst.append(cnt)
  else:
    lst.append(cnt)
    cnt=0
print(max(lst))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
cnt=0
lst=[]
for i in range(n-1):
  if h[i+1]<=h[i]:
    cnt+=1
    if i==n-1:
      lst.append(cnt)
  else:
    lst.append(cnt)
    cnt=0
print(max(lst))
Problem p02946 (python)

Fixed submission:
k,x=map(int,input().split())
lst=[]
for i in range(1,2*k):
  lst.append(x-k+i)
for j in range(len(lst)):
  print(lst[j])

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
lst=[]
for i in range(1,2*k):
  lst.append(x-k+i)
lst_2=''.join(lst)
print(lst_2)

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
lst=[]
for i in range(1,2*k):
  lst.append(x-k+i)
lst_2=lst.split('')
print(lst_2)

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
lst=[]
for i in range(1,2*k):
  lst.append(x-k+i)
lst_2=''.split(lst)
print(lst_2)

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
lst=[]
for i in range(1,k):
  lst.append(x-k+i)
lst.append(x)
for j in range(1,k):
  lst.append(x+j)
print(''.join(lst))

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
lst=[x]
for i in range(1,k):
  lst.append(x-i)
  lst.append(x+i)
print(','.join(lst))
Problem p02947 (python)

Fixed submission:
n=int(input())
d={}
totl=0

for i in range(n):
  s=list(input())
  s.sort()
  t=''.join(s)
  
  if t in d:
    d[t]+=1
  else:
    d[t]=1

for t in d:
  totl+=d[t]*(d[t]-1)/2

print(int(totl))

Buggy submission (verdict: Runtime Error):
n=int(input())
T=[]
for i in range(n):
  T.append(tuple(sorted(input().split())))
U=set(T)
cnt=[]
for j in range(len(U)):
  cnt.append(T.count(U[j]))
conb=[]
for k in range(len(U)):
  conb.append(cnt[k]*(cnt[k]-1)/2)
print(sum(conb))

Buggy submission (verdict: Runtime Error):
n=int(input())
S=[]
for i in range(n):
  S.append(sorted(input().split()))
print(n-len(set(S)))