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

Fixed submission:
S = input()
ans = 0
tmp = 0
for i in range(len(S)):
  if S[i] == 'W':
    ans+=i-tmp
    tmp+=1
print(ans)

Buggy submission (verdict: Runtime Error):
S = str(input())
count = 0;
for i in range(100000)
  count=count+S.count('BW');
  S = S.replace('BW','WB');
  if 'BW' not in S:break;
print(count)
Problem p03238 (python)

Fixed submission:
N = int(input())
if N==1: 
 print('Hello World')
else:
 A = int(input())
 B = int(input())
 print(A + B)

Buggy submission (verdict: Runtime Error):
N , T  = map(int,input().split())
tmp_a = 1001
result = 1001
count = 1
while count < N+1:
 a,b = map(int,input().split())
 if b < T and a < tmp_a:
  result = count
  tmp_a = a
 count = count + 1
if result == 1001:
 print('TLE')
else:
 print(result)

Buggy submission (verdict: Runtime Error):
N , T  = map(int,input().split())
tmp_a = 1000
result = 1001
while N > 0:
 a,b = map(int,input().split())
 if b < T & a < tmp_a:
  result = N
  tmp_a = a
 N = N -1
if result == 1001:
 print('TLE')
else:
 print(result)
Problem p03241 (python)

Fixed submission:
def calc():
 N,M = map(int,input().split())
 for gcd in range(M // N,0,-1):
  if M % gcd == 0:
   break
 return(gcd)
print(calc())

Buggy submission (verdict: Runtime Error):
def calc()
N,M = map(int,input().split())
for gcd in range(M // N,0,-1):
 if M % gcd == 0:
  return(gcd)

print(calc())
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
result = ''
for i in S[:K]:
  if i != '1':
    result = i
    break
else:
    result = '1'

print(result)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
count = 0
for i in range(len(S)):
  if S[i] == '1':
    count = count + 1
  else:
    break

if count<K and count>0:
  print(S[1])
elif count>=K:
  print(S[count])
else:
  print(S[0])

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
count = 0
for i in range(len(S)):
  if S[i] == '1':
    count = count + 1
  else:
    break

if count > 0:
  print(S[count])
else:
  print(S[0])
Problem p03284 (python)

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

if N%K == 0:
  print('0')
else:
  print('1')

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%4 == 0 or N%7 == 0 or N%11 == 0 or (N%4)%7 == 0 or (N%7)%4 == 0 or (N%11)%4 == 0 or (N%11)%7 == 0:
  print('Yes')
else:
  print('No')
Problem p03386 (python)

Fixed submission:
A,B,K = map(int,input().split())
for i in range(A,min(A+K,B+1)):
  print(i)
for i in range(max(B-K+1,A+K),B+1):
  print(i)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
for i in range(A,min(A+K,b+1)):
  print(i)
for i in range(max(B-K+1,A+K),B+1):
  print(i)
Problem p03424 (python)

Fixed submission:
N = int(input())
S = list(map(str,input().split()))
print('Three') if len(set(S)) == 3 else print('Four')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split()))
print(len(set(S)))
Problem p03502 (python)

Fixed submission:
N = list(input())
f_N = 0
for i in N:
  f_N += int(i)
print('Yes') if int(''.join(N))%f_N == 0 else print('No')

Buggy submission (verdict: Runtime Error):
N = list(input())
f_N = 0
[f_N += int(i) for i in N]
print('Yes') if int(''.join(N))%f_N == 0 else print('No')
Problem p03607 (python)

Fixed submission:
import collections
N = int(input())
a = [int(input()) for i in range(N)]
c = collections.Counter(a)
tmp = list(c.values())
count=0
for i in range(len(tmp)):
  if tmp[i]%2!=0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
a = [int(input()) for i in range(N)]
c = collections.Counter(a)
tmp = c.values()
count=0
for i in range(len(tmp)):
  if tmp[i]%2!=0:
    count+=1
print(count)
Problem p03671 (python)

Fixed submission:
abc = sorted(list(map(int,input().split())))
print(sum(abc[:2]))

Buggy submission (verdict: Runtime Error):
abc = sorted(list(map(int,input().split())))
print(sum[:2])
Problem p03711 (python)

