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

Fixed submission:
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
cnt = 0
sum = 0
flag = 0
T = X = Y = 0
for i in range(N):
    cnt = x[i][0] - T
    sum = abs(x[i][1]- X) + abs(x[i][2]- Y)
    T = x[i][0]
    X = x[i][1]
    Y = x[i][2]
    if cnt < sum or cnt % 2 != sum % 2:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
cnt = 0
sum = 0
flag = 0
T = X = Y = 0 
for i in range(N):
        cnt = x[i][0] - T
        sum = abs(x[i][1]- X) + abs(x[i][2]- Y)
        T = x[i][0]
        X = x[i][1]
        Y = x[i][2]
    if cnt < sum or cnt % 2 != sum % 2:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
cnt = 0
sum = 0
flag = 0
for i in range(N):
    if i == 0:
        cnt = x[i][0]
        sum = x[i][1]
    else:
        cnt = x[i][0] - x[i-1][0]
        sum = x[i][1]+x[i][2] - x[i-1][1]+x[i-1][2]
    if cnt >= sum and cnt % sum == 0:
        flag = 0
    else:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")
Problem p03679 (python)

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

Buggy submission (verdict: Runtime Error):
x,a,b = map(int, input().spilit())
if(a>=b):
  print("delicious")
else:
  if(b-a >x):
    print("dangerous")
  else:
    print("safe")
Problem p02718 (python)

Fixed submission:
import numpy as np
N, M = map(int,input().split())
A = np.array(list(map(int,input().split())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
if A[A >= A.sum()/(4*M)].count()>=M:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
A[A >= A.sum()/(4*M)].count() >= M
Problem p02818 (python)

Fixed submission:
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
    B_after=B
elif K>=A:
    A_after=0
    if K-A<B:
        B_after=B-(K-A)
    elif K-A>=B:
        B_after=0
print(A_after, B_after)

Buggy submission (verdict: Runtime Error):
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
elif K>=A:
    A_after=0
    if K-A<B:
        B_after=B-(K-A)
    elif K-A>=B:
        B_after=0
print(A_after, B_after)

Buggy submission (verdict: Runtime Error):
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
elif K>=A:
    A_after=0
    if K-A<B:
            B_after=B-(K-A)
        elif K-A>=B:
            B_after=0
print(A_after, B_after)
Problem p02706 (python)

Fixed submission:
import sys
N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s = N - s
if s < 0:
  print(-1)
else:
  print(s)

Buggy submission (verdict: Runtime Error):
N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s -= N
if s < 0:
  print(-1)
else:
  print(s)
Problem p02713 (python)

Fixed submission:
import sys

K=int(sys.stdin.readline().rstrip())
 
def gcd(a,b):

    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

cnt1 = 0
cnt2 = 0
cnt3 = 0
for n1 in range(0,K):
    cnt1 += n1+1
    for n2 in range(n1+1, K):
        temp = gcd(n1+1, n2+1)
        cnt2 += temp*6
        for n3 in range(n2+1, K):
            cnt3 += gcd(temp, n3+1)*6
        

ans = cnt1 + cnt2 + cnt3
print(ans)

Buggy submission (verdict: Runtime Error):
K=int(sys.stdin.readline().rstrip())

def gcd(a,b):

    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

cnt1 = 0
cnt2 = 0
cnt3 = 0
for n1 in range(K):
    for n2 in range(K):
        temp = gcd(n1+1, n2+1)
        for n3 in range(K):
            cnt3 += gcd(temp, n3+1)
        

ans = cnt1 + cnt2 + cnt3
print(ans)
Problem p02923 (python)

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

if N == 1:
  ans = 0
else:
  temp = 0
  ans = 0
  for n in range(N-1):
    l, r = H[n], H[n+1]
    if r > l:
      temp = 0
    else:
      temp += 1
    ans = max(ans, temp)
    
print(ans)

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

if N == 1:
  ans = 0
else:
  temp = 0
  for n in range(N-1):
    l, r = H[n], H[n+1]
    if r > l:
      temp = 0
    else:
      temp += 1
    ans = max(ans, temp)
    
print(ans)
Problem p02924 (python)

Fixed submission:
N = int(input())

if N==1:
  ans = 0
elif N==2:
  ans = 1
else:
  ans = ((N-1)*N)//2
  
print(ans)

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

if N==1:
  ans = 0
elif N==2:
  ans = 1:
else:
  ans = ((N-1)*N)//2 + N%2
  print(ans)
  
print(ans)
Problem p03103 (python)

Fixed submission:
N, M = list(map(int, input().split()))
C = []
for n in range(N):
  A, B = list(map(int, input().split()))
  C.append([A,B])
  
C = sorted(C, key=lambda x:x[0])

S = 0
num = 0
n1 = 0
n2 = 0
while num < M:
  if n2 == C[n1][1]:
    n1 += 1
    n2 = 0
  S += C[n1][0]
  num += 1
  n2 += 1
 
print(S)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().spliit()))
C = []
for n in range(N):
  A, B = list(map(int, input().spliit()))
  C.append([A,B])
  
