Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = str(input())

if N[-1] = "7" or N[-2] = "7" or N[-3] = "7":
    print("Yes")
else:
  	print("No")

Fixed submission:
N = str(input())

if N[-1] == "7" or N[-2] == "7" or N[-3] == "7":
    print("Yes")
else:
  	print("No")

Buggy python submission (verdict: Runtime Error):
N = str(input())
 
if N[-1] = "7" or N[-2] = "7" or N[-3] = "7":
    print("Yes")
else:
  	print("No")

Fixed submission:
N = str(input())

if N[-1] == "7" or N[-2] == "7" or N[-3] == "7":
    print("Yes")
else:
  	print("No")

Buggy python submission (verdict: Runtime Error):
N = str(input())

if N[-1] = 7 or N[-2] = 7 or N[-3] = 7:
    print("Yes")
else:
  	print("No")

Fixed submission:
N = str(input())

if N[-1] == "7" or N[-2] == "7" or N[-3] == "7":
    print("Yes")
else:
  	print("No")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
l = list(map(int, input().split()))  

S = sum(l)

lr = [i for i in l if i >= S/4M]

if len(lr) >= M:
  	print("Yes")
else:
  	print("No")

Fixed submission:
N, M = map(int, input().split())
l = list(map(int, input().split()))  
 
S = sum(l)
X = 4*M
 
lr = [i for i in l if i >= S/X]
 
if len(lr) >= M:
  	print("Yes")
else:
  	print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int, input().split())
         
L = [i for i in l if i % 2 == 0]

K = [i for i in L if i % 3 != 0]

J = [i for i in K if i % 5 != 0]
         
if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")

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

L = [i for i in l if i % 2 == 0]
K = [i for i in L if i % 3 != 0]
J = [i for i in K if i % 5 != 0]

if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")

Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int, input().split())
         
L = [i for i in l if i % 2 == 0]

K = [i for i in L if i % 3 != 0]

J = [i for i in K if i % 5 != 0]
         
if len(J) == 0:
         print("APPROVED")
else:
         print("DENIED")

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

L = [i for i in l if i % 2 == 0]
K = [i for i in L if i % 3 != 0]
J = [i for i in K if i % 5 != 0]

if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")
Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
l = [input() for _ in range(N)]

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

for i in a[0:]:
print(i)

Fixed submission:
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)

Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
l = [input() for _ in range(N)]

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

for i in a[0:]:
print(i)

Fixed submission:
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)

Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
l = [input() for _ in range(H)]

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

for i in a[0:]:
print(i)

Fixed submission:
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)

Buggy python submission (verdict: Runtime Error):
import collections
 
N = int(input())
l = [input() for _ in range(H)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b + 1]
 
for i in a[0:]:
print(i)

Fixed submission:
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)

Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
l = [input() for _ in range(H)]

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

[print(i) for i in a]

Fixed submission:
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)
Buggy python submission (verdict: Runtime Error):
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

if U = S:
  	A -= 1
else:
  	B -= 1

print(A),
print(B)

Fixed submission:
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

if U == S:
  	A -= 1
else:
  	B -= 1

print(A),
print(B)
Buggy python submission (verdict: Runtime Error):
K, X = map(int,input().split())
if 500K >= X:
  	print('Yes')
else:
    print('No')

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

if 500*K >= X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
AS = list(map(int,input().split()))
zero=False
sum = 1
la=len(AS)
for i in range(la):
  A=AS[i]
  if A==0:
    zero=True
    break
  sum = sum * A
if zero==True:
  print(0)
else:
  if sum > 10**18:
    print(-1)
  else:
    print(sum)

Fixed submission:
N=int(input())
AS = list(map(int,input().split()))
if 0 in AS:
  print(0)
  exit()
s = 0
sum = 1
l=len(AS)
for i in range(l):
  A=AS[i]
  sum = sum * A
  if sum > 10**18:
    s=2
    break
if sum > 10**18:
  print(-1)
else:
  print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
AS = list(map(int,input().split()))
zero=False
sum = 1
for i in range(len(AS)):
  A=AS[i]
  if A==0:
    zero=True
    break
  sum = sum * A
if zero==True:
  print(0)
else:
  if sum > 10**18:
    print(-1)
  else:
    print(sum)

Fixed submission:
N=int(input())
AS = list(map(int,input().split()))
if 0 in AS:
  print(0)
  exit()
