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

Fixed submission:
import numpy as np
from collections import Counter

n, m = map(int, input().split())
a = [0] + list(map(int, input().split()))
a = np.array(a)
c = Counter(np.cumsum(a % m) % m)
print(sum(i * (i - 1) for i in c.values()) // 2)

Buggy submission (verdict: Runtime Error):
import numpy as np

n, m = map(int, input().split())
a = [0] + list(map(int, input().split()))

a = np.array(a)

_, c = np.unique(np.cumsum(a % m) % m, return_counts=True)

print((c * (c - 1)).sum() // 2)
Problem p03364 (python)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
st = [str().join(s_) for s_ in zip(*s)]

sol = 0

for i in range(n):
    for k in range(n):
        if s[k] != st[k]:
            break
    else:
        sol += 1
    
    s = [s_l[1:]+s_l[0] for s_l in s]
    st = st[1:] + [st[0]]
    
print(sol * n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]


def check

def yoi(s, b):
  for i in range(n):
    for j in range(i+1, n):
      if s[i % n][(j + b) % n] != s[j % n][(i + b) % n]:
        return 0
  return 1

sol = sum(yoi(s, b) for b in range(n))
print(sol * n)
Problem p02576 (python)

Fixed submission:
n,x,t=map(int,input().split())
if n%x!=0 :
    print((n//x+1) *t)
else:
    print((n//x)*t)

Buggy submission (verdict: Runtime Error):
n,x,t=map（int,input（）.split（））

if n%x==0 :
  print（（n//x）*t）
else :
  print（（n//x+1）*t）
Problem p02628 (python)

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

p.sort()
print(sum(p[0:K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
print(sum(p[0:K-1])
Problem p02640 (python)

Fixed submission:
x,y=map(int,input().split())  
 
if (y%2==0) and (2*x<=y<=4*x) :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())  

if (y%==0) and (2*x<=y<=4*x) :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())  
p=(y-2x)/2
if int(p) and 1<=p<=100 :
    print("Yes")
else :
    print("No")
Problem p02678 (python)

Fixed submission:
from collections import deque
n,m=map(int,input().split())
A=[[] for i in range(n)]
for i in range(m) :
    a,b=map(int,input().split())
    A[b-1].append(a-1)
    A[a-1].append(b-1)
depth=[-1]*n
visit=deque([0])

while True :
    if len(visit)==0 :
        break
    x=visit.popleft()
    for i in A[x] :
        if depth[i]==-1 :
            depth[i]=x+1
            visit.append(i)

print("Yes")
[print(i) for i in depth[1:]]

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
A=[[] for i in range(n)]
for i in range(m) :
    a,b=map(int,input().split())
    A[b-1].append(a-1)
    A[a-1].append(b-1)
depth=[0 for i in range(n)]


def search(now,sum) :
    if depth[now]!=0 : #すでに訪れていた場合
        sum+=1
        if sum<depth[now] :
            depth[now]=sum
            for i in A[now] :
                now=i
                search(now,sum)

    if depth[now]==0 :
        sum+=1
        depth[now]=sum
        for i in A[now] :
            now=i
            search(now,sum)
 
    return depth

B=search(0,0)
if B.count(0)==0 :
    print("Yes")
    for i in B[1:] :
        print(i-1)

else :
    print("No")
Problem p03409 (python)

Fixed submission:
from operator import itemgetter
N=int(input())
R=[list(map(int,input().split())) for n in range(N)]
B=[list(map(int,input().split())) for n in range(N)]
R.sort(key=itemgetter(1),reverse=True)
B.sort()
ans=0

for c,d in B :
    for a,b in R :
        if a<c and b<d :
            ans+=1
            R.remove([a,b])
            break

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
R=[list(map(int,input().split())) for n in range(N)]
B=[list(map(int,input().split())) for n in range(N)]

sorted(R,key=itemgetter(1),reverse=True)
B.sort()
ans=0

for c,d in B :
    for a,b in R :
        if a<c and b<d :
            ans+=1
            R.remove([a,b])
            break

print(ans)
Problem p03565 (python)

Fixed submission:
S=input()
T=input()
n=len(S)
m=len(T)

for i in range(n-m,-1,-1) :
    x=S[i:i+m]
    for j in range(m+1):
        if j==m :
            print((S[:i]+T+S[i+m:]).replace("?","a"))
            exit()
        if x[j]=="?" :
            continue
        elif x[j]!=T[j] :
            break
 
print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
n=len(S)
m=len(T)

for i in range(n-m+1,-1,-1) :
    x=S[i:i+m]
    for j in range(m+1):
        if j==m :
            print((S[:i]+T+S[i+m:]).replace("?","a"))
            exit()
        if x[j]=="?" :
            continue
        elif x[j]!=T[j] :
            break
 
print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
n=len(S)
m=len(T)

for i in range(n-m+1,-1,-1) :
    x=S[i:i+m]
    print(x)
    for j in range(m+1):
        if j==m :
            print((S[:i]+T+S[i+m:]).replace("?","a"))
            exit()
        if x[j]=="?" :
            continue
        elif x[j]!=T[j] :
            break
 
print("UNRESTORABLE")
Problem p02573 (python)

Fixed submission:
class UnionFind():
    def __init__(self,n):
        self.parents = [-1]*n

    def find(self,x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x,y = y,x
            
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        
N,M = map(int,input().split())    
uf = UnionFind(N)

for i in range(M):
    A,B = map(lambda x:int(x)-1,input().split())
    uf.union(A,B)
    #print(uf.parents)

print(abs(min(uf.parents)))

Buggy submission (verdict: Runtime Error):
class UnionFind():
    def __init__(self,n):
        self.parents = [-1]*n

    def find(self,x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x,y = y,x
            
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        
N,M = map(int,input().split())    
uf = UnionFind(N)

for i in range(M):
    A,B = map(int,input().split())
    uf.union(A,B)
    #print(uf.parents)

print(abs(min(uf.parents)))
Problem p02548 (python)

Fixed submission:
N = int(input())

counter = 0
for i in range(1,N):
    for j in range(1,min(i, int((N-1)/i))+1):
      if i == j:
        counter += 1
      else:
        counter += 2

print(counter)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

yakusu = [0] * N+1
yakusu[1] = 1
for i in range(2,N+1):
  for j in range(1,i):
    if i*j > N:
      break
    yakusu[i*j] += 2
    
  yakusu[i*i] += 1

counter = 0
for num in yakusu[1:N]:
  counter += num
      
print(counter)
Problem p02607 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
    if i%2==0 and a[i]%2!=0:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans =0
for i in range(0,n+1):
    if i%2==0 and a[i]%2!=0:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans =0
for i in range(n+1):
    if i%2==0 and a[i]%2!=0:
        ans+=1
print(ans)
Problem p02608 (python)

Fixed submission:
n= int(input())
ans= [0]*10001

for x in range(1,101):
    for y in range (1,101):
        for z in range(1,101):
            mul= x*x+y*y+z*z+x*y+y*z+z*x
            if  mul <= 10000:
                ans[mul]+=1

for i in range(1,n+1):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n= int(input())n= int(input())
ans= [0]*10001

for x in range(1,101):
    for y in range (1,101):
        for z in range(1,101):
            mul= x*x+y*y+z*z+x*y+y*z+z*x
            if  mul <= 10000:
                ans[mul]+=1

for i in range(1,n+1):
    print(ans[i])
Problem p03071 (python)

Fixed submission:
a,b = map(int,input().split())
c=0
for i in range(2):
	if a > b:
		c+=a
		a-=1
	else:
		c+=b
		b-=1

print(c)

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

c=0

for i in range(2):
	if a > b:
		c+=a
		a-=1
	else:
		c+=b
		b-=1

print(c)

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

if a > b:
	c=a
	a=a-1
else:
	c=b
	b=b-1
	
if a > b:
	c+=a
else:
	c+=b
	
print(c)
Problem p02612 (python)

Fixed submission:
n = int(input())
while n > 999:
    n = n % 1000
if n ==0:
    print(0)
else:
    print(1000-n)

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

ans = 1000-int(n[1:])
if(ans%1000==0):
    print(0)
else:print(ans)
Problem p02765 (python)

Fixed submission:
n, r = input().split(" ")
n=int(n)
r=int(r)
if n<10:
    print((100*(10-n))+r)
else:
    print(r)

Buggy submission (verdict: Runtime Error):
n, r = input().split(" ")
if n<10:
    print((100*(10-n))+r)
else:
    print(r)
Problem p02767 (python)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
m = round(sum(x)/n)
answer = 0
for i in x:
    answer += (i-m)**2
print(answer)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = input().split(" ")
x = [int(i) for i in x]
answer = 0
for index,i in enumerate(x):
    answer += pow((i - index), 2)
print(answer)

n = int(input())
x = list(map(int, input().split()))
m = round(sum(x)/n)
answer = 0
for i in x:
    answer += (i-m)**2
print(answer)
Problem p02553 (python)

Fixed submission:
a = input()
arr = [int(i)  for i in a.split()]

sum = []
sum.append(arr[0]*arr[2])
sum.append(arr[0]*arr[3])
sum.append(arr[1]*arr[2])
sum.append(arr[1]*arr[3])
print(max(sum))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
sum = []
sum.append(a*c)
sum.append(a*d)
sum.append(b*c)
sum.append(b*d)
print(max(sum))
Problem p02973 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 
import math
import sys
import bisect

# いっこ入力
n =int(input())

# n行の数をリストへ
a = [int(input()) for i in range(n)] 

# color
c = [-999]*n

for i in range(0,n):
#    if c[0] >= a[i]:
#        c.insert(0,a[i])
#    else:
    p = bisect.bisect_left(c, a[i])
    c[p-1]=a[i]
#        print(c)
#        print(p)

print(len(c) - bisect.bisect_left(c, -1))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np
import bisect

# いっこ入力
n =int(input())

# n行の数をリストへ
a = [int(input()) for i in range(n)] 

# color
c = [a[0]]

for i in range(1,n):
#    print(c)
#    print(p)
    if c[0] >= a[i]:
        c.insert(0,a[i])
    else:
        p = bisect.bisect_right(c, a[i]-1)
        c[p-1]=a[i]
#        c.sort()

print(len(c))
Problem p02995 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools

def lcm(m,n):
    p=max(m,n)
    q=min(m,n)
    if p % q == 0:
        return q
    else:
        return lcm(q,p%q)



# いくつか入力
a,b,c,d = (int(i) for i in input().split())  

x = b // c - (a-1) // c
y = b // d - (a-1) // d
e = c * d // lcm(c,d)
z = b // e - (a-1) // e

print(b-a+1-x-y+z)

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools

def gcd(m,n):
    p=max(m,n)
    q=min(m,n)
    if p % q == 0:
        return q
    else:
        return gcd(q,p%q)



# いくつか入力
a,b,c,d = (int(i) for i in input().split())  

x = b // c - (a-1) // c
y = b // d - (a-1) // d
e = c * d // lcm(c,d)
z = b // e - (a-1) // e

print(b-a+1-x-y+z)
Problem p03061 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools
import fractions

# ひとつ入力
n = int(input())
# リストに入れる
a = [int(i) for i in input().split()]

hidari = [0]*n
migi   = [0]*n
hidari[0] = a[0]
for i in range(1,n):
    hidari[i]=fractions.gcd(hidari[i-1],a[i])
migi[n-1] = a[n-1]
for i in range(n-2,-1,-1):
    migi[i]=fractions.gcd(migi[i+1],a[i])

saidai=max(migi[1],hidari[n-2])
for i in range(1,n-1):
    saidai = max(saidai, fractions.gcd(hidari[i-1],migi[i+1]))
#    print(fractions.gcd(hidari[i-1],migi[i+1]))
#print(hidari,migi)
print(saidai)

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())
# リストに入れる
a = [int(i) for i in input().split()] 

hidari = [0]*n
migi   = [0]*n
hidari[0] = a[0]
for i in range(1,n):
    hidari[i]=math.gcd(hidari[i-1],a[i])
migi[n-1] = a[n-1]
for i in range(n-2,-1,-1):
    migi[i]=math.gcd(migi[i+1],a[i])

saidai=max(migi[1],hidari[n-2])
for i in range(1,n-1):
    saidai = max(saidai, math.gcd(hidari[i-1],migi[i+1]))
#    print(math.gcd(hidari[i-1],migi[i+1]))
#print(hidari,migi)
print(saidai)
Problem p03081 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
n,q = (int(i) for i in input().split())  
# 文字列をリストに
s = list(input())

# n行複数列の数をリストに
td = [[i for i in input().split()] for i in range(q)] 


hidari = 0
migi   = n-1

for i in range(q-1,-1,-1):
    if td[i][0] == s[hidari] and td[i][1] == 'L':
        hidari += 1
        if hidari == n:
            print("0")
            exit()
    elif hidari >0:
        if td[i][0] == s[hidari-1] and td[i][1] == 'R' :
            hidari -= 1

for i in range(q-1,-1,-1):
    if td[i][0] == s[migi] and td[i][1] == 'R':
        migi -= 1
        if migi == -1:
            print("0")
            exit()
    elif migi <n-1:
        if td[i][0] == s[migi+1] and td[i][1] == 'L' :
            migi += 1

if migi < hidari:
    print("0")
else:
    print(migi-hidari+1)

#print(migi,hidari)

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
n,q = (int(i) for i in input().split())  
# 文字列をリストに
s = list(input())

# n行複数列の数をリストに
td = [[i for i in input().split()] for i in range(q)] 


hidari = 0
migi   = n-1

for i in range(q-1,-1,-1):
    if td[i][0] == s[hidari] and td[i][1] == 'L':
        hidari += 1

for i in range(q-1,-1,-1):
    if td[i][0] == s[migi] and td[i][1] == 'R':
        migi -= 1

if migi <= hidari:
    print("0")
else:
    print(migi-hidari+1)
Problem p03287 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
n,m = map(int, input().split())

# 空白区切りの数列をリストに代入
a = [int(i) for i in input().split()]
b = [0]*(n)
c ={0:1}
bb=0
for i in range(0,n) :
    bb = ( bb+a[i] ) % m
    c[bb] = c.get(bb,0) + 1
    
    
answer = 0
#print(c)

for i,j in c.items():
    if j > 1:
        answer +=  (j * (j-1) // 2 )

print(answer)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
n,m = map(int, input().split())

# 空白区切りの数列をリストに代入
a = [int(i) for i in input().split()]
b = [0]*(n)
c = [0]*(m)
bb=0
c[0]=1
for i in range(0,n) :
    bb = ( bb+a[i] ) % m
    c[bb] += 1
    
    
answer = 0
#print(c)
for i in range(0,m):
    if c[i] > 1:
        answer +=  (c[i] * (c[i]-1) // 2 )

print(answer)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
n,m = map(int, input().split())

# 空白区切りの数列をリストに代入
a = [int(i) for i in input().split()]
b = [0]*(n)
c = [0]*(m)
bb=0
c[0]=1
for i in range(0,n) :
    bb = ( bb+a[i] ) % m
    c[bb] += 1
    
    
answer = 0
print(c)
for i in range(0,m):
    if c[i] > 1:
        answer +=  (c[i] * (c[i]-1) // 2 )

print(answer)
Problem p03297 (python)

Fixed submission:
#
import sys

n = int(input())
a=[]
b=[]
c=[]
d=[]
for j in range(0,n):
    t1,t2,t3,t4 = (int(i) for i in input().split())  
    a.append(t1)
    b.append(t2)
    c.append(t3)
    d.append(t4)
    
for i in range(0,n):
    if a[i] < b[i]:
        print("No")
    elif d[i] < b[i]:
        print("No")
    else:
        p= b[i]
        q= d[i]
        while p%q :
            r=q
            q=p%q
            p=r
        if (b[i]-q)+a[i]%q > c[i]:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
#
import sys
from fraction import gcd

n = int(input())
a=[]
b=[]
c=[]
d=[]
for j in range(0,n):
    t1,t2,t3,t4 = (int(i) for i in input().split())  
    a.append(t1)
    b.append(t2)
    c.append(t3)
    d.append(t4)
    
for i in range(0,n):
    if a[i] < b[i]:
        print("No")
    elif d[i] < b[i]:
        print("No")
    else:
        flag=1
        p= gcd(b[i],d[i])
        if (b[i]-p)+a[i]%p > c[i]:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
#
import sys
from math import gcd

n = int(input())
a=[]
b=[]
c=[]
d=[]
for j in range(0,n):
    t1,t2,t3,t4 = (int(i) for i in input().split())  
    a.append(t1)
    b.append(t2)
    c.append(t3)
    d.append(t4)
    
for i in range(0,n):
    if a[i] < b[i]:
        print("No")
    elif d[i] < b[i]:
        print("No")
    else:
        flag=1
        p= gcd(b[i],d[i])
        if (b[i]-p)+a[i]%p > c[i]:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
#
import sys
from math import *
import numpy as np
import itertools

n = int(input())
a=[]
b=[]
c=[]
d=[]
for j in range(0,n):
    t1,t2,t3,t4 = (int(i) for i in input().split())  
    a.append(t1)
    b.append(t2)
    c.append(t3)
    d.append(t4)
    
for i in range(0,n):
    if a[i] < b[i]:
        print("No")
    elif d[i] < b[i]:
        print("No")
    else:
        flag=1
        p= gcd(b[i],d[i])
        if (b[i]-p)+a[i]%p > c[i]:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools

n = int(input())
a=[]
b=[]
c=[]
d=[]
for j in range(0,n):
    t1,t2,t3,t4 = (int(i) for i in input().split())  
    a.append(t1)
    b.append(t2)
    c.append(t3)
    d.append(t4)
    
for i in range(0,n):
    if a[i] < b[i]:
        print("No")
    elif d[i] < b[i]:
        print("No")
    else:
        flag=1
        p= math.gcd(b[i],d[i])
        if (b[i]-p)+a[i]%p > c[i]:
            print("No")
        else:
            print("Yes")
Problem p03353 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

e = input()
num =int(input())

a = []

for i in range(len(e)) :
    for j in range(i+1,i+6):
        if e[i:j] not in a:
            a.append(e[i:j])

b = list(set(a))
b.sort()
print(b[num-1])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np
 
e = list(input())
num =int(input())
 
 
alpha = list("abcdefghijklmnopqrstuvwxyz")
n = len(e)
a=[0]*(n+5)
#print(alpha)
for t in range(n) :
    for k in range(26):
        if alpha[k] == e[t]:
            a[t] = k
            break
#print(a)
 
ma = [-1]*5
mlen = 1
 
b= [1]*n
for k in range(n):
    b[k]= a[k]
ma[0] = np.argmin(b)
 
#print(ma[0],e[ma[0]])
 
for i in range(1,num):
#    print(b, ma[i-1], n, mlen)
    if ma[i-1] < (n-mlen):
        for k in range(n):
            b[k]= b[k] * 26 + a[k+mlen] 
        mlen += 1
    else:
        b[n-i]= 26 ** 5
        mlen = 1
 
    ma[i] = np.argmin(b)
 
#    for j in range(1,mlen+1):
#        print(e[ma[i]+j-1],end='')
#    print("")
 
for j in range(1,mlen+1):
    print(e[ma[num-1]+j-1],end='')
print("")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

e = list(input())
num =int(input())


alpha = list("abcdefghijklmnopqrstuvwxyz")
n = len(e)
a=[0]*(n+5)
#print(alpha)
for t in range(n) :
    for k in range(26):
        if alpha[k] == e[t]:
            a[t] = k
            break
#print(a)

ma = [-1]*5
mlen = 1

b= [1]*n
for k in range(n):
    b[k]= a[k]
ma[0] = np.argmin(b)

#print(ma[0],e[ma[0]])

for i in range(1,num):
    print(mlen)
    if ma[i] <= (n-mlen):
        for k in range(n-mlen):
            b[k]= b[k] * 26 + a[k+mlen] 
        mlen += 1
    b[n-i]= 26 ** 5

    ma[i] = np.argmin(b)
    for j in range(1,mlen+1):
        print(e[ma[i]+j-1],end='')
    print("")
Problem p02801 (python)

Fixed submission:
# !/use/bin/python3

"""
https://atcoder.jp/contests/abc151/tasks/abc151_a
Next Alphabate
"""

def solve(c):
    ans = ord(c)
    return chr(ans+1)

if __name__ == "__main__":
    c = input()
    print(solve(c))

Buggy submission (verdict: Runtime Error):
# !/usr/bin/python3

"""
https://atcoder.jp/contests/abc151/tasks/abc151_c
Welcome at atcoder
"""


if __name__ == "__main__":
    n, m = list(map(int, input().split()))

    accepted = [False for _ in range(n+5)]
    wrong = [0 for _ in range(n+5)]
    ac = wa = 0

    for _ in range(m):
        p, s = input().split()
        p = int(p)

        if accepted[p]: continue
        elif s == "WA": wrong[p] += 1
        elif s == "AC":
            ac += 1
            wa += wrong[p]
            accepted[p] = True

    print(ac, wa)
Problem p02741 (python)

Fixed submission:
text = "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"

li = list(map(int, text.split(', ')))

k = int(input())

print(li[k - 1])

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())

if h % 2 == 0:
    ans = h / 2 * w
elif w % 2 == 0:
    ans = (h - 1) / 2 * w / 2 + (h + 1) / 2 * w / 2
else:
    ans = (h - 1) / 2 * (w - 1) / 2 + (h + 1) / 2 * (w + 1) / 2

if h == 1 or w == 1:
    ans = 1

print(int(ans))

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())

if h % 2 == 0:
    ans = h / 2 * w
elif w % 2 == 0:
    ans = (h - 1) / 2 * w / 2 + (h + 1) / 2 * w / 2
else:
    ans = (h - 1) / 2 * (w - 1) / 2 + (h + 1) / 2 * (w + 1) / 2

if h == 1 or w == 1:
    ans = 1

print(int(ans))
Problem p02641 (python)

Fixed submission:
N,M=map(int, input().split())
import numpy as np
def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

if M==0:
    print(N)
else:
    check_set=set(map(int, input().split()))
    ans_set = set([i for i in range(-1,102)])
    lst = list(ans_set-check_set)
    sorted_lst=sorted(lst)
    print(getNearestValue(sorted_lst, N))

Buggy submission (verdict: Runtime Error):
# Crank
N,M=map(int, input().split())
import numpy as np
def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

if M==0:
    print(N)
else:
    check_set=set(map(int, input().split()))
    ans_set = set([i for i in range(1,101)])
    lst = list(ans_set-check_set)
    print(getNearestValue(lst, N))
Problem p02615 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
ans=0
x=n
for i in range(1,n):
  ans+=a[i//2]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int.input().split()))
a.sort(reverse=True)
ans=0
x=n
for i in range(1,n):
  ans+=a[i//2]
print(ans)