Fixed submission:
x,y = map(int,input().split())
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
g3 = [2]
print('Yes') if (x in g1 and y in g1) or (x in g2 and y in g2) or (x in g3 and y in g3) else print('No')

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
g3 = [2]
print('Yes') if (x and y) in g1 or (x and y) in g2 or (x and y) in g3 print('No')
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())
if A > B:
  print('GREATER')
elif A < B:
  print('LESS')
else:
  print('EQUAL')

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if A > B:
  print('GREATER')
elif B < A:
  print('LESS')
else:
  print('EQUAL')
Problem p02705 (python)

Fixed submission:
def i1str():
    return input()


def istrs(n=None):
    if n is None:
        return input().split()
    a = []
    for _ in range(n):
        a.append(istrs())
    return a


def i1num():
    return int(input())


def inums(n=None):
    if n is None:
        return list(map(int, input().split()))
    a = []
    for _ in range(n):
        a.append(inums())
    return a


def ostrs(l, sp=" "):
    print(sp.join(l))


def onums(l, sp=" "):
    print(sp.join(map(str, l)))


def solve(n):
    pi = 3.14159
    return 2*pi*n


if __name__ == "__main__":
    n = i1num()
    print(solve(n))

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


def i1str():
    return input()


def istrs(n=None):
    if n is None:
        return input().split()
    a = []
    for _ in range(n):
        a.append(istrs())
    return a


def i1num():
    return int(input())


def inums(n=None):
    if n is None:
        return list(map(int, input().split()))
    a = []
    for _ in range(n):
        a.append(inums())
    return a


def ostrs(l, sp=" "):
    print(sp.join(l))


def onums(l, sp=" "):
    print(sp.join(map(str, l)))


def solve(n, a):
    cnt = Counter(a)
    for i in range(n):
        print(cnt[i+1])


if __name__ == "__main__":
    n = i1num()
    a = inums()
    solve(n, a)
Problem p02708 (python)

Fixed submission:
def i1str():
    return input()


def istrs(n=None):
    if n is None:
        return input().split()
    a = []
    for _ in range(n):
        a.append(istrs())
    return a


def i1num():
    return int(input())


def inums(n=None):
    if n is None:
        return list(map(int, input().split()))
    a = []
    for _ in range(n):
        a.append(inums())
    return a


def ostrs(l, sp=" "):
    print(sp.join(l))


def onums(l, sp=" "):
    print(sp.join(map(str, l)))


def solve(n, k):
    m = 10**9+7
    res = 0
    for i in range(k, n+2):
        res += n*i - i*i + i + 1
    return res % m


if __name__ == "__main__":
    n, k = inums()
    print(solve(n, k))

Buggy submission (verdict: Runtime Error):
def i1str():
    return input()


def istrs(n=None):
    if n is None:
        return input().split()
    a = []
    for _ in range(n):
        a.append(istrs())
    return a


def i1num():
    return int(input())


def inums(n=None):
    if n is None:
        return list(map(int, input().split()))
    a = []
    for _ in range(n):
        a.append(inums())
    return a


def ostrs(l, sp=" "):
    print(sp.join(l))


def onums(l, sp=" "):
    print(sp.join(map(str, l)))


def solve(n, aii):
    dp = [[0 for _ in range(n+1)] for _ in range(n+1)]

    for x in range(1, n+1):
        ai, i = aii[x-1]
        dp[x][0] = dp[x-1][0] + ai * (i-x+1)
        dp[0][x] = dp[0][x-1] + ai * (n-x-i)

    for s in range(1, n+1):
        for x in range(1, s):
            y = s - x
            ai, i = aii[s-1]
            dp[x][y] = max(dp[x-1][y] + ai * (i-x+1),
                           dp[x][y-1] + ai * (n-y-i))

    res = 0
    for x in range(n+1):
        if dp[x][n-x] > res:
            res = dp[x][n-x]
    return res


if __name__ == "__main__":
    n = i1num()
    a = inums()
    aii = sorted([(a[i], i)for i in range(n)], reverse=True)
    print(solve(n, aii))
Problem p02922 (python)