s = 0
sum = 1
l=len(AS)
for i in range(l):
  A=AS[i]
  sum = sum * A
  if sum > 10**18:
    s=2
    break
if sum > 10**18:
  print(-1)
else:
  print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
AS = list(map(int,input().split()))
zero=False
sum = 1
for i in range(len(AS)):
  if AS[i]==0:
    zero=True
    break
  sum = sum * AS[i]
if zero==True:
  print(0)
else:
  if sum > 10**18:
    print(-1)
  else:
    print(sum)

Fixed submission:
N=int(input())
AS = list(map(int,input().split()))
if 0 in AS:
  print(0)
  exit()
s = 0
sum = 1
l=len(AS)
for i in range(l):
  A=AS[i]
  sum = sum * A
  if sum > 10**18:
    s=2
    break
if sum > 10**18:
  print(-1)
else:
  print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
#front small ng
def checkFront(start,a):
  nowIndex = start
  for i in range(len(a)):
    #print("hikaku",a[start],a[nowIndex])
    if(a[start] > a[nowIndex]):
      #print("out")
      return 0
    else:
      if(nowIndex == 0):
        #print("ok")
        return 1
      else:
        nowIndex -= 1

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

ans = 0

for i in range(n):
  ans += checkFront(i,a)
  #print(i,ans)
print(ans)

Fixed submission:
#front small ng
def checkFront(start,a):
  global smallest
  nowIndex = start
  if(a[start] > smallest):
      #print("out")
      return 0
  else:
    smallest = a[start]
    return 1

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

smallest = a[0]
ans = 0

for i in range(n):
  ans += checkFront(i,a)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alist = list(str)

print(alist)

Fixed submission:
d = input()

if(d == "SAT"):
  print(1)
elif(d == "SUN"):
  print(7)
elif(d == "MON"):
  print(6)
elif(d == "TUE"):
  print(5)
elif(d == "WED"):
  print(4)
elif(d == "THU"):
  print(3)
elif(d == "FRI"):
  print(2)
Buggy python submission (verdict: Runtime Error):
n,q = input().split()
#print(str(n))
#print(str(q))

n = int(n)
q = int(q)
a = [0] * (n-1)
b = [0] * (n-1)
p = [0] * q
x = [0] * q
counter = [0] * n
children = []
parent = [-1] * n

for c in range(n):
  children.append(str(c+1))
#print(children)

for i in range(n-1):
  a[i],b[i] = input().split()
  parent[int(b[i]) - 1] = int(a[i])-1#親の配列インデックス
  children[int(a[i])-1]+=(" "+b[i])
  children[parent[int(a[i])-1]] += (" "+b[i])

for j in range(q):
  p[j],x[j] = input().split()
  list = children[int(p[j])-1].split()
  #print(list)
  for aa in list:
    counter[int(aa)-1] += int(x[j])
for bb in counter:
  print(bb, end="")
  print(" ", end="") 

Fixed submission:
a = int(input())
s = input()

if(a >= 3200):
  print(s)
else:
  print("red")

Buggy python submission (verdict: Runtime Error):
n,q = input().split()
#print(str(n))
#print(str(q))
 
n = int(n)
q = int(q)
a = [0] * (n-1)
b = [0] * (n-1)
p = [0] * q
x = [0] * q
counter = [0] * n
children = []
parent = [-1] * n
 
for c in range(n):
  children.append(str(c+1))
#print(children)
 
for i in range(n-1):
  a[i],b[i] = input().split()
  parent[int(b[i]) - 1] = int(a[i])-1#親の配列インデックス
  children[int(a[i])-1]+=(" "+b[i])
  children[parent[int(a[i])-1]] += (" "+b[i])
 
for j in range(q):
  p[j],x[j] = input().split()
  list = children[int(p[j])-1].split()
  #print(list)
  for aa in list:
    counter[int(aa)-1] += int(x[j])
for bb in counter:
  print(bb, end="")
  print(" ", end="")

Fixed submission:
a = int(input())
s = input()

if(a >= 3200):
  print(s)
else:
  print("red")
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations, combinations
n = int(input())
s = []
for _ in range(n):
  s.append(input())
 
ilist = []
for a in range(len(s)):
  ilist.append(list(s[a]))
 
