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

Fixed submission:
N, M = map(int, input().split())
AB = [tuple(map(int,input().split())) for i in range(M)]

class UnionFind:
    def __init__(self,N):
        self.parent = [i for i in range(N)]
        self._size = [1] * N
        self.count = 0

    def root(self,a):
        if self.parent[a] == a:
            return a
        else:
            self.parent[a] = self.root(self.parent[a])
            return self.parent[a]
    def is_same(self,a,b):
        return self.root(a) == self.root(b)

    def unite(self,a,b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb: return
        if self._size[ra] < self._size[rb]: ra,rb = rb,ra
        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        self.count += 1

    def size(self,a):
        return self._size[self.root(a)]

uf = UnionFind(N)
for a,b in AB:
    a,b = a-1,b-1
    if uf.is_same(a,b): continue
    uf.unite(a,b)

ans = 0
for i in range(N):
    ans = max(ans, uf.size(i))
print(ans)

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

#AB = [tuple(map(int, input().split())) for i in range(M)]
#丸暗記。隣接リストの初期化
graph = [[i+1] for i in range(M)]

for _ in range(M):
  a, b = map(int, input().split())
  graph[a-1].append(b)
  graph[b-1].append(a)

ans = -1
for g in graph:
  ans = max(ans, len(set(g)))
print(ans)
Problem p02608 (python)

Fixed submission:
N = int(input())
ans = [0] * (N + 1)
for i in range (1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      n = i*i+j*j+k*k+i*j+j*k+k*i
      if n <= N:
        ans[n] += 1

print(*ans[1:], sep='\n')

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = [0] (N + 1)
for i in range (1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      n = i*i+j*j+k*k+i*j+j*k+k*i
      if n <= N:
        ans[n] += 1

print(*ans[1:], sep='\n')
Problem p02687 (python)

Fixed submission:
S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
S = int(input())
if S == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
S = int(input())
if S == "ABC":
  print("ARC")
else:
  print("ABC")
Problem p02700 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
for _ in range(10000):
  C -= B
  if C <= 0:
    print("Yes")
    exit()
  A -= D
  if A <= 0:
    print("No")
    exit()

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
for _ in range(10000):
  C -= B
  if C <= 0:
    print("Yes")
    exit()
  A -= D
  if A <= 0:
    print("No")
    exit()

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

for _ in range(10000):
  C -= B
  if C <= 0:
    print("Yes")
    exit()

  A -= D
  if A <= 0:
    print("No")
    exit()

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

for _ in range(10000):
  C -= B
  if C <= 0:
    print("Yes")
    exit()

  A -= D
  if A <= 0:
    print("No")
    exit()
Problem p02724 (python)

Fixed submission:
X = int(input())
if X >= 500:
  q = X // 500 
  mod = X % 500 
  f = mod // 5
  print(q*1000+f*5)
else:
  f = X // 5
  print(f*5)

Buggy submission (verdict: Runtime Error):
X = int(input())
if X >= 500:
  q = X // 500 
  mod = X % 500 
  f = mod // 5
  print(q*1000+f*5)
else:
  f = X // 5
  print(f*5
Problem p02732 (python)

Fixed submission:
from operator import mul
from functools import reduce

def ncr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

a = int(input())
A = list(map(int, input().split()))  
d = {}
for k in A:
  if k in d:
    d[k] += 1
  else:
    d[k] = 1
 
res = 0
for k in d:
    if d[k] >= 2:
      res += ncr(d[k], 2)

for k in A:
  temp = res
  m = d[k]
  d[k] -= 1
  if m >= 2:
    temp -= ncr(m, 2)

  if d[k] >= 2:
    temp += ncr(d[k], 2)
  print(temp)
  d[k] += 1

Buggy submission (verdict: Runtime Error):
def choose2(n):
    return n * (n - 1) // 2

a = int(input())
A = list(map(int, input().split()))  
d = {}
for k in A:
  if k in d:
    d[k] += 1
  else:
    d[k] = 1
 
res = 0
for k in d.values():
  res += choose2(k, 2)

for k in A:
  temp = res
  m = d[k]
  temp -= choose2(m, 2, mod)

  d[k] -= 1
  temp += choose2(d[k], 2, mod)
  print(temp)
  d[k] += 1
Problem p02768 (python)

Fixed submission:
mod = 7+10**9
def ncr(n,c,mod):
  x = 1
  y = 1
  for i in range(n-c+1,n+1):
    x = x*i%mod
  for j in range(1,c+1):
    y = y*j%mod
  return (x * pow(y, mod-2, mod)) % mod

n, a, b = map(int, input().split())
al = pow(2, n, mod) -1
acr = ncr(n, a, mod)
bcr = ncr(n, b, mod)
print( (al-(acr+bcr))%mod )

Buggy submission (verdict: Runtime Error):
mod = 7+10**9
def ncr(n,c,mod):
  x = 1
  y = 1
  for i in range(n-c+1,n+1):
    x = x*i%mod
  for j in range(1,c+1):
    y = y*j%mod
  return (x * pow(y, mod-2, mod)) % mod

n, a, b = map(int, input().split())
al = pow(2, n, mod) -1
acr = ncr(n, a, mod)
bcr = ncr(n, b, mod)
print((al-(acr+bcr))%mod
Problem p02780 (python)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
lst = [0]
for x in P:
  lst.append(lst[-1] + (x+1)/2)

res = -1
for i in range(N-K+1):
  sum = lst[i+K]-lst[i]
  res = max(res, sum)

print("{:.6f}".format(res))

Buggy submission (verdict: Runtime Error):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

data = np.fromstring(read(), np.int64, sep=' ')

N, K = data[:2]
P = np.hstack([[0], data[2:] + 1])

Pcum = P.custom()
x = Pcum[K:] - Pcum[0:-K]
print(x.max()/2)

Buggy submission (verdict: Runtime Error):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as numpy

data = np.fromstring(read(), np.int64, sep = ' ')

N, K = data[:2]
P = np.hstack([[0], data[2:] + 1])

Pcum = P.custom()
x = Pcum[K:] - Pcum[0:-K]
print(x.max()/2)
Problem p04019 (python)

Fixed submission:
S = input()
d = {}

for s in S:
  d[s] = True

if 'N' in d:
  if 'S' not in d:
    print("No")
    exit()
    
if "S" in d:
  if 'N' not in d:
    print("No")
    exit()

if "E" in d:
  if "W" not in d:
    print("No")
    exit()
    
if "W" in d:
  if "E" not in d:
    print("No")
    exit()  
    
print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
d = {}
for s in S:
  d[s] = True
  
if 'N' in d:
  if 'S' not in d:
    print 'No'
    exit()
    
if 'S' in d:
  if 'N' not in d:
    print 'No'
    exit()

if 'E' in d:
  if 'W' not in d:
    print 'No'
    exit()
    
if 'W' in d:
  if 'E' not in d:
    print 'No'
    exit()  
    
print 'Yes'
Problem p02856 (python)

Fixed submission:
m = int(input())
csum = 0
dsum = 0
for i in range(m):
  d,c = (int(x) for x in input().split())
  csum += c
  dsum += d*c
print(csum-1 + (dsum-1) // 9)

Buggy submission (verdict: Runtime Error):
m = int(input())
csum = 0
dsum = 0
for i in range(m):
  d,c = (int(x) for x in input().split())
  csum += c
  dsum += d*c
print(csum-1 + (dsum-1) // 9)
Problem p03239 (python)

Fixed submission:
N,T = (int(x) for x in input().split())
C = 2000
for i in range(N):
  c,t = (int(x) for x in input().split())
  if t <= T:
    C = min(c,C)
    
if C == 2000:
  print("TLE")
else: print(C)

Buggy submission (verdict: Runtime Error):
N,T = int(x) for x in input().split()
C = 2000
for i in range(N):
  c,t = int(x) for x in input().split()
  if t <= T:
    C = min(c,C)
    
if C == 2000:
  print("TLE")
else: print(C)

Buggy submission (verdict: Runtime Error):
N,T = int(input().split())
C = 2000
for i in range(N):
  c,t = int(input().split())
  if t <= T:
    C = min(c,C)
    
if C == 2000:
  print("TLE")
else: print(C)
Problem p03292 (python)

Fixed submission:
a = map(int, input().split())
a = sorted(a)
ans = 0
ans += a[1] - a[0]
ans += a[2] - a[1]
print(ans)

Buggy submission (verdict: Runtime Error):
a = map(int, input.split())
a = sorted(a)
ans = 0
ans += a[1] - a[0]
ans += a[2] - a[1]
print(ans)
Problem p03323 (python)

Fixed submission:
a,b = map(int,input().split())
if(a <= 8 and b <= 8):
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
if(a <= 8 and b <= 8):
  print('Yay!')
else:
  print(':(')
Problem p02639 (python)

Fixed submission:
x = list(map(int,input().split()))
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)

Buggy submission (verdict: Runtime Error):
x = map(int,input().split())
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
Problem p02786 (python)

Fixed submission:
#memo = [0] * 100000000
#memo[1] = 1

def saiki(n):
#    global memo
    tmp = 0
    if n <= 1:
        return 1
#        return memo[1]
    else:
        tmp = int(n/2)
        return saiki(tmp) * 2 + 1
#        if memo[tmp] == 0:
#            memo[tmp] = saiki(tmp)
#        return memo[tmp]+memo[tmp]+1
    
h = int(input())
print(saiki(h))

Buggy submission (verdict: Runtime Error):
memo = [0] * 100000000
memo[1] = 1

def saiki(n):
    global memo
    tmp = 0
    if n <= 1:
        return memo[1]
    else:
        tmp = int(n/2)
        if memo[tmp] == 0:
            memo[tmp] = saiki(tmp)
        return memo[tmp]+memo[tmp]+1
    
h = int(input())
print(saiki(h))

Buggy submission (verdict: Runtime Error):
memo = [0] * 1000000
memo[1] = 1

def saiki(n):
    global memo
    tmp = 0
    if n <= 1:
        return memo[1]
    else:
        tmp = int(n/2)
        if memo[tmp] == 0:
            memo[tmp] = saiki(tmp)
        return memo[tmp]+memo[tmp]+1
    
h = int(input())
print(saiki(h))

Buggy submission (verdict: Runtime Error):
memo = [0] * 1000000000000
memo[1] = 1

def saiki(n):
    global memo
    tmp = 0
    if n <= 1:
        return memo[1]
    else:
        tmp = int(n/2)
        if memo[tmp] == 0:
            memo[tmp] = saiki(tmp)
        return memo[tmp]+memo[tmp]+1
    
h = int(input())
print(saiki(h))
Problem p02813 (python)

Fixed submission:
import itertools
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))

l = [int(x) for x in range(1,n+1)]
i = 0
p_i = 0
q_i = 0
for v in itertools.permutations(l, len(l)):
    i += 1
    if p==list(v):
        p_i = i
        #print(list(v))
    if q==list(v):
        q_i = i
        #print(i,list(v))
print(abs(p_i-q_i))

Buggy submission (verdict: Runtime Error):
import copy
def func(n):
    result = []
    result.append([1,2])
    result.append([2,1])
    if n == 2:
        return result
    else:
        #for i in range(3,n+1):
        res_list = func(n-1)
        res = []
        for j in range(n):
            for s in res_list:
                st = copy.copy(s)
                st.insert(j,n)
                res.append(st)
        return res

n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))

s = func(n)
s.sort()
p_i = 0
q_i = 0
for i in range(n):
    #print(s[i])
    if s[i]==p:
        p_i = i
    if s[i]==q:
        q_i = i
print(abs(p_i,q_i))

Buggy submission (verdict: Runtime Error):
import copy
def func(n):
    result = []
    result.append([1,2])
    result.append([2,1])
    if n == 2:
        return result
    else:
        #for i in range(3,n+1):
        res_list = func(n-1)
        res = []
        for j in range(n):
            for s in res_list:
                st = copy.copy(s)
                st.insert(j,n)
                res.append(st)
        return res

n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))