Fixed submission:
import math
a,b = map(int, input().split())
print(math.ceil((b-1)/(a-1)))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(int((a-1)/(b-1)+0.5))
Problem p02945 (python)

Fixed submission:
a, b = map(int,input().split())
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a, b = input().split()
print(max(a+b,a-b,a*b))
Problem p02946 (python)

Fixed submission:
k, x = map(int, input().split())
start = max(-1000000, x-k+1)
end = min(1000000, x+k-1)
print(" ".join(map(str, range(start, end+1))))

Buggy submission (verdict: Runtime Error):
k,x = map(input().split())
start=max(-1000000,x-k+1)
end=min(1000000,x+k-1)
print(" ".join(range(start,end+1)))
Problem p04029 (python)

Fixed submission:
print(sum(range(int(input())+1)))

Buggy submission (verdict: Runtime Error):
print(sum(range(1,input()+1)))
Problem p02934 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
a = list(map(int,input().split()))
s = 0
for i in range(n):
    s+=1/a[i]
print(1/s)
Problem p02945 (python)

Fixed submission:
I0 = lambda :map(int,input().split())
I1 = lambda :int(input())
I2 = lambda :list(map(int,input().split()))
#####################################################
A,B = I0()
print(max([A*B,A-B,A+B]))

Buggy submission (verdict: Runtime Error):
I0 = lambda :map(int,input().split())
I1 = lambda :int(input())
I2 = lambda :list(map(int,input().split()))
#####################################################
A,B = I0()
print(max([A*B,A-B,A+b]))
Problem p02947 (python)

Fixed submission:
I0 = lambda :map(int,input().split())
I1 = lambda :int(input())
I2 = lambda :list(map(int,input().split()))
#####################################################
from collections import defaultdict
n = I1()
d = defaultdict(int)
for i in range(n):
    d["".join(sorted(input()))]+=1
res=0
for i in d.keys():
    if d[i] > 1:
        yy=d[i]-1
        res+=yy*(yy+1)//2
print(res)

Buggy submission (verdict: Runtime Error):
I0 = lambda :map(int,input().split())
I1 = lambda :int(input())
I2 = lambda :list(map(int,input().split()))
#####################################################
from collections import defaultdict
n = I1()
d = defaultdict(int)
for i in range(n):
    d[sorted(input())]+=1
res=0
for i in d.keys():
    if d[i] > 1:
        yy=d[i]-1
        res+=yy*(yy+1)//2
print(res)
Problem p02756 (python)

Fixed submission:
s = [_ for _ in input()]
qn = int(input())
rev = False
prevs = ['']*200000
nexts = ['']*200000
previ = 0
nexti = 0

for _ in range(qn):
  q = [_ for _ in input().split()]
  if q[0] == '1':
    rev = not rev
  else:
    if (rev and q[1] == '2') or (not rev and q[1] == '1'):
      prevs[previ] = q[2]
      previ += 1
    else:
      nexts[nexti] = q[2]
      nexti += 1

prevs.reverse()
s = prevs + s + nexts
if rev:
  s.reverse()
print("".join(s))

Buggy submission (verdict: Runtime Error):
s = [_ for _ in input()]
qn = int(input())
rev = False
prevs = ['']*20000
nexts = ['']*20000
previ = 0
nexti = 0

for _ in range(qn):
  q = [_ for _ in input().split()]
  if q[0] == '1':
    rev = not rev
  else:
    if (rev and q[1] == '2') or (not rev and q[1] == '1'):
      prevs[previ] = q[2]
      previ += 1
    else:
      nexts[nexti] = q[2]
      nexti += 1

prevs.reverse()
s = prevs + s + nexts
if rev:
  s.reverse()
print("".join(s))

Buggy submission (verdict: Runtime Error):
s = [_ for _ in input()]
qn = int(input())
rev = False
prevs = ['']*20000
nexts = ['']*20000
previ = 1
nexti = 0

for _ in range(qn):
  q = [_ for _ in input().split()]
  if q[0] == '1':
    rev = not rev
  else:
    if (rev and q[1] == '2') or (not rev and q[1] == '1'):
      prevs[20000-previ] = q[2]
      previ += 1
    else:
      nexts[nexti] = q[2]
      nexti += 1

if rev:
  print("".join(nexts + s + prevs))