for ss in range(len(ilist)):
  ilist[ss].sort()
 
li = list(combinations(ilist, 2))
ans = 0
 
for b in range(len(li)):
  if(li[b][0] == li[b][1]):
    ans += 1
print(ans)

Fixed submission:
from collections import *
 
n = int(input())
dic = defaultdict(int)
for i in range(n):
  dic["".join(sorted(input()))] += 1
 
ans = 0
for k,v in dic.items(): 
  ans += int(v*(v-1)/2)
  #ans += v*(v-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations, combinations
n = int(input())
s = []
for _ in range(n):
  s.append(input())

ilist = []
for a in range(len(s)):
  ilist.append(list(s[a]))

for ss in range(len(ilist)):
  ilist[ss].sort()

li = list(combinations(ilist, 2))
ans = 0

for b in range(len(li)):
  if(li[b][0] == li[b][1]):
    ans += 1
print(ans)

Fixed submission:
from collections import *
 
n = int(input())
dic = defaultdict(int)
for i in range(n):
  dic["".join(sorted(input()))] += 1
 
ans = 0
for k,v in dic.items(): 
  ans += int(v*(v-1)/2)
  #ans += v*(v-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations, combinations
n = int(input())
s = []
for _ in range(n):
  s.append(input())

ilist = []
for a in range(len(s)):
  ilist.append(list(s[a]))
  a += 1
#print(ilist)
for ss in range(len(ilist)):
  ilist[ss].sort()
#print(ilist)
li = list(combinations(ilist, 2))
trial = len(li)#何回比較するか求める
ans = 0 #answer
  
for b in range(len(li)):
  if(li[b][0] == li[b][1]):
    ans += 1
print(ans)

Fixed submission:
from collections import *
 
n = int(input())
dic = defaultdict(int)
for i in range(n):
  dic["".join(sorted(input()))] += 1
 
ans = 0
for k,v in dic.items(): 
  ans += int(v*(v-1)/2)
  #ans += v*(v-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations, combinations
n = int(input())
s = []
for _ in range(n):
  s.append(input())

ilist = []
for a in range(len(s)):
  ilist.append(list(s[a]))
  a += 1
#print(ilist)
li = list(combinations(ilist, 2))
trial = len(li)#何回比較するか求める
ans = 0 #answer
for b in range(len(li)):
  li[b][0].sort()
  li[b][1].sort()
  if(li[b][0] == li[b][1]):
    ans += 1
print(ans)

Fixed submission:
from collections import *
 
n = int(input())
dic = defaultdict(int)
for i in range(n):
  dic["".join(sorted(input()))] += 1
 
ans = 0
for k,v in dic.items(): 
  ans += int(v*(v-1)/2)
  #ans += v*(v-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())

ans = 0

if(a > b):
  ans += a
  a -= 1
else:
  ans += b
  b -= 1

if(a > b):
  ans += a
  a -= 1
else:
  ans += b
  b -= 1
print(ans)

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

ans = 0
 
if(a > b):
  ans += a
  a -= 1
else:
  ans += b
  b -= 1
 
if(a > b):
  ans += a
  a -= 1
else:
  ans += b
  b -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
p = 1
for i in range(k):
    p *= arr[i]
for i in range(k, n):
    l = p
    l /= arr[i-k]
    l *= arr[i]
    if l > p:
        print("Yes")
    else:
        print("No")
    p = l

Fixed submission:
n, k = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
for i in range(k, n):
    if arr[i] > arr[i-k]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
t = int(input())
arr = [int(x) for x in input().split()]
n = 1
flag = True
for i in range(t):
    n *= arr[i]
    if n > 10**18:
        flag = False
    else:
        flag = True
if flag:
    print(n)
else:
    print(-1)


Fixed submission:
t = int(input())
arr = [int(x) for x in input().split()]
n = 1
flag = True
if 0 in arr:
    print(0)
else:
    for i in range(t):
        n *= arr[i]
        if n > 10**18:
            flag = False
            break
    if flag:
        print(n)
    else:
        print(-1)
Buggy python submission (verdict: Runtime Error):
x=int(input())
  if (x>=400 and x<=599):
    print("8")
  elif (x>=600 and x<=799):
    print("7")
  elif (x>=800 and x<=999):
    print("6")
  elif (x>=1000 and x<=1199):
    print("5")
  elif (x>=1200 and x<=1399):
    print("4")
  elif (x>=1400 and x<=1599):
    print("3")
  elif (x>=1600 and x<=1799):
    print("2")
  elif (x>=1800 and x<=1999):
    print("1")