C = sorted(C, key=lambda x:x[0])

S = 0
n = 0
whilie S <= M:
  S += C[0][1]
  n += 1
print(S)
Problem p02683 (python)

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

A = [0]*M
for i in range(N):
    for k in range(M):
        A[k] += CA[i][k+1]
for i in range(M):
    if A[i] < X:
        print('-1')
        exit() 

price = 0
ans = 10**10
A = [0]*M
for i in range(2**N):
    list = [1]*N
    for j in range(len(list)):
        if (i>>j) & 1:
            list[j] = 0
        price = 0
        A = [0]*M
        for k in range(N):
            if list[k] == 1:
                for s in range(M):
                    A[s] += CA[k][s+1]
                price += CA[k][0]
    if all(A[m] >= X for m in range(M)):
        ans = min(ans,price)
print(ans)

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

A = [0]*M
for i in range(N):
    for k in range(M):
        A[k] += CA[i][k+1]
for i in range(M):
    if A[i] < X:
        print('-1')
        exit() 

price = 0
ans = 10**10
A = [0]*M
for i in range(2**N):
    list = [1]*N
    for j in range(len(list)):
        if (i>>j) & 1:
            list[j] = 0
        for k in range(N):
            if list[k] == 1:
                for s in range(M):
                    A[s] += CA[k][s+1]
                price += CA[k][0]
        if all(A[m] >= X for m in range(M)):
            ans = min(ans,price)
    price = 0
print(ans)
Problem p02730 (python)

Fixed submission:
S = input()
N = int(len(S))
a = 0
for i in range(0,int((N-1)/2)):
    if S[i] == S[-i-1]:
        a += 1
        
left = []
for i in range(0,int((N-1)/2)):
  left += S[i]
for i in range(0,int((N-1)/4)):
    if left[i] == left[-i-1]:
        a += 1

right = []
for i in range(0,int((N-1)/2)):
  right += S[-i-1]
for i in range(0,int((N-1)/4)):
    if right[i] == right[-i-1]:
        a += 1

if a == int((N-1)/2) + int((N-1)//4 * 2):
	print('Yes')
else :
    print('No')

Buggy submission (verdict: Runtime Error):
akasaka
Problem p02760 (python)

Fixed submission:
A = []
for _ in range(3):
    A += list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]

for i in range(0,N):
    for j in range(9):
        if B[i] ==  A[j]:
            A[j] = 0

if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or  A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0 :
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A = []
for _ in range(3):
    A = list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]
for i in range(N):
    for j in range(9):
        if B[i] ==  A[j] :
            A[j] = 'a'