else:
  print("".join(prevs + s + nexts))
Problem p02772 (python)

Fixed submission:
n = input()
arr = [int(_) for _ in input().split() if int(_) % 2 == 0 and int(_) % 3 != 0 and int(_) % 5 != 0]
 
if len(arr) == 0:
  print("APPROVED")
else:
  print("DENIED")

Buggy submission (verdict: Runtime Error):
import sys
n = input()
arr = [int(_) for _ in input().split()]

for i in arr:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      print("DENIED")
      sys.exit(1)

print("APPROVED")
Problem p02700 (python)

Fixed submission:
a,b,c,d = map(int, input().split(" "))
while True:
  c -= b
  if c <= 0:
    print("Yes")
    break
  a -= d
  if a <= 0:
    print("No")
    break

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split(" "))
while True:
  c -= b
  if c <= 0:
    print("Yes")
    break
  a -= d
  if a <= 0:
    print("No")
  	break
Problem p02748 (python)

Fixed submission:
_, _, M = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
min = min(a) + min(b)
for i in range(M):
  x, y, c = map(int, input().split(" "))
  s = a[x-1] + b[y-1] - c
  if min > s:
    min = s
print(min)

Buggy submission (verdict: Runtime Error):
_, _, M = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
min = min(a) + min(b)
for i in range(M):
  x, y, c = map(int, input().split(" "))
  s = a[x] + b[y] - c
  if min > s:
    min = s
print(min)
Problem p02812 (python)

Fixed submission:
_ = input()
S = input()
print(len(S.split("ABC")) - 1)

Buggy submission (verdict: Runtime Error):
_ = input()
S = input()
print(len(S.split("ABC") - 1))