Fixed submission:
x=int(input())
if (x>=400 and x<=599):
  print("8")
elif (x>=600 and x<=799):
  print("7")
elif (x>=800 and x<=999):
  print("6")
elif (x>=1000 and x<=1199):
  print("5")
elif (x>=1200 and x<=1399):
  print("4")
elif (x>=1400 and x<=1599):
  print("3")
elif (x>=1600 and x<=1799):
  print("2")
elif (x>=1800 and x<=1999):
  print("1")

Buggy python submission (verdict: Runtime Error):
x=int(integer)
  if 400<=x and x<=599:
    print("8")
  elif 600<=x and x<=799:
    print("7")
  elif 800<=x and x<=999:
    print("6")
  elif 1000<=x and x<=1199:
    print("5")
  elif 1200<=x and x<=1399:
    print("4")
  elif 1400<=x and x<=1599:
    print("3")
  elif 1600<=x and x<=1799:
    print("2")
  elif 1800<=x and x<=1999:
    print("1")


Fixed submission:
x=int(input())
if (x>=400 and x<=599):
  print("8")
elif (x>=600 and x<=799):
  print("7")
elif (x>=800 and x<=999):
  print("6")
elif (x>=1000 and x<=1199):
  print("5")
elif (x>=1200 and x<=1399):
  print("4")
elif (x>=1400 and x<=1599):
  print("3")
elif (x>=1600 and x<=1799):
  print("2")
elif (x>=1800 and x<=1999):
  print("1")

Buggy python submission (verdict: Runtime Error):
x=int(integer)
  if 400<=x<=599:
    print("8")
  elif 600<=x<=799:
    print("7")
  elif 800<=x<=999:
    print("6")
  elif 1000<=x<=1199:
    print("5")
  elif 1200<=x<=1399:
    print("4")
  elif 1400<=x<=1599:
    print("3")
  elif 1600<=x<=1799:
    print("2")
  elif 1800<=x<=1999:
    print("1")

Fixed submission:
x=int(input())
if (x>=400 and x<=599):
  print("8")
elif (x>=600 and x<=799):
  print("7")
elif (x>=800 and x<=999):
  print("6")
elif (x>=1000 and x<=1199):
  print("5")
elif (x>=1200 and x<=1399):
  print("4")
elif (x>=1400 and x<=1599):
  print("3")
elif (x>=1600 and x<=1799):
  print("2")
elif (x>=1800 and x<=1999):
  print("1")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
total = 0
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    for k in range(j + 1, N):
      if j - i != k - j:
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
          total += 1
print(total)

Fixed submission:
N = int(input())
S = input()
r,g,b = 0,0,0
for i in S:
  if i == 'R':
    r += 1
  elif i == 'G':
    g += 1
  else:
    b += 1
minus = 0
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    k = 2 * j - i
    if k >= N:
      continue
    if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
      minus += 1
print(r*g*b - minus)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
r = []
g = []
b = []

def greedy(s, l1, l2):
  total = 0
  for i in l1:
    for j in l2:
      if s < i < j:
        if i - s != j - i:
          total += 1
  return total

for i in range(N):
  if S[i] == 'R':
    r.append(i)
  elif S[i] == 'G':
    g.append(i)
  else:
    b.append(i)

total = 0
for i in range(N):
  if S[i] == 'R':
    total += greedy(i, g, b)
    total += greedy(i, b, g)
  elif S[i] == 'G':
    total += greedy(i, b, r)
    total += greedy(i, r, b)  
  else:
    total += greedy(i, r, g)
    total += greedy(i, g, r)
print(total)  
      

Fixed submission:
N = int(input())
S = input()
r,g,b = 0,0,0
for i in S:
  if i == 'R':
    r += 1
  elif i == 'G':
    g += 1
  else:
    b += 1
minus = 0
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    k = 2 * j - i
    if k >= N:
      continue
    if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
      minus += 1