if A[0]==A[1]==A[2]=='a' or A[3]==A[4]==A[5]=='a' or A[6]==A[7]==A[8]=='a' or A[0]==A[3]==A[6]=='a' or A[1]==A[4]==A[7]=='a' or A[2]==A[5]==A[8]=='a' or  A[0]==A[4]==A[8]=='a' or A[2]==A[4]==A[6]=='a' :
    print('Yes')
else:
    print('No')
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(M)]
for i in range(10**N): #rangeで書けば小さい順に実行するのを利用
    if len(str(i))==N and all(str(i)[s-1]==str(c) for s,c in sc):
                    #iの桁数指定では、入力のsと一つずれることに注意  
                    #このif文では最小値である可能性のある数字がリスト中にあるかどうか確認
        print(i)
        break
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(M)]
for i in range(0, 10**N):
    if len(str(i))==N and all(str(i)[s-1] == c for s,c in sc)
    print(i)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(M)]
for i in range(0, 10**N):
    if len(str(i))==N and all(str(i)[s-1] == c for s,c in sc)
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for i in range(M)]
a = 0
for i in range(M):
    if SC[i][0] != N or (SC[i][0] ==3 and SC[i][1]==0):
        a += 1

handred = 0
ten = 0
one = 0

for i in range(M):
    if S[i][0] == 3:
        handred = 9
    elif S[i][0] == 2:
        ten = 9
    elif S[i][0] == 1:
        one = 9

if a == M:
    print('-1')
else:
    for i in range(M):
        if S[i][0] == 3:
            if handred >= S[i][1]:
                handred = S[i][1]
        elif S[i][0] == 2:
            if ten >= S[i][1]:
                ten = S[i][1]
        elif S[i][0] == 1:
            if one >= S[i][1]:
                one = S[i][1]

if a != M and N == 3:
    print(str(handred) + str(ten) + str(one))
elif a != M and N == 2:
    print(str(ten) + str(one))
elif a != M and N==1:
    print(str(one))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for i in range(M)]
a = 0
for i in range(M):
    if SC[i][0] != N or SC[i][0] == 0:
        a += 1

handred = 0
ten = 0
one = 0

for i in range(M):
    if S[i][0] == 3:
        handred = 9
    elif S[i][0] == 2
        ten = 9
    elif S[i][0] == 1:
        one = 9

if a == M:
    print('-1')
else:
    for i in range(M):
        if S[i][0] == 3:
            if handred >= S[i][1]:
                handred = S[i][1]
        elif S[i][0] == 2:
            if ten >= S[i][1]:
                ten = S[i][1]
        elif S[i][0] == 1:
            if one >= S[i][1]:
                one = S[i][1]

if a != M and N == 3:
    print(str(handred) + str(ten) + str(one))
elif a != M and N == 2:
    print(str(ten) + str(one))
elif a != M and N==1:
    print(str(one))
Problem p02772 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count, check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')
Problem p02789 (python)

Fixed submission:
N, M =map(int, input().split())
print('Yes' if N==M else 'No')

Buggy submission (verdict: Runtime Error):
N, M =map(int, input().split())
if('Yes' if N==M else 'No')

Buggy submission (verdict: Runtime Error):
N, M =map(int, input())
if('Yes' if N==M else 'No')
Problem p02818 (python)

Fixed submission:
A, B, K = map(int, input().split())
if A>=K:
    A = A - K
    print(A,B)
else:
    K -= A
    A = 0
    B = max(0,B-K)
    print(A,B)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
if A>=K:
    A -= K)
elif A<K  and B>K-A:
    A = 0
    B = B -(K-A)
else:
    A = B = 0
print(A, B, sep=' ')
Problem p02830 (python)

Fixed submission:
N = int(input())
S, T = input().split()
list = []
for i in range(0,N):
    list.append(S[i])
    list.append(T[i])
print(*list, sep='')

Buggy submission (verdict: Runtime Error):
S, T = input().split()
print(*[s+t for s,t in zip(S,T)], sep='')