Buggy submission (verdict: Runtime Error):
_ = input()
S = input()
print(len(S.split("ABC") - 1)
Problem p02844 (python)

Fixed submission:
#!/usr/bin/env/ python3
N = int(input())
S = input()
#A, B, C = input().split()
#A, B, C, X, Y = map(int, input().split())

#N = int(input())
#H, W = map(int, input().split())
#S = [input() for _ in range(H)]
#print(A[0][0])

ans = 0
for tmp_num in range(1000):
    tmp = str(tmp_num).zfill(3)
    digit = 0
    for i in range(N):
        if S[i] == tmp[digit]:
            digit += 1
            if digit == 3:
                ans += 1
                break
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env/ python3
N = int(input())
S = input()
#A, B, C = input().split()
#A, B, C, X, Y = map(int, input().split())

#N = int(input())
#H, W = map(int, input().split())
#S = [input() for _ in range(H)]
#print(A[0][0])

ans = 0
for tmp_num in range(1000):
    tmp = str(tmp_num).zfill(3)
    digit = 0
    for i in range(N):
        if S[i] == tmp[digit]:
            digit += 1
	        if digit == 3:
                ans += 1
                break
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env/ python3
N = int(input())
S = input()
#A, B, C = input().split()
#A, B, C, X, Y = map(int, input().split())

#N = int(input())
#H, W = map(int, input().split())
#S = [input() for _ in range(H)]
#print(A[0][0])

ans = 0
for tmp_num in range(1000):
    tmp = str(tmp_num).zfill(3)
    digit = 0
    for i in range(N):
        if S[i] == tmp[digit]:
          digit += 1
	      if digit == 3:
            ans += 1
            break
print(ans)
Problem p02727 (python)

Fixed submission:
X, Y, R, G, W = map(int, input().split())
red = list(map(lambda x: (int(x), 0), input().split()))
green = list(map(lambda x: (int(x), 1), input().split()))
white = list(map(lambda x: (int(x), 2), input().split()))

apples = sorted(red + green + white, key=lambda x: x[0])

choice = X + Y
res = 0

while apples and choice:
    val, color = apples.pop()
    if color == 0:
        if X > 0:
            res += val
            X -= 1
            choice -= 1
        continue
    if color == 1:
        if Y > 0:
            res += val
            Y -= 1
            choice -= 1
        continue
    if color == 2:
        res += val
        choice -= 1

print(res)

Buggy submission (verdict: Runtime Error):
X, Y, R, G, W = map(int, input().split())
red = sorted(list(map(int, input().split())), key=lambda x: -x)
green = sorted(list(map(int, input().split())), key=lambda x: -x)
white = sorted(list(map(int, input().split())), key=lambda x: -x)

dp = [[[0 for _ in range(X+Y+1)] for __ in range(Y+1)] for ___ in range(X+1)]

ans = 0

for w in range(min(W, X+Y)+1):
    for x in range(X+1):
        for y in range(Y+1):
            if x + y + w == X + Y:
                ans = max(ans, dp[x][y][w])
                break
            if x < X:
                dp[x+1][y][w] = max(dp[x+1][y][w], dp[x][y][w] + red[x])
            if y < Y:
                dp[x][y+1][w] = max(dp[x][y+1][w], dp[x][y][w] + green[y])
            if w < W:
                dp[x][y][w+1] = max(dp[x][y][w+1], dp[x][y][w] + white[w])

print(ans)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
 
def lcm(x, y):
    return (x * y) // gcd(x, y)
 
a, b, c, d = map(int, input().split())
 
yaku_b = b - (b // c + b // d - b // lcm(c,d))
yaku_a = a-1 - ((a-1) // c + (a-1) // d - (a-1) // lcm(c,d))
print(yaku_b - yaku_a)

Buggy submission (verdict: Runtime Error):
import math
 
def lcm(x, y):
  return (x * y) // math.gcd(x, y)
 
a, b, c, d = map(int, input().split())
 
yaku_b = b - (b // c + b // d - b // lcm(c,d))
yaku_a = a-1 - ((a-1) // c + (a-1) // d - (a-1) // lcm(c,d))
print(yaku_b - yaku_a)

Buggy submission (verdict: Runtime Error):
import math

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

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

yaku_b = b - (b // c + b // d - b // lcm(c,d))
yaku_a = a-1 - ((a-1) // c + (a-1) // d - (a-1) // lcm(c,d))
print(yaku_b - yaku_a)
Problem p02999 (python)

Fixed submission:
x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10
Problem p03000 (python)

Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))
now = 0

for i in range(len(l)):
    now += l[i]
    if now > x:
        break
else:
    i += 1
    
print(i+1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
now = 0
i = 0

while now <= x:
    now += l[i]
    i += 1
    
print(i)
Problem p03039 (python)

Fixed submission:
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

N, M, K = map(int, input().split())

ans = 0

for i in range(1, M):
    ans += (i * (M-i) * N**2) % (10**9 + 7) 
for i in range(1, N):
    ans += (i * (N-i) * M**2) % (10**9 + 7)

ans *= comb(N*M-2 , K-2, 10**9+7)

print(int(ans % (10**9+7)))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
N, M, K = map(int, input().split())

ans = 0

for i in range(1, M):
    ans += i * (M-i) * N**2 
for i in range(1, N):
    ans += i * (N-i) * M**2

ans *= comb(N*M-2, K-2, exact=True)

print(int(ans % (10**9+7)))
Problem p03145 (python)

Fixed submission:
lines = list(map(int, input().split()))
lines.sort()
 
print((lines[0] * lines[1]) // 2)

Buggy submission (verdict: Runtime Error):
lines = list(map(int, input().split())
lines.sort()
             
print(lines[0] * lines[1])

Buggy submission (verdict: Runtime Error):
lines = map(int, input().split())
lines.sort()

print(lines[0] * lines[1])
Problem p03211 (python)

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

Buggy submission (verdict: Runtime Error):
 S = input()
print(min(abs(int(S[i:i+3]) - 753) for i in range(len(S) - 2)))
Problem p02848 (python)

Fixed submission:
n=int(input())
s=input()
for i in range(len(s)):
  ss=(ord(s[i])+n)
  if ss>90:
    ss=ss-26
  print(chr(ss),end="")

Buggy submission (verdict: Runtime Error):
aa
Problem p02853 (python)

Fixed submission:
a,b=map(int, input().split())
s=0
t=400000-100000*a
if t>0:
  s=t
u=400000-100000*b
if u>0:
  s+=u
if a+b==2:
  s+=400000
print(s)

Buggy submission (verdict: Runtime Error):
ああ
Problem p02861 (python)

Fixed submission:
from itertools import permutations
 
n = int(input())
n_ = 1
for i in range(n):
    n_ *= i+1
c = [tuple(map(int,input().split())) for _ in range(n)]
tot = 0
 
def dis(c,x,y):
  x1,y1 = c[x]
  x2,y2 = c[y]
  return ((x1-x2)**2 + (y1-y2)**2)**.5
 
for l in permutations(range(n)):
    d = 0
    cur = l[0]
    for x in l:
        d += dis(c,cur,x)
        cur = x
    tot += d/n_
print(tot)

Buggy submission (verdict: Runtime Error):
kk
Problem p02865 (python)

Fixed submission:
n=int(input())
if n%2==0:
  ans=n//2-1
else:
  ans=n//2

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
  ans=n//2-1
else:
  ans==n//2

print(ans)
Problem p02899 (python)

Fixed submission:
a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))

Buggy submission (verdict: Runtime Error):
sal
n = int(input())
l = list(map(int,input().split()))
r = [0]*n
for i in range(n):
  r[l[i]-1] = i+1
for x in r:
  print(x)

Buggy submission (verdict: Runtime Error):
n=int(input())
a= list(map(int, input().split())) 
p=[0]*n

for i in range(n):
  p[a[i]]=i+1
  print(p[i],end=" ")
Problem p02909 (python)

Fixed submission:
s=input()

a="Sunny"
b="Rainy"
c="Cloudy"

if s==a:
  print(c)
elif s==b:
  print(a)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
s=input()

a="Sunny"
b="Rainy"
c="Cloudy"

if s=a:
  print(c)
elif s=b:
  print(a)
else:
  print(b)
Problem p02923 (python)

Fixed submission:
n=int(input())
h = list(map(int, input().split()))
move=0
maxmove=0
minheight=h[0]

for i in range(1,n):
  if minheight>=h[i]:
    move+=1
    minheight=h[i]
  else:
    maxmove=max(move,maxmove)
    move=0
    minheight=h[i]
print(max(maxmove,move))

Buggy submission (verdict: Runtime Error):
n=int(input())
h = list(map(int, input().split()))
move=0
maxmove=0
minheight=h[0]

for i in range(1,n):
  if minheight>=h[i]:
    move+=1
  else:
    move=0
  minheight=h[i]
  ans=max(maxmove,move)
print(ans)
Problem p02947 (python)

Fixed submission:
n=int(input())
d=dict()

for i in range(n):
  s="".join(sorted(input()))
  #print(s)
  if s in d:
    d[s]+=1
  else:
    d[s]=1
ans=0
for x in d.values():
  ans+=x*(x-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
Lily
from collections import defaultdict

n = int(input())
dct = defaultdict(int)

for i in range(n):
    s = input()
    sorted_s = "".join(sorted(s))
    dct[sorted_s] += 1

ans = 0
for k, v in dct.items():
    ans += v * (v - 1) // 2

print(ans)
Problem p02982 (python)

Fixed submission:
N, D = map(int, input().split())
l = [list(map(int, input().split())) for i in range(N)]

ans=0
s=0
for i in range(N):
  for j in range(i+1,N):
    s=0
    for d in range(D):
      s+=(l[i][d]-l[j][d])**2
    if s**(1/2)%1==0:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
yandy
N, D = map(int, input().split())
array = []
for _ in range(N):
    array.append([int(i) for i in input().split()])
 
ans = 0
for i in range(N):
    for j in range(i+1, N):
        s = 0
        for d in range(D):
            s += (array[i][d]-array[j][d]) ** 2
        if s ** (1/2) % 1 == 0:
            ans += 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n = [list(map(int, input().split())) for i in range(a)]
for (i,j) in range()
Problem p03030 (python)

Fixed submission:
N = int(input())
l = []

for i in range(N):
  s,p=input().split()
  p=100-int(p)
  l.append((s,p,i+1))
l.sort()
for i in range(N):
  print(l[i][2])

Buggy submission (verdict: Runtime Error):
salmonize
n = int(input())
l = []
for i in range(1,n+1):
  s,p = input().split()
  l.append((s,-int(p),i))
l.sort()
for x in l:
  print(x[2])