print(r*g*b - minus)
Buggy python submission (verdict: Runtime Error):
X = int(input())
pleasure += (X // 500) * 1000
X //= 500
pleasure += (X // 5) * 5
print(pleasure)

Fixed submission:
X = int(input())
pleasure = (X // 500) * 1000
X %= 500
pleasure += (X // 5) * 5
print(pleasure)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a_ch = [chr(ch) for ch in range(ord('a'), ord('j'))]

def DFS(s, mx):
  if len(s) == N:
    print(s)
  else:
    for i in range(mx + 1):
      if i == mx:
        DFS(s + a_ch[i], mx + 1)
      else:
        DFS(s + a_ch[i], mx)

DFS('', 0)

Fixed submission:
N = int(input())
a_ch = [chr(ch) for ch in range(ord('a'), ord('j') + 1)]

def DFS(s, mx):
  if len(s) == N:
    print(s)
  else:
    for i in range(mx + 1):
      if i == mx:
        DFS(s + a_ch[i], mx + 1)
      else:
        DFS(s + a_ch[i], mx)

DFS('', 0)
Buggy python submission (verdict: Runtime Error):
S = input()
c = S.count('A') 
if s == 3 or s == 0:
  print('No')
else:
  print('Yes')

Fixed submission:
S = input()
c = S.count('A') 
if c == 3 or c == 0:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
rev = False
for i in range(Q):
  l = input().split()
  if l[0] == '1':
    rev = not rev
  else:
    if rev:
      left = l[2]
      right = S
    else:
      left = S
      right = l[2]
    if l[1] == '1':
      S = right + left
    else:
      S = left + right
if rev:
  print(S[::-1])
else:
  print(S)

Fixed submission:
S = input()
Q = int(input())
left = []
right = []
rev = False
for i in range(Q):
  l = input().split()
  if l[0] == '1':
    rev = not rev
  else:
    if (l[1] == '1' and not rev) or (l[1] == '2' and rev):
      left.append(l[2])
    else:
      right.append(l[2])
S = ''.join(left[::-1]) + S + ''.join(right)
if rev:
  print(S[::-1])
else:
  print(S)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
	s_num = '1' + '0' * (N - 1)
for i in range(M):
  s, c = map(int, input().split())
  if N != 1 and (s == 1 and c == 0):
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)
  

Fixed submission:
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
  s_num = '1' + '0' * (N - 1)
ans = int(s_num)
for i in range(M):
  s, c = map(int, input().split())
  if N != 1 and (s == 1 and c == 0):
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
  s_num = '1' + '0' * (N - 1)
for i in range(M):
  s, c = map(int, input().split())
  if s == 1 and c == 0:
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)
  

Fixed submission:
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
  s_num = '1' + '0' * (N - 1)
ans = int(s_num)
for i in range(M):
  s, c = map(int, input().split())
  if N != 1 and (s == 1 and c == 0):
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = 0
else:
	s_num = '1' + '0' * (N - 1)
for i in range(M):
  s, c = map(int, input().split())
  if s == 1 and c == 0:
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)
  

Fixed submission:
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
  s_num = '1' + '0' * (N - 1)
ans = int(s_num)
for i in range(M):
  s, c = map(int, input().split())
  if N != 1 and (s == 1 and c == 0):
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)
Buggy python submission (verdict: Runtime Error):
#i桁めをそのまま払うかi+1桁めの額の紙幣で支払うかでDP
N = input()
digit = len(N)
l_N = [0] * digit
for i in range(1, digit + 1):
  l_N[i - 1] = int(N[-i])
dp = 0
for i in range(digit):
  dp += min(l_N[i], 10 - l_N[i] + 1)
  #print(dp)
print(dp)

Fixed submission:
a,b,c = map(int, input().split())
if a == b and b != c:
  print('Yes') 
elif b == c and c != a:
  print('Yes')
elif c == a and a != b:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
d = {}
for i in range(N):
  key = input()
  if key in d:
    d[key] += 1
  else:
    d[key] = 1

l_max = [kv[0] for kv in d.items() if kv[1] == max(d.values())]
l_max.sort()
for ch in l_max:
  print(ch)

Fixed submission:
N = int(input())
d = {}
for i in range(N):
  key = input()
  if key in d:
    d[key] += 1
  else:
    d[key] = 1
d_max = max(d.values())
l_max = [kv[0] for kv in d.items() if kv[1] == d_max]
l_max.sort()
for ch in l_max:
  print(ch)