Buggy submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()
print(*s+t for s,t in zip(S,T), sep='')
Problem p02848 (python)

Fixed submission:
N = int(input())
S = input()
ans = str()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
	ans += chr(m + ord('A'))
print(ans)

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


for i in s:
    m = (ord(i) - ord('A') + n) % 26
    ans += chr(m + ord('A'))

print(ans)

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


for i in s:
    m = (ord(i) - ord('A') + n) % 26
    ans += chr(m + ord('A'))

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
    ans += chr(m +ord('A'))
print(ans)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
base = 0
for h in H:
    if base > h:
        print('No')
        break
    base = max(base,h-1)
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
4
1 3 2 1
Problem p02999 (python)

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

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
print(W*H/2, end=' ')
print(1 if W*y==x*H else 0)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if S[i] != S[K-1]:
        S = S[:i] + '*' + S[(i+1):]
print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if S[i] != S[K+1]:
        S = S[:i] + '*' + S[(i+1):]
print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if S[i] != S[K]:
        S = S[:i] + '*' + S[(i+1):]
print(S)
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]
a = 0
sum = 0
for i in range(N):
    for j in range(M):
        sum += A[i][j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = 0
sum = 0
for i in range(N):
    A = list(map(int, input().split()))
    for j in range(M):
        sum += A[i][j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = 0
sum = 0
for i in range(N):
  	A = list(map(int, input().split()))
    for j in range(M):
        sum += A[j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = 0
sum = 0
for i in range(N):
	A = list(map(int, input().split()))
    for j in range(M):
        sum += A[j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = 0
sum = 0
for i in range(N):
  A = list(map(int, input().split()))
    for j in range(M):
        sum += A[j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = 0
sum = 0
for i in range(N):
	A = list(map(int, input().split()))
    for j in range(M):
        sum += A[i][j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = 0
sum = 0
for i in range(N):
    A = list(map(int, input().split()))
    for j in range(M):
        sum += A[i][j] * B[j]
    if sum + C > 0:
        a += 1
        sum = 0
    else :
        sum = 0
print(a)
Problem p03109 (python)

Fixed submission:
S = list(str(input()))
print('Heisei' if int(S[5])==0 and int(S[6])<5 else 'TBD')

Buggy submission (verdict: Runtime Error):
S = int(input())
print('Heisei' if S[5]==0 and S[6]<5 else 'TBD')
Problem p03110 (python)

Fixed submission:
N = int(input())
money = []
type = []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)
    
sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
money = []
type = []
for i in range(N):
    m, t = input().split()
    money.append(int(m))
    type.append(t)
    
sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)
Problem p03125 (python)

Fixed submission:
A, B = map(int, input().split())
print(A+B if B%A==0 else B-A)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split()))
print(A+B if B%A==0 else B-A)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split()))
print(A+B if A%B==0 else B-A)
Problem p03126 (python)

Fixed submission:
N, M = map(int, input().split())
lists = [list(map(int, input().split())) for i in range(N)]
ans = set(lists[0][1:])
for i in range(1, N):
    ans = set(lists[i][1:]) & ans
print(len(list(ans)))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
lists = [list(map(int, input().split())) for i in range(N)]
ans = set(lists[0][1:])
for i in range(1, N):
    ans = set(lists[i][1:]) * ans
print(*list(ans), sep='')
Problem p03238 (python)

Fixed submission:
n=int(input())
print("Hello World" if n%2!=0 else int(input())+int(input()))

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2!=0:
	print('Hello Wordl')
elif:
	print(int(input())+int(input()))

Buggy submission (verdict: Runtime Error):
number = int(input())
A = int(input())
B = int(input())
if number ==1:
    print('Hello Wordl')
if number ==2:
    print(A+B)
Problem p03280 (python)

Fixed submission:
A, B =map(int, input().split())
print((A-1)*(B-1))