s = func(n)
srt = sorted(s)
p_i = 0
q_i = 0
for i in range(n):
    print(srt[i])
    if srt[i]==p:
        p_i = i
    if srt[i]==q:
        q_i = i
print(abs(p_i,q_i))
Problem p03001 (python)

Fixed submission:
import collections
W,H,x,y = map(int,input().split())

if 2 * x == W and 2 * y == H:
    tmp = 1
else:
    tmp = 0
print(W*H/2,tmp)

Buggy submission (verdict: Runtime Error):
import collections
W,H,x,y = map(int,input().split())
tmp = []

if W==x*2:
    print(x*H,1)
elif H==y*2:
    print(W*y,1)
else:
    tmp.append(min(H*x,H*(W-x)))
    tmp.append(min(W*y,W*(H-y)))

tmp_cnt = collections.Counter(tmp)
print(tmp_cnt)

if len(tmp_cnt)==1:
    print(max(tmp_cnt.keys()),1)
else:
    print(max(tmp_cnt.keys()),0)

Buggy submission (verdict: Runtime Error):
import collections
W,H,x,y = map(int,input().split())
tmp = []

if W==x*2:
    print(x*H,1)
elif H==y*2:
    print(W*y,1)
else:
    tmp.append(min(H*x,H*(W-x)))
    tmp.append(min(W*y,W*(H-y)))

tmp_cnt = collections.Counter(tmp)
tmp_sort = sorted(tmp_cnt.items(),reverse=True)
#print(tmp_sort)
if tmp_sort[0][1]==1:
    print(tmp_sort[0][0],0)
else:
    print(tmp_sort[0][0],1)
Problem p03502 (python)

Fixed submission:
n = int(input())
str_n = str(n)
wa = 0
for i in range(len(str_n)):
    wa += int(str_n[i])
if n%wa==0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
str_n = str(n)
wa = 0
for i in range(len(str_n)):
    wa += int(str_n[i])
if x%wa==0:
    print('Yes')
else:
    print('No')
Problem p03563 (python)

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

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
print(g*2-a)
Problem p03679 (python)

Fixed submission:
x,a,b = map(int,input().split())
if a>=b:
    print('delicious')
elif x>=b-a:
    print('safe')
else:
    print('dangerous')

Buggy submission (verdict: Runtime Error):
x,a,b = map(str,input().split())
if a>b:
    print('delicious')
elif x>=b-a:
    print('safe')
else:
    print('dangerous')
Problem p03720 (python)

Fixed submission:
n,m = map(int,input().split())
#dic = {}
#for i in range(m):
#    a,b = map(int,input().split())
#    dic.setdefault(a,0)
#    dic[a] += 1
#    dic.setdefault(b,0)
#    dic[b] += 1
#for j in range(1,n+1):
#    print(dic[j])
ans = [int(0) for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    ans[a] += 1
    ans[b] += 1
for i in range(1,n+1):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
dic = {}
for i in range(m):
    a,b = map(int,input().split())
    dic.setdefault(a,0)
    dic[a] += 1
    dic.setdefault(b,0)
    dic[b] += 1
for j in range(1,n+1):
    print(dic[j])
Problem p03844 (python)

Fixed submission:
a,op,b = map(str,input().split())
if op == '+':
    print(int(a)+int(b))
else:
    print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a,op,b = map(str,input().split())
if op = '+':
    print(int(a)+int(b))
else:
    print(int(a)-int(b))
Problem p02630 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
AA = {}
t = 0
for a in A:
	t += a
	if a in AA:
		AA[a] += 1
	else:
		AA[a] = 1

Q = int(input())
ans = []
for i in range(Q):
	b, c = list(map(int, input().split()))
	if b in AA:
		if c not in AA:
			AA[c] = 0
		AA[c] += AA[b]
		t += (c - b) * AA[b]
		ans += [t]
		del AA[b]
	else:
		ans += [t]
[print(a) for a in ans]

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
AA = {}
t = 0
for a in A:
	t += a
	if a in AA:
		AA[a] += 1
	else:
		AA[a] = 1

Q = int(input())
ans = []
for i in range(Q):
	b, c = list(map(int, input().split()))
	if b in AA:
		if c not in AA:
			AA[c] = 0
		AA[c] += AA[b]
		t += (c - b) * AA[b]
		ans += [t]
		del AA[b]
	else:
		ans += [ans[-1]]
[print(a) for a in ans]

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
Q = int(input())
ans = []
for i in range(Q):
	b, c = list(map(int, input().split()))
	for j in range(N):
		if A[j] == b:
			A[j] = c

	ans += [sum(A)]
[print(a) for a in ans]
Problem p02641 (python)

Fixed submission:
X, N = list(map(int, input().split()))
if N > 0:
    P = list(map(int, input().split()))
    l = X
    h = X
    while True:
        if l not in P:
            print(l)
            break
        if h not in P:
            print(h)
            break
        l -= 1
        h += 1
else:
    input()
    print(X)

Buggy submission (verdict: Runtime Error):
X, N = list(map(int, input().split()))
if N != 0:
    P = list(map(int, input().split()))
    ans = 0
    L = X
    L = X
    for _ in range(N // 2):
        L = L - 1
        H = H + 1
        if L not in P:
            print(L)
            break
        if H not in P:
            print(H)
            break
else:
    print(X)
Problem p02642 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
M = max(A)
B = [0] * (M + 1)

for a in A:
    B[a] += 1

for a in A:
    if B[a] > 0:
        i = 2
        b = a * i
        while b <= M:
            B[b] = 0
            i += 1
            b = a * i
for i in range(M + 1):
    if B[i] > 1:
        B[i] = 0
print(sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

if max(B) == N:
	print(0)
else:
	for a in A:
		pass

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

if max(B) == N:
	print(0)
else:
	for a in A:
		if B[a] > 0:
			i = 2
			b = a * i
			while b <= M:
				B[b] = 0
				i += 1
				b = a * i

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

if max(B) == N:
	print(0)
else:
	for a in A:
		if B[a] > 0:
			i = 2
			b = a * i
			while b <= M:
				B[b] = 0
				i += 1
				b = a * i
	for b in B:
		if B[b] > 1:
			B[b] = 0
	print(sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

if sum(B) == N:
	print(0)
else:
	for a in A:
		if B[a] > 0:
			i = 2
			b = a * i
			while b <= M:
				B[b] = 0
				i += 1
				b = a * i
	for b in B:
		if b > 1:
			B[b] = 0
	print(sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = A[-1]

for a in A:
	B[a] += 1

if sum(B) == 1:
	print(0)
else:
	for a in A:
		if B[a] > 0:
			i = 2
			b = a * i
			while b <= M:
				B[b] = 0
				i += 1
				b = a * i
	print(sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * 2 * 10 ** 5
M = A[-1]

for a in A:
	B[a] = 1

if sum(B) == 1:
	print(0)
else:
	for a in A:
		i = 2
		b = a * i
		while b <= M:
			B[b] = 0
			i += 1
			b = a * i
	print(sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * 2 * 10 ** 5
M = A[-1]

for a in A:
	B[a] = 1

if sum(B) == 1:
	print(0)
else:
	for a in A:
		i = 2
		b = a * i
		while b <= M:
			B[b] = 0
			i += 1
			b = a * i
	print(sum(B))
Problem p02687 (python)

Fixed submission:
tw ="ABC" if input().startswith("ARC") else "ARC"
print(tw)

Buggy submission (verdict: Runtime Error):
tw ="ABC" if input().startswith("ARC") else "ARC")
print(tw)

Buggy submission (verdict: Runtime Error):
tw ="ABC" if input().startsWith("ARC") else "ARC")
print(tw)

Buggy submission (verdict: Runtime Error):
tw ="ABC" if lw.startsWith(input()) else "ARC")
print(tw)

Buggy submission (verdict: Runtime Error):
lw = input()
print("ABC" if lw.startsWith("ABC") else "ARC")

Buggy submission (verdict: Runtime Error):

lw = input()
print(lw.startsWith("ABC") ? "ARC" : "ABC")

Buggy submission (verdict: Runtime Error):
import sys
lw = sys.argv[1]
print(lw.startsWith("ABC") ? "ARC" : "ABC")

Buggy submission (verdict: Runtime Error):
import sys
lw = sys.argv[1]
retrun lw.startsWith("ABC") ? "ARC" : "ABC"

Buggy submission (verdict: Runtime Error):
lw = input()
retrun lw == "ABC" ? "ARC" : "ABC"

Buggy submission (verdict: Runtime Error):
import sys
lw = sys.argv[1]
return lw == "ABC" ? "ARC" : "ABC"

Buggy submission (verdict: Runtime Error):
import sys
lw = sys.argv[1]
retrun lw == "ABC" ? "ARC" : "ABC"
Problem p02717 (python)

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

A, B = B, A
A, C = C, A
print(A, B, C)

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

A, B = B, A
A, C = C, A
print(A, B, C)A, B, C = list(map(int, input().split()))

A, B = B, A
A, C = C, A
print(A, B, C)
Problem p02760 (python)

Fixed submission:
A = [[j for j in list(map(int, input().split()))] for i in range(3)]
N = int(input())
B = []
for _ in range(N):
	b = int(input())
	for r in A:
		for i in range(len(r)):
			if r[i] == b:
				r[i] = 0
ans = False
for i in range(3):
	if sum(A[i]) == 0:
		ans = True
if not ans:
	for i in range(3):
		if A[0][i] + A[1][i] + A[2][i] == 0:
			ans = True
if not ans:
	if A[0][0] + A[1][1] + A[2][2] == 0:
		ans = True
	elif A[0][2] + A[1][1] + A[2][0] == 0:
		ans = True
if ans:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
A = [[j for j in list(map(int, input().split()))] for i in range(3)]
N = int(input())
B = []
for _ in range(N):
	b = int(input())
	for r in A:
		for i in range(len(r)):
			if r[i] == b:
				r[i] = 0
ans = False
for i in range(3):
	if sum(A[i]) == 0:
		ans = True
if not ans:
	for i in range(3):
		if A[0][i] + A[1][i] + A[2][i == 0:
			ans = True
if not ans:
	if A[0][0] + A[1][1] + A[2][2] == 0:
		ans = True
	elif A[0][2] + A[1][1] + A[2][0] == 0:
		ans = True
if ans:
	print('Yes')
else:
	print('No')
Problem p02690 (python)

Fixed submission:
x = int(input())

q = 0

for b in range(-120,120):
    for a in range(b+1,120):
        if a**5 - b**5 == x:
            print(a,b)
            q = 1
            break
    if q == 1:
        break

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

x = int(input())

yakusuu = make_divisors(x)

for i in yakusuu[:len(x)//2+1]:
    y = int(x/i)
    if (y-i)%2 == 0:
        print(i+(y-i)//2,i)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

x = int(input())

yakusuu = make_divisors(x)

for i in yakusuu[:len(x)//2+1]:
    y = int(x/i)
    if (y-i)%2 == 0:
        print(i+(y-i)//2,(y-i)//2)
Problem p02696 (python)

Fixed submission:
a,b,n = map(int,input().split())
x = min(b-1,n)
print(int(a*x/b)-a*int(x/b))

Buggy submission (verdict: Runtime Error):
a , b , n = map(int,input().split())
x = b - 1

def fnc(x):
    return int((a*x)/b)-a*int((x/b))

ans = []

for i in range(min(x,n)):
    ans.append(fnc(i))

print(max(ans))

Buggy submission (verdict: Runtime Error):
a , b , n = map(int,input().split())
x = b - 1

def fnc(x):
    return int((a*x)/b)-a*int((x/b))

ans = []

for i in range(x):
    ans.append(fnc(i))

print(max(ans))
Problem p02755 (python)

Fixed submission:
def tax8(n):
    return list(range(int((n-1)*(25/2)),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1)),int((n+1)*(10/1))))

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

ans = -1

x = []

x.extend(tax8(a))
        
y = []

y.extend(tax10(b))

for i in x:
    if i in y:
        if int(i*(27/25))-i == a and int(i*(11/10))-i == b:
            ans = i
            break
    
print(ans)

Buggy submission (verdict: Runtime Error):
def tax8(n):
    return list(range(int((n-1)*(25/2))),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1))),int((n+1)*(10/1))))

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

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.extend(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.extend(i)
        
for i in x:
    if i in y:
        if int(i*(2/25)) == int(i*(1/10)):
            ans = i
            break
    
print(ans)