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

Fixed submission:

n,q=map(int,input().split())
s=list(input())
a=[0]*n

for i in range(1,n):
  if s[i-1]=='A' and s[i]=='C':
    a[i]=a[i-1]+1
  else:
    a[i]=a[i-1]
    
for i in range(q):
  sita,ue=map(int,input().split())
  if sita==1:
    print(a[ue-1])
  elif s[sita-2]=='A' and s[sita-1]=='C':
    print(a[ue-1]-a[sita-2]-1)
  else:
    print(a[ue-1]-a[sita-2])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=list(input())
a=[0]*n

for i in range(1,n):
  if s[i-1]==A and s[i]==C:
    a[i]=a[i-1]+1
  else:
    a[i]=a[i-1]
    
for i in range(q):
  sita,ue=map(int,input().split())
  if sita==1:
    print(a[ue-1])
  elif s[sita-2]=='A' and s[sita-1]=='C':
    print(a[ue-1]-a[sita-2]-1)
  else:
    print(a[ue-1]-a[sita-2])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=list(input())

count=0


ans=[0 for i in range(n+2)]
for i in range(n-1):
  if s[i]+s[i+1]=='AC':
    count+=1
    ans[i+1]=count
  else:
    ans[i+1]=count
ans[n]=ans[n-1]
ans[n+1]=ans[n]


for i in range(q):
  sita,ue=map(int,input().split())
  if s[ue-1]=='A' and s[ue]=='C' and ue!=n:
    print(ans[ue]-ans[sita-1]-1)
  
  else:
    print(ans[ue]-ans[sita-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=list(input())

count=0


ans=[0 for i in range(n+2)]
for i in range(n-1):
  if s[i]+s[i+1]=='AC':
    count+=1
    ans[i+1]=count
  else:
    ans[i+1]=count
ans[n]=ans[n-1]
ans[n+1]=ans[n]


for i in range(q):
  sita,ue=map(int,input().split())
  if s[ue-1]=='A' and s[ue]=='C':
    print(ans[ue]-ans[sita-1]-1)
  
  else:
    print(ans[ue]-ans[sita-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=list(input())

count=0


ans=[0 for i in range(n+2)]
for i in range(n-1):
  if s[i]+s[i+1]=='AC':
    count+=1
    ans[i+1]=count
  else:
    ans[i+1]=count
ans[n]=ans[n-1]
ans[n+1]=ans[n]

print(*ans)

for i in range(q):
  sita,ue=map(int,input().split())
  if s[ue-1]=='A' and s[ue]=='C':
    print(ans[ue]-ans[sita-1]-1)
  
  else:
    print(ans[ue]-ans[sita-1])
Problem p03106 (python)

Fixed submission:
import sys
a,b,k=map(int,input().split())
count=0
for i in reversed(range(1,min(a,b)+1)):
  if a%i==0 and b%i==0:
    count+=1
    if count==k:
      print(i)
      sys.exit()

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

for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    count+=1
    if count==k:
      print(i)

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

for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    count+=1
    if count=k:
      print(i)
Problem p03109 (python)

Fixed submission:
s=input()

if int(s[6])>4:
  print('TBD')
elif int(s[5])==1:
  print('TBD')
else:
  print('Heisei')

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

if int(s[1])>4:
  print('TBD')
elif int(s[0])==1:
  print('TBD')
else:
  print('Heisei')
Problem p03206 (python)

Fixed submission:
D=int(input())
if D==25:
  print('Christmas')

if D==24:
  print('Christmas Eve')
  
if D==23:
  print('Christmas Eve Eve')

if D==22:
  print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
s=input()
if D==25:
  print('Christmas')

if D==24:
  print('Christmas Eve')
if D==25:
  print('Christmas Eve Eve')

if D==25:
  print('Christmas Eve Eve Eve')
Problem p03210 (python)

Fixed submission:
x=int(input())
if x==3 or x==5 or x==7:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
x=int(input())
if x=3 or x=5 or x=7:
  print('YES')
else:
  print('NO')
Problem p03264 (python)

Fixed submission:
a=int(input())
c=a//2
if a%2==0:
  print(c**2)
else:
  print(c*(c+1))

Buggy submission (verdict: Runtime Error):
a=int(input())
a//2=c
if a%2==0:
  print(c**2)
else:
  print(c*(c+1))
Problem p03076 (python)

Fixed submission:
from math import ceil 
L=[]
X=0
M=int(input())
L.append(M)
for i in range(4) :
  A=int(input())
  L.append(A)
  if A%10 < M%10 and A%10!=0 :
    M=A
L.remove(M)
for i in L :
  X+=ceil(i/10)*10
print(X+M)

Buggy submission (verdict: Runtime Error):
L=[]
M=[]
for i in range(5) :
  A=int(input())
  L.append(A)
  if A%10!=0 :
    M.append(10-A%10)
print(sum(L+M)-max(M))

Buggy submission (verdict: Runtime Error):
from math import ceil 
L=[]
M=9
X=0
for i in range(5) :
  A=int(input())
  L.append(A)
  if A%10 < M%10 and A%10!=0 :
    M=A
L.remove(M)
for i in L :
  X+=ceil(i/10)*10
print(X+M)
Problem p03086 (python)

Fixed submission:
S=set(["A","C","G","T"])
L=list(input())
A=[]
M=0
for i in L :
  if i in S :
    M+=1
  else :
    A.append(M)
    M=0
A.append(M)
print(max(A))

Buggy submission (verdict: Runtime Error):
S=set(["A","C","G","T"])
L=list(input())
A=[]
M=0
for i in L :
  if i in S :
    M+=1
  else :
    A.append(M)
    M=0
print(max(A))
Problem p03125 (python)

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

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if B%A==0 :
    print(A+B)
else:
    print(B-A)
Problem p03285 (python)

Fixed submission:
N=int(input())
for i in range(26) :
  if  N >= 4*i and (N-(4*i))%7==0 :
    print("Yes")
    break
else :
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(26) :
  if N=>4 and (N-(4*i))%7==0 :
    print("Yes")
    break
else :
  print("No")
Problem p03493 (python)

Fixed submission:
A=list(input())
print(eval("+".join(A)))

Buggy submission (verdict: Runtime Error):
print(input()).count("1")
Problem p02900 (python)

Fixed submission:
from fractions import gcd
# from math import gcd

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

a, b = map(int, input().split())
p = primes(10 ** 6 +1)
ans = 1
g = gcd(a, b)
for pp in p:
    f = False
    while g % pp == 0:
        g = (g // pp)
        f = True
    if f:
        ans += 1
if g > 1:
    ans += 1
print(ans)

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

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

a, b = map(int, input().split())
p = primes(10 ** 6 +1)
ans = 1
g = gcd(a, b)
for pp in p:
    f = False
    while g % pp == 0:
        g = (g // pp)
        f = True
    if f:
        ans += 1
if g > 1:
    ans += 1
print(ans)
Problem p02936 (python)

Fixed submission:
import sys
input = sys.stdin.readline

n, q = map(int, input().split())
p = []
x = [0] * (n+1)
for _ in range(n-1):
    p.append(list(map(int, input().split())))

for _ in range(q):
    tmp1, tmp2 = map(int, input().split())
    x[tmp1] += tmp2

# 隣接リスト
l = [[] for _ in range(n+1)]
for pi in p:
    l[pi[0]].append(pi[1])
    l[pi[1]].append(pi[0])
p = [0] * (n+1)

import sys
sys.setrecursionlimit(10000000)


def dfs(n, v, par):
    p[n] = v
    for chl in l[n]:
        if chl == par:
            continue  # parent
        dfs(chl, v+x[chl], n)
    return

dfs(1, x[1], 0)
print(*p[1:])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n, q = map(int, input().split())
p = []
x = [0] * (n+1)
for _ in range(n-1):
    p.append(list(map(int, input().split())))

for _ in range(q):
    tmp1, tmp2 = map(int, input().split())
    x[tmp1] += tmp2

# 隣接リスト
l = [[] for _ in range(n+1)]
for pi in p:
    l[pi[0]].append(pi[1])
    l[pi[1]].append(pi[0])
p = [0] * (n+1)

import sys
sys.setrecursionlimit(100000)


def dfs(n, v, par):
    p[n] = v
    for chl in l[n]:
        if chl == par:
            continue  # parent
        dfs(chl, v+x[chl], n)
    return

dfs(1, x[1], 0)
print(*p[1:])
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
a = 0
ans = 1
for i in range(N):
    a += L[i]
    if a <= X:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
a = 0
for i in range(N+1):
    a += L[i]
    if a > X:
        break
print(i+1)
Problem p03062 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
c = 0
z = False
for aa in a:
    if aa < 0:
        c += 1
    elif aa == 0:
        z = True
if z or c % 2 ==0:
    print(sum(map(abs, a)))
else:
    ab = [abs(x) for x in a]
    ans = sum(ab) - min(ab)*2
    print(ans)

Buggy submission (verdict: Runtime Error):
def dp(i, j):
    if i == 0:
        if j:
            return -float('inf')
        else:
            return 0
    if j:
        return max(dp(i-1, False) - a[i-1], dp(i-1, True) + a[i-1])
    else:
        return max(dp(i-1, False) + a[i-1], dp(i-1, True) - a[i-1])


n = int(input())
a = list(map(int, input().split()))
print(dp(n, False))
Problem p03069 (python)

Fixed submission:
n = int(input())
s = input()
b = 0
w = 0
for i in range(n):
    if s[i] == '.':
        b = min(b,w) + 1
    else:
        b = min(b, w)
        w += 1
print(min(b, w))

Buggy submission (verdict: Runtime Error):
s = input()
b = 0
w = 0
for i in range(n):
    if s[i] == '.':
        b += 1
    else:
        w += 1
print(min(b, w))
Problem p03680 (python)

Fixed submission:
N = int(input())
a_lis = [int(input()) for _ in range(N)]

now = 1
flag = 1
cnt = 0
while cnt<N and next!=2:
    cnt+=1
    next = a_lis[now-1]
    now = next
if next==2:print(cnt)
else:print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a_lis = [int(input()) for _ in range(N)]

now = 1
flag = 1
memo = []
cnt = 0
for i in range(N)
    next = a_lis[now-1]
    if next in memo:
        print(-1)
        flag = 0
        break
    else:
        memo.append(next)
        now = next
    cnt+=1
    if next ==2:
        print(cnt)
        break
Problem p02898 (python)

Fixed submission:
x = input().split()
y = input().split()

cnt = 0

for i in y:
  if int(i) >= int(x[1]):
    cnt += 1
    
print(cnt)

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

cnt = 0

for i in y:
  if i >= int(x[1]):
    cnt += 1
    
print(cnt)
Problem p02900 (python)

Fixed submission:
#l=list(map(int, input().split()))
a,b=map(int, input().split())
#l=list(map(int, input().split()))
#n = int(input())
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1



ans = 1
temp1 = divisor(a)
temp2 = divisor(b)
hoge = []
if len(temp1) < len(temp2):
    hoge = temp1
    hoge2 = temp2
else:
    hoge = temp2
    hoge2 = temp1

temp = []
for i in hoge:
    if i in hoge2:
        temp.append(i)

#print (temp)
for i in temp:
    if is_prime(i):
        ans += 1

print (ans)

Buggy submission (verdict: Runtime Error):
import fractions

A,B = map(int,input().split())

def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
  
A_list = divisor(A)
B_list = divisor(B)

box = []

for i in A_list:
  if i in B_list:
    box.append(i)

box = box.sort()
    
tmp = []

for l in range(len(box)-1):
  for m in range((l+1),len(box)):
    if fractions.gcd(box[l],box[m]) != 1:
      tmp.append(box[m])
      
print(len(box)-len(set(tmp)))
Problem p02911 (python)

Fixed submission:
x = input().split()
member = [int(x[1])] * int(x[0])

for l in range(int(x[2])):
  y = input()
  member[int(y) - 1] += 1
      
for z in member:
  if (z - int(x[2])) > 0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = input().split()
y = [int(input()) in i in range(int(x[2]))]
member = [int(x[1])] * int(x[0])

for l in y:
  for i,point in enumerate(member):
    if (l-1) != i:
      member[i] = (point -1)
      
for z in member:
  if z > 0:
    print("Yes")
  else:
    print("No")
Problem p02909 (python)

Fixed submission:
weather = ["Sunny", "Cloudy", "Rainy"]
s = input()
next = weather.index(s) + 1

if next >= len(weather):
  print(weather[0])
else:
  print(weather[next])

Buggy submission (verdict: Runtime Error):
weather = ["Sunny", "Cloudy", "Rainy"]
s = input()

print(weather[weather.index(s) + 1])
Problem p02921 (python)

Fixed submission:
s = input()
t = input()

cnt = 0

for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)

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

max_i = int(n / 2) + 1
max_mod = n % max_i

sum = ((n - 1) * n) / 2

if max_mod > max_i:
  sum = (sum - max_i-1) + max_mod

print(int(sum))
Problem p02993 (python)

Fixed submission:
# -*- coding: utf-8 -*-

s = list(raw_input())

l = len(s)

badFlag = False
for i in range(l-1):
    if s[i] == s[i+1]:
        badFlag = True

if badFlag == True:
    print ("Bad")
else:
    print ("Good")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

s = list(input())

l = len(s)

goodFlag = False
for i in range(l-1):
    if s[i] == s[i+1]:
        ggoodFlag = True

if goodFlag == True:
    print ("Good")
else:
    print ("Bad")
Problem p03030 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = input()

l = []

for i in range(n):
    inpt = raw_input().split()
    l.append((inpt[0], int(inpt[1]), i + 1))

l.sort(key=lambda x:(x[0], -x[1]))

for i in l:
    print (i[2])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n = input()

l = []

for i in range(n):
    inpt = raw_input().split()
    l.append((inpt[0], inpt[1]), i)

l.sort(key=lambda xrange:(x[0], -x[1]))

for i in l:
    print (l[2] + 1)
Problem p02981 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a*b < c:
  print(a*b)
else:
  print(c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split)
 
if a*b <= c:
  print(a:b)
else:
  print(c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
 
if a*b < c:
  print(a:b)
else:
  print(c)

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

if a*b < c:
  print(a:b)
else:
  print(c)
Problem p02993 (python)

Fixed submission:
s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
s = list(map(int,input().split()))
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print("Bad")
else:
  print("Good")
Problem p03000 (python)

Fixed submission:
N,X = map(int,input().split())
L = list(map(int,input().split()))
d = 0
ans = 1
for i in range(1,N+1):
  d += L[i-1]
  if d <= X:
  	ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
L = list(map(int,input().split()))
d = 0
ans = 1
for i in range(1,N+2):
  d += L[i-1]
  if d <= X:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
L = list(map(int,input().split()))
d = 0
ans = 1
for i in range(1,N+2):
  d += L[i-1]
  if d <= X:
    ans += 1
  else:
    break
print(ans)
Problem p03086 (python)

Fixed submission:
s = list(input())
lst = []
ans = 0
c = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        ans += 1
        c = max(c,ans)
    else:
        ans = 0
print(c)

Buggy submission (verdict: Runtime Error):
s = list(input())
lst = []
ans = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        ans += 1
    else:
        lst.append(ans)
        ans = 0
print(max(lst))

Buggy submission (verdict: Runtime Error):
s = list(input())
lst = []
ans = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        ans += 1
    else:
        lst.append(ans)
        ans = 0
print(max(lst))
Problem p03102 (python)

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

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

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

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

Fixed submission:
n,m = map(int, input().split())
ans = list(input().split())
ans = set(ans[1:])
for i in range(n-1):
    b = list(input().split())
    b = set(b[1:])
    ans = ans & b
print(len(ans))

Buggy submission (verdict: Runtime Error):
N,M = [int(x) for x in input().split()]
k = [0] * (M+1)
for i in range(N):
    a = [int(x) for i in input().split()]
    del a[0]
    for j in a:
        k[j] += 1
print(k.count(N))

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
lst = list(map(int,input().split()))
for i in range(N-1):
    k = list(map(int,input().split()))
    for j in k[1:]:
        if j in lst:
            continue
        else:
            lst.remove(j)
print(len(lst))
Problem p03136 (python)

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

if 2 * max(l) < sum(l):
    print("Yes")
else:
    print("No")

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

if 2 * max(l) < sum(l):
    print("Yes")
else:
    print("No")
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
	print("Christmas")
elif D == 24:
	print("Christmas Eve")
elif D == 23:
	print("Christmas Eve Eve")
elif D == 22:
	print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
D = int(input())
if D == 25
	print("Christmas")
elif D == 24
	print("Christmas Eve")
elif D == 23
	print("Christmas Eve Eve")
elif D == 22
	print("Christmas Eve Eve Eve")
Problem p03243 (python)

Fixed submission:
N = int(input())
lst = [i*100+i*10+i for i in range(1,10)]
for i in range(1000):
    if N in lst:
        print(N)
        break
    else:
        N += 1

Buggy submission (verdict: Runtime Error):
N = int(input())
print(lst)
for i in range(1000):
    if N in lst:
        print(N)
        break
    else:
        N += 1
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input.split())
print((a-1)*(b-1))
Problem p03284 (python)

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

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n%k == 0:
    print(0)
else:
    prinnt(1)
Problem p03292 (python)

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

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

Fixed submission:
s = list(input())
t = list(input())

for i in range(len(s)):
    a = s[-1]
    s.pop(-1)
    s.insert(0,a)
    a = []
    if s == t:
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
a.sort()
print(abs(a[0]-a[1])+abs(a[1]-a[2]))
Problem p03328 (python)

Fixed submission:
x,y = map(int,input().split())
h=y-x
a=0
for i in range(h-1):
   a+=i+1
print(a-x)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
df = b-a
nums = []
cnt = 0
for i in range(1,1000):
    cnt += i
    nums.append(cnt)
    if nums[i] - nums[i-1] == df:
        print(nums[i] - b)
        exit()
Problem p03337 (python)

Fixed submission:
a,b = map(int,input().split())
print(max(a+b,a-b,a*b))

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

ans = 0
c = 0
for i in range(N):
    c = len(set(list(S[:i]))&set(list(S[i:])))
    ans = max(ans,c)
print(ans)
Problem p02921 (python)

Fixed submission:
forecasts     = input()
real_weathers = input()

correct_number = 0
for date in range(len(forecasts)):
    if forecasts[date] == real_weathers[date]:
        correct_number += 1
print(correct_number)

Buggy submission (verdict: Runtime Error):
import math
a, b = list(map(int, input().split()))
number = 0
if a == 1:
    number = 0
elif b >  a:
    number = math.ceil((b - a) / (a - 1))
else:
    number = 0
number += 1
print(number)

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
number = 1
outlet_number = a
while outlet_number <= b:
    outlet_number += a - 1
    number += 1
print(number)

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
number = 1
outlet_number = a
while outlet_number < b:
    outlet_number += a - 1
    number += 1
print(number)

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
number = 1
while a =< b:
    a += a - 1
    number += 1
print(number)

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
number = 1
while a <= b:
    a += a - 1
    number += 1
print(number)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
ans = []
a = 0
for i in range(1,n):
    if h[i] <= h[i-1]:
        a += 1
    else:
        ans.append(a)
        a = 0
ans.append(a)
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = tuple(map(int, input().split()))
max_step = []
for m in range(n-1):
    step = 0
    for k in range(m, n-1):
        if h[k] >= h[k + 1]:
            step += 1
        else:
            break
    max_step.append(step)
print(max(max_step))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = tuple(map(int, input().split()))
max_step = []
for m in range(n-1):
    step = 0
    for k in range(m, n-1):
        if h[k] >= h[k + 1]:
            step += 1
        else:
            break
    max_step.append(step)
print(max(max_step))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = tuple(map(int, input().split()))
max_step = []
for m in range(n-1):
    step = 0
    for k in range(m, n-1):
        if h[k] >= h[k + 1]:
            step += 1
        else:
            break
    max_step.append(step)
print(max(max_step))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
max_step = []
for m in range(n-1):
    step = 0
    for k in range(m, n-1):
        if h[k] >= h[k + 1]:
            step += 1
        else:
            break
    max_step.append(step)
print(max(max_step))
Problem p04047 (python)

Fixed submission:
n = int(input())
L = list(map(int, input().split()))
L.sort()
array_L = []
for m in [i * 2 for i in range(n)]:
    array_L.append(L[m])
print(sum(array_L))

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int, input().split())
L.sort()
array_L = []
for m in [i * 2 for i in range(n)]:
    array_L.append(L[m])
print(sum(array_L))
Problem p03813 (python)

Fixed submission:
r = int(raw_input())
print ("ABC" if r<1200 else "ARC")

Buggy submission (verdict: Runtime Error):
l = int(raw_input())
print (len(set(map(int, raw_input().split())))//2)*2
Problem p03814 (python)

Fixed submission:
s = raw_input()
print s.rfind("Z")-s.find("A")+1

Buggy submission (verdict: Runtime Error):
x = int(raw_input())
print 2*(x//11) + (2 if x%11>6 else 1)