Buggy submission (verdict: Runtime Error):
print((int(input())-1)*(int(input()-1))
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())
print(0 if N%K==0 else 1)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split()))
if N%K==0:
    print(0)
else :
    print(N//K - N%K)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split()))
if N%K==0:
    print(0)
else :
    print(N/K - N%K)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split()))
if N%K==0:
    print(0)
else :
    print(N%K)
Problem p03289 (python)

Fixed submission:
S = input()
count = 0
if S[0] == 'A' and 'C' in S[2:-1] and S[1:].replace('C','',1).islower():
    print('AC')
else:
    print('WA')

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
if S[0] == 'A':
    S = S[1:]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            S = S[0:i] + S[i+1:]
            if S.islower():
                print('AC')
                break
            else:
                print('WA')
                break
    else:
        print('WA')
        break
else:
    print('WA')

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
if S[0] == 'A':
    S = S[1:]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            S = S[0:i] + S[i+1:]
            if S.islower():
                print('AC')
                break
else:
    print('WA')
Problem p03293 (python)

Fixed submission:
print("Yes" if input() in input()*2 else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
print('Yes' if 9 in N else 'No')
Problem p03338 (python)

Fixed submission:
N = int(input())
S = list(input())
s = set(S)
count = 0
maxx = 0
for i in range(N): #切断場所
    for k in range(i):
        if S[k] in S[:i] and S[k] in S[i:] and S[k] not in S[:k]:
            count += 1
    maxx = max(maxx, count)
    count = 0
print(maxx)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
print(max(len(set(S[:i])&set(S[i:])) for i in range(N))
Problem p03352 (python)

Fixed submission:
X = int(input())
ans = 1
for b in range(1,101):
    for p in range(2,10):
        if X >= b**p and b**p > ans:
            ans = b**p
print(ans)

Buggy submission (verdict: Runtime Error):
X = int(input())
ans = 1
for b in range(1,x):
    for p in range(2,x):
        if X >= b**p and b**p > ans:
            ans = b**p
        else:
        	break
print(ans)

Buggy submission (verdict: Runtime Error):
X = int(input())
ans = 1
for b in range(1,x):
    for p in range(2,x):
        if X >= b**p and b**p > ans:
            ans = b**p
print(ans)
Problem p03370 (python)

Fixed submission:
N, X = map(int, input().split())
m = sorted([int(input()) for i in range(N)])
for i in range(N):
    X -= m[i]
print(N + X//m[0])

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
m = sorted([int(input()) for i in range(N)])
print(3 + (X-m[0]-m[1]-m[2])//m[0])
Problem p03377 (python)

Fixed submission:
A, B, X = map(int, input().split())
print('YES' if A <= X <= (A+B) else 'NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
LR = [list(map(int, input().split())) for i in range(N)]
a = 0
for i in range(N):
    a += (LR[i][1] - LR[i][0] + 1)
print(a)
Problem p03378 (python)

Fixed submission:
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
right = 0
left = 0
for i in range(X, N):
    if i in A:
        right += 1
for i in range(0, X+1):
    if i in A:
        left += 1
print(min(right,left))

Buggy submission (verdict: Runtime Error):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
right = 0
left = 0
for i in range(X, N):
    if i in A:
        right += 1
for i in range(0, X+1):
    if i in B:
        left += 1
print(min(right,left))
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
list = [i for i in range(A, A+K)]
list.extend(i for i in range(B+1-K, B+1))
list = sorted(set(list))
for i in list:
    if A<=i<=B:
        print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
list = [i for i in range(A, A+K)]
list.append(i for i in range(B+1-K, B+1))
list = sorted(set(list))
for i in list: 
    if A<=i<=B:
        print(i)

Buggy submission (verdict: Runtime Error):
#bA
A, B, K = map(int, input().split())
list = range(A, B+1) #上限下限を先に決めておく
set1 = set(:K)
set2 = set(-K:)
print(sorted(set1|set2))