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

Fixed submission:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


n, k = sp()
arr = l()
answer = [1]
s = {1}
index = 1
while True:
    temp = arr[answer[-1]-1]
    if temp in s:
        index = temp
        break
    s.add(temp)
    answer.append(temp)
if k <= len(answer)-1:
    out(answer[k])
    exit()
k -= (len(answer)-1)
temp = answer.index(index)
answer = answer[temp:]
k %= len(answer)
if k == 0:
    k = len(answer)
out(answer[k-1])

Buggy submission (verdict: Runtime Error):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


n, k = sp()
arr = l()
answer = [1]
s = {1}
index = 1
while True:
    temp = arr[answer[-1]-1]
    if temp in s:
        index = temp
        break
    s.add(temp)
    answer.append(temp)
if k <= len(answer)-1:
    out(answer[k-1])
    exit()
# print(answer)
k -= (len(answer)-1)
temp = answer.index(index)
answer = answer[index:]
# print(k)
k %= len(answer)-1
if k == 0:
    k = len(answer)
print(answer[k-1])
Problem p02687 (python)

Fixed submission:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(" ".join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


s = data()
if s == "ABC":
    out("ARC")
    exit()
out("ABC")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "ABC":
  print("ARC")
  exit()
pirnt("ABC")
Problem p02722 (python)

Fixed submission:
from math import sqrt, log


def factor(number):
    i = 2
    s = set()
    while i * i <= number:
        if number % i == 0:
            if i != 2:
                s.add(i)
            if (number // i) != 2:
                s.add(number//i)
        i += 1
    return s


def newFactor(number):
    n = number
    i = 2
    ans = set()
    while i * i <= number:
        if number % i == 0:
            while number % i == 0:
                number //= i
            if number % i == 1:
                ans.add(i)
        number = n
        i += 1
    return ans


n = int(input())
if n == 2:
    print(1)
    exit()
if n == 3:
    print(2)
    exit()
s = set()
s.add(2)
s.add(n-1)
s.add(n)
s = s.union(factor(n-1))
s = s.union(newFactor(n))
print(len(s))

Buggy submission (verdict: Runtime Error):
def factor(number):
    i = 2
    s = set()
    while i * i <= number:
        if number % i == 0:
            if i != 2:
                s.add(i)
            if (number // i) != 2:
                s.add(number//i)
        i += 1
    return len(s)


n = int(input())
if n == 3141:
    print(13)
    exit()
if n == 2:
    print(1)
    exit()
if n == 3:
    print(2)
    exit()
answer = 3
answer += factor(n-1)
if sqrt(n) == int(sqrt(n)) and int(sqrt(n)) != 2:
    answer += 1
print(answer)
Problem p03101 (python)

Fixed submission:
H1, W1 = map(int, input().split())
H2, W2 = map(int, input().split())

H=H1-H2
W=W1-W2

print(H*W)

Buggy submission (verdict: Runtime Error):
H1, W1 = map(int, input().split())
H2, W2 = map(int, input().split())

H=H1-H2
W=W1-W2

print(HW)
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
S = []
for p in range(min(X), (max(X) + 1)):
    t = [(i - p) ** 2 for i in X]
    S.append(sum(t))
print(min(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int,input().split()))
S = []
for p in range(min(X), max(X)):
    t = [(i - p) ** 2 for i in X]
    S.append(sum(t))
print(min(S))
Problem p02772 (python)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) == N:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) == N:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) = N:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n =int(input())
A = [0 if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 
    for x in input().split()]]
if not A:
    print("DENIED")
else:
    print("APPROVED")
Problem p02783 (python)

Fixed submission:
H, A = map(int,input().split())
if H % A == 0:
    print(H // A)
else:
    print(H // A + 1)

Buggy submission (verdict: Runtime Error):
H, N= map(int,input().split())
A = [0] * N
B = [0] * N
for i in range(N):
    A[i], B[i] = map(int, input().split())
ma = max(A)
dp = [float("inf")] * (H + ma)
dp[0] = 0
for i in range(N):
    a = A[i]
    b = B[i]
    for j in range(1, H + ma):
        dp[j] = min(dp[j - a] + b, dp[j])
print(min(dp[H:]))
Problem p02845 (python)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
c = [0,0,0]
pos = True
for h in range(len(a)):
    try:
        n = a[h]
        a[h] = c.count(n)
        c[c.index(n)] += 1
    except:
        pos = False
        break
# print(a)
# print(c)
if pos:
    c = 1
    for n in a:
        c *= n%1000000007
    print(c%1000000007)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]
c = [0,0,0]
for h in range(len(a)):
    n = a[h]
    a[h] = c.count(n)
    c[c.index(n)] += 1
# print(a)
# print(c)
c = 1
for n in a:
    c *= n%1000000007
print(c%1000000007)
Problem p02981 (python)

Fixed submission:
price = list(map(int, input().rstrip().split()))
print(min(price[0]*price[1], price[2]))

Buggy submission (verdict: Runtime Error):
price = list(map(int, input().rstrip().split()))
print(min(price[0]*price[1], price[2])
Problem p02982 (python)

Fixed submission:
n = list(map(int, input().rstrip().split(" ")))
ans = 0
coor = []
for a in range(n[0]):
  coor.append(list(map(int, input().rstrip().split(" "))))
  
def dis(a,b):
  ans = 0
  for i in range(len(a)):
    ans += (a[i] - b[i])**2
  return ans**0.5
  
for a in range(len(coor)):
  for b in range(0,a):
    if coor[a]!=coor[b]:
      if dis(coor[a], coor[b]).is_integer():
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().rstrip().split(" ")))
ans = 0
coor = []
for a in n[0]:
  coor.append(list(map(int, input().rstrip().split(" "))))
  
def dis(a,b):
  ans = 0
  for i in range(a):
    ans += (a[i] - b[i])**2
  return ans**0.5
  
for a in range(len(coor)):
  for b in range(0,a):
    if coor[a]!=coor[b]:
      if dis(coor[a], coor[b]).is_integer():
        ans += 1
print(ans)
Problem p03999 (python)

Fixed submission:
S = list(input())
if len(S) != 1:
    t = 0
    for n in range(2**(len(S) - 1)):
        f = S[0]
        b = bin(n)[2:]
        b = "0"*(len(S) - len(b) - 1) + b
        for a in range(len(b)):
            if b[a] == "1":
                f += "+"
            f += S[a+1]
        t += eval(f)
    print(t)
else:
    print(S[0])

Buggy submission (verdict: Runtime Error):
S = list(input())
t = 0
for n in range(2**(len(S) - 1)):
    f = S[0]
    b = bin(n)[2:]
    b = "0"*(len(S) - len(b) - 1) + b
    for a in range(len(b)):
        if b[a] == "1":
            f += "+"
        f += S[a+1]
    t += eval(f)
print(t)
Problem p02658 (python)

Fixed submission:
N = int(input())
S = list(map(int,input().split()))
t = 10**18
ans = 1

if 0 in S:
  print(0)
  exit(0)
  
for n in S:
  ans *= n
  if ans > t:
    print(-1)
    exit(0)
  
print(ans)

Buggy submission (verdict: Runtime Error):
31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0
Problem p02786 (python)

Fixed submission:
H = int(input())

if H == 1:
  print(1)
  exit(0)

import math as m
n = m.floor(m.log2(H))+1
ans = (2**n) - 1

print(ans)

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

import math as m
remain = H % 2
H -= remain
n = round(m.log2(H)+0.5)
ans = (2**n) - 1

print(ans)
Problem p03680 (python)

Fixed submission:
N = int(input())
d = []
visited = [False for _ in range(N+1)]
for _ in range(N):
  d.append(int(input())-1)

i = 0
cnt = 0
while True:
  if i == 1:
    break
  elif cnt >= N:
    cnt = -1
    break
  elif visited[i]:
    cnt = -1
    break
  else:
    visited[i] = True
    cnt += 1
    i = d[i]
  
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = []
visited = [False for _ in range(N+1)]
for _ in range(N):
  d.append(int(input())-1)
  
def dfs(i,cnt):
  if i == 1:
    return cnt
  elif cnt >= N:
    return -1
  elif visited[i]:
    return -1
  else:
    visited[i] = True
    return dfs(d[i],cnt+1)
  
print(dfs(0,0))

Buggy submission (verdict: Runtime Error):
N = int(input())
d = []
visited = [False for _ in range(N+1)]
for _ in range(N):
  d.append(int(input())-1)
  
def dfs(i,cnt):
  if i == 1:
    return cnt
  elif visited[i]:
    return -1
  else:
    visited[i] = True
    return dfs(d[i],cnt+1)
  
print(dfs(0,0))

Buggy submission (verdict: Runtime Error):
N = int(input())
d = []
visited = [False for _ in range(N)]
for _ in range(N):
  d.append(int(input())-1)
  
def dfs(i,cnt):
  if i == 1:
    return cnt
  elif visited[i]:
    return -1
  else:
    visited[i] = True
    return dfs(d[i],cnt+1)

def main():
  
  return dfs(0,0)
  
print(main())

Buggy submission (verdict: Runtime Error):
N = int(input())
d = []
visited = [False for _ in range(N)]
for _ in range(N):
  d.append(int(input())-1)
  
def dfs(i,cnt):
  if visited[i]:
    return -1
  elif i == 1:
    return cnt
  else:
    visited[i] = True
    return dfs(d[i],cnt+1)

def main():
  if d[1] == 1:
    return -1
  
  return dfs(0,0)
  
print(main())
Problem p04030 (python)

Fixed submission:
S = input()

F = []
for ch in S:
  if ch == "B": 
    if len(F) > 0:
      F.pop()
  else:
    F.append(ch)
    
print("".join(F))

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

F = []
for ch in S:
  if ch == "B":
    F.pop()
  else:
    F.append(ch)
    
print("".join(F))
Problem p03200 (python)

Fixed submission:
s=input()
n=len(s)
cnt=0
for i in range(n):
  if s[i]=='W':
    cnt+=1
ans=0
for i in range(n):
  if s[i]=='W':
    cnt-=1
  else:
    ans+=cnt
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
cnt=0
for i in range(n):
  if s[i]=='W':
    cnt+=1
ans=0
for i in range(n):
  if s[i]=='W':
    cnt--
  else:
    ans+=cnt
print(ans)
Problem p02898 (python)

Fixed submission:
n,k = input().split() 
k = int(k)
a = list(map(int,input().split()))
b = 0
for c in a:
    if c>=k:
        b = b+1
print(b)

Buggy submission (verdict: Runtime Error):
n,k = int(imput().split()) 
a = list(map(int,imput().split()))
b = 0
for c in a:
    if c>=k:
        b = b+1
print(b)
Problem p02783 (python)

Fixed submission:
h, a = map(int,input().split())
print(-(-h // a))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
H = sorted(h)[::-1]
ans = 0
if k >= len(h):
    print(0)
else:
    for i in H[k:]:
        ans += i
    print(ans)
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t,s,sep='')

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
if a >= k:
    a -= k
else:
    b = max(0,k - a)
    a = 0
print(a, b)

Buggy submission (verdict: Runtime Error):
s, t = map(input().split())
print(s, t,sep='')
Problem p02952 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int,input().split())
print(max(0,c-(a-b))
Problem p03545 (python)

Fixed submission:
s = input()
op = ['-', '+']
for i in range(2):
    for j in range(2):
        for k in range(2):
            com = s[0] + op[i] + s[1] + op[j] + s[2] + op[k] + s[3]
            if eval(com) == 7:
                print(com + '=7')
                exit(0)

Buggy submission (verdict: Runtime Error):
s = input()
ops = ['-', '+']
for i in range(2):
    for j in range(2):
        for k in range(2):
            com = s[0] + op[i] + s[1] + op[j] + s[2] + op[k] + s[3]
            if eval(com) == 7:
                print(com + '=7')
Problem p02548 (python)

Fixed submission:
n = int(input())
ans =0

for i in range(1,n):
    ans +=(n-1)//i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans =0

for i in range(1,n):
    ans +=(n-1)//a
print(ans)
Problem p02584 (python)

Fixed submission:
x,k,d = map(int,input().split())
x = abs(x)
if x-k*d>0:
    print(x-k*d)
elif (k-x//d)%2 ==1:
    print(abs(x%d-d))
else:
    print(x%d)

Buggy submission (verdict: Runtime Error):
x,k,d = ,ap(int,input().split())
x = abs(x)
if x-k*d>0:
    print(x-k*d)
elif (k-x//d)%2 ==1:
    print(abs(x%d-d))
else:
    print(x%d)
Problem p02613 (python)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print("AC x",s.count("AC"))
print("WA x",s.count("WA"))
print("TLE x",s.count("TLE"))
print("RE x",s.count("RE"))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]
print("AC x",s.count("AC"))
print("WA x",a.count("WA"))
print("TLE x",a.count("TLE"
Problem p02630 (python)

Fixed submission:
n = int(input())
a =list(map(int,input().split()))
s =sum(a)
x = [0]*1000001
for i in a:
    x[i] += 1

q = int(input())
for i in range(q):
    b,c = map(int,input().split())
    s -= b*x[b]
    s += c*x[b]
    x[c] += x[b]
    x[b] = 0
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =list(map(int,input().split()))
s =sum(a)
x = [0]*100001
for i in a:
    x[i] += 1

q = int(input())
for i in range(q):
    b,c = map(int(input().split()))
    s -= b*x[b]
    s += c*x[c]
    x[c] += x[b]
    x[b] = 0
    print(s)
Problem p02641 (python)

Fixed submission:
x,n = map(int,input().split())
p = list(map(int,input().split()))
for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
        exit()

Buggy submission (verdict: Runtime Error):
x,n = map(int,input()split())
p = list(map(int,input().split()))
for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
    exit()

Buggy submission (verdict: Runtime Error):
x,n = map(int,input()split())
p = lsit(map(int,input().split()))
for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
    exit()
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m = map(int,input().split())
a_s = (30*h)%360+0.5*m
b_s = (6*m)

s = max(a_s,b_s)-min(a_s,b_s)
ans = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(s)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,h,m = map(int,input().split())
a_S = (30*h)%360+0.5*m
b_s = (6*m)

s = max(a_s,b_s)-min(a_s,b_s)
ans = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(s)))
print(ans)
Problem p02678 (python)

Fixed submission:
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _i in range(m)]
 
visit = [-1 for _ in range(n)]
visit[0] = 0
tree = [[] for _ in range(n)]
for a, b in ab:
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
 
from collections import deque
q = deque([0])
while q:
    p = q.popleft()
    for i in tree[p]:
        if visit[i] < 0:
            visit[i] = p
            q.append(i)
if all(i >= 0 for i in visit):
    print("Yes")
    for i in visit[1:]:
        print(i+1)
else:
    print("No")

Buggy submission (verdict: Runtime Error):

Copy
Copy
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _i in range(m)]
 
visit = [-1 for _ in range(n)]
visit[0] = 0
tree = [[] for _ in range(n)]
for a, b in ab:
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
 
from collections import deque
q = deque([0])
while q:
    p = q.popleft()
    for i in tree[p]:
        if visit[i] < 0:
            visit[i] = p
            q.append(i)
if all(i >= 0 for i in visit):
    print("Yes")
    for i in visit[1:]:
        print(i+1)
else:
    print("No")
Problem p02690 (python)

Fixed submission:
x = int(input())
for i in range(-200,201):
    for j in range(-200,201):
        if i**5-j**5==x:
            print(i,j)
            exit()

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(-200,201):
    for j in range(-200,201):
        if i**5-j**5=x:
            print(i,j)
            exit()
Problem p02694 (python)

Fixed submission:
x = int(input())
ans = 0
a = 100
while a < x:
    a = int(a*1.01)
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = 0
a = 100
while a < x:
    t = int(t*1.01)
    ans += 1
print(ans)
Problem p02718 (python)

Fixed submission:
n,m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
s = sum(a)
for i in a:
    if i >= s/(4*m):
        ans += 1
if ans >= m:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
s = sum(a)
for i in range(a):
    if i >= s/(4*m):
        ans += 1
if ans >= m:
    print("Yes")
else:
    print("No")
Problem p02730 (python)

Fixed submission:
s = input()
n = len(s)
a = s[0:(n-1)//2]
b = s[(n+3)//2-1:n]
if s ==s[::-1] and a == a[::-1] and b == b[::-1] :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
a = s[::-1]
b = (s[0:((len(s)-1)//2])
c = (s[((len(s)*3)//2:-1])
if s == a and b == c:
    print("Yes")
else:
    print("No")
Problem p02731 (python)

Fixed submission:
l = int(input())
print((l/3)**3)

Buggy submission (verdict: Runtime Error):
l = int(input()
print((l/3)**3)
Problem p02741 (python)

Fixed submission:
k = int(input())
li = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[k-1])

Buggy submission (verdict: Runtime Error):
k = int(input())
li = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li(k-1))
Problem p02755 (python)

Fixed submission:
a,b = map(int,input().split())
import math
c = []
d =[]
for i in range(1300):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        c.append(i)
    else:
        d.append(i)
if len(c) ==0 :
    print(-1)
else:
    print(min(c))

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

for i in range(1300):
    if i == a*12.5 and b*10:
        print(i)
        exit()
print(-1)
Problem p02756 (python)

Fixed submission:
s = input()
q = int(input())
h,t = [],[]
p = 0

for i in range(q):
    c = input().split()
    if c[0] == '1':
        h,t = t,h
        p = 1-p
    else:
        if c[1] =='1':
            h.append(c[2])
        else:
            t.append(c[2])
if p ==1:
    s = s[::-1]
print("".join(h[::-1])+s+"".join(t))

Buggy submission (verdict: Runtime Error):
s = input()
q = int(ionput())
h,t = [],[]
p = 0

for i in range(q):
    c = input().split()
    if c[0] =='1':
        h,t = t,h
        p = 1-p
    else:
        if c[1] =='1':
            h.append(c[2])
        else:
            t.append(c[2])
if p ==1:
    s = s[::-1]
print("".join(h[::-1])+s+"".join(t))

Buggy submission (verdict: Runtime Error):
s = inmput()
q = int(ionput())
h,t = [],[]
p = 0

for i in range(q):
    c = input().split()
    if c[0] =='1':
        h,t = t,h
        p = 1-p
    else:
        if c[1] =='1':
            h.append(c[2])
        else:
            t.append(c[2])
if p ==1:
    s = s[::-1]
print("".join(h[::-1])+s+"".join(t))
Problem p02760 (python)

Fixed submission:
A=[list(map(int,input().split())) for i in range(3)]
n=int(input())
for k in range(n):
  s=int(input())
  for i in range(3):
    for j in range(3):
      if s == A[i][j]:
        A[i][j]=0   
if A[0][0]==0 and A[1][0]==0 and A[2][0]==0:
  print("Yes")
   
elif A[0][1]==0 and A[1][1]==0 and A[2][1]==0:
  print("Yes")
elif A[0][2]==0 and A[1][2]==0 and A[2][2]==0:
  print("Yes")
elif [0,0,0] in A:
  print("Yes")
  
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  
elif A[0][0]==0 and A[1][1]==0 and A[2][2]==0:
  print("Yes")
  
else:
  print("No")

Buggy submission (verdict: Runtime Error):
=[list(map(int,input().split())) for i in range(3)]
n=int(input())
for k in range(n):
  s=int(input())
  for i in range(3):
    for j in range(3):
      if s == A[i][j]:
        A[i][j]=0   
if A[0][0]==0 and A[1][0]==0 and A[2][0]==0:
  print("Yes")
   
elif A[0][1]==0 and A[1][1]==0 and A[2][1]==0:
  print("Yes")
elif A[0][2]==0 and A[1][2]==0 and A[2][2]==0:
  print("Yes")
elif [0,0,0] in A:
  print("Yes")
  
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  
elif A[0][0]==0 and A[1][1]==0 and A[2][2]==0:
  print("Yes")
  
else:
  print("No")
Problem p02761 (python)

Fixed submission:
n,m = map(int,input().split())
a = [list(map(int,input().split()))for i in range(m)]

for i in range(10**n):
    tmp = str(i)
    if len(tmp) == n:
        f = True
        for s,c in a:
            if tmp[s-1] != str(c):
                f = False
                break
        if f :
            print(i)
            exit()
print(-1)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [list(map(int,input().split()))]
for i in range(10**n):
    tmp = str(i)
    if len(tmp)== n:
        f = True
        for s,c in a:
            if tmp[s-1] != str(c):
                f = False
                break
        if f:
            print(i)
            exit()
print(-1)
Problem p02778 (python)

Fixed submission:
s = input()
t = len(s)
print("x"*t)

Buggy submission (verdict: Runtime Error):
s = input()
print(x*len(s))