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

Fixed submission:
tcd = input()

cnt = 0
for i in range(len(tcd)):
    if i%2 == 0:
        if tcd[i] == "p":
            cnt -= 1
    else:
        if tcd[i] == "g":
            cnt += 1
print(cnt)

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

def dp(i, cnt, g, p):
    if g == p:
        if tcd[i] == "p":
            cnt -= 1
        g += 1

    else:
        if tcd[i] == "g":
            cnt += 1
        p += 1
    if i == len(tcd)-1:
        return cnt
    else:
        return dp(i+1, cnt, g, p)

print(dp(1, 0, 1, 0))
Problem p04012 (python)

Fixed submission:
word = input()

flag = True
if len(word)%2 == 1:
    flag = False

wordset = set(word)
leng = len(wordset)
for s in wordset:
    if word.count(s)%2 == 1:
        flag = False
        break
if flag:print("Yes")
else: print("No")

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

flag = True
if len(word)%2 == 1:
    flag = False

wordset = set(word)
leng = len(wordset)
for s in wordset:
    if word.count(s)％2 == 1:
        flag = False
        break
if flag:print("Yes")
else: print("No")

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

flag = True
if len(word)%2 == 1:
    flag = False

wordset = set(word)
leng = len(wordset)
i = 0
while flag and (i<leng):
    if (word.count(wordset[i]))%2 == 1:
        flag = False
    i += 1
if flag:print("Yes")
else: print("No")

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

flag = True
if len(word)%2 == 1:
    flag = False

wordset = set(word)
leng = len(wordset)
i = 0
while flag and (i<leng):
    if word.count(wordset[i])%2 == 1:
        flag = False
        break
    i += 1
if flag:print("Yes")
else: print("No")

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

flag = True
if len(word)%2 == 1:
    flag = False
tab = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
i = 0
leng = len(word)
while flag and (i<leng):
    if word.count(tab[i])%2 == 1:
        flag = False
        break
    i += 1
if flag:print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
import sys
word = input()

if len(word)%2 == 1:
    print("No")
    sys.exit()
tab = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
flag = True
for i in range(len(word)):
    if word.count(tab[i])%2 == 1:
        flag = False
        break
if flag:print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
import sys
word = input()

tab = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
flag = True
if len(word)%2 == 1:
    print("No")
    sys.exit()
for i in range(len(word))
    if word.count(tab[i])%2 == 1:
        flag = False
        break
if flag:print("Yes")
else: print("No")
Problem p04046 (python)

Fixed submission:
high, width, y, x = map(int, input().split())

def nCr(n, r):
    return ((((fact[n]*finv[n-r])%mod)*finv[r])%mod)

mod = 10**9 + 7
inv = mod - 2
maxn = high + width - 2
fact = [0] * (maxn+1)
finv = [0] * (maxn+1)
fact[0] = fact[1] = 1
finv[0] = finv[1] = 1

# 階乗を求める
for i in range(2, maxn+1):
    fact[i] = (fact[i-1] * i) % mod

# 階乗の逆元を求める
for i in range(2, maxn+1):
    finv[i] = pow(fact[i], inv, mod)

route = 0
for i in range(1, high-y+1):
        route += (nCr(x+i-2, i-1) * nCr(width+high-x-1-i, high-i)) % mod
        route = route % mod
print(int(route))

Buggy submission (verdict: Runtime Error):
def nCr(n, r):
    return ((((fact[n]*finv[n-r])%mod)*finv[r])%mod)

def powmod(a, n, m):
    if n == 0:
        return 1
    elif n == 1:
        return (a % m)
    elif n%2 == 0:
        s = powmod(a, int(n/2), m)
        temp = (s * s) % m
        return temp
    else:
        s = powmod(a, int(n/2), m)
        temp = ((s * s) * a) % m
        return temp

mod = 10**9 + 7
inv = mod - 2
maxn = high + width - 2
fact = [0] * (maxn+1)
finv = [0] * (maxn+1)
fact[0] = fact[1] = 1
finv[0] = finv[1] = 1

# 階乗を求める
for i in range(2, maxn+1):
    fact[i] = (fact[i-1] * i) % mod

# 階乗の逆元を求める
for i in range(2, maxn+1):
    finv[i] = powmod(fact[i], inv, mod)

route = 0
for i in range(1, high-y+1):
        route += (nCr(x+i-2, i-1) * nCr(width+high-x-1-i, high-i)) % mod
        route = route % mod
print(int(route))

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

def nCr(n, r):
    return ((((fact[n]*finv[n-r])%mod)*finv[r])%mod)
def powmod(a, n, m):
    if n == 0:
        return 1
    elif n == 1:
        return a
    if n%2 == 0:
        temp = (powmod(a, n/2, m) ** 2) % m
        return temp
    else:
        temp = (((powmod(a, n/2, m) ** 2) % m) * a) % m
        return temp

mod = 10**9 + 7
inv = mod - 2
maxn = high + width - 2
fact = [0] * (maxn+1)
finv = [0] * (maxn+1)
fact[0] = fact[1] = 1
finv[0] = finv[1] = 1

# 階乗を求める
for i in range(2, maxn+1):
    fact[i] = (fact[i-1] * i) % mod

# 階乗の逆元を求める
for i in range(2, maxn+1):
    finv[i] = powmod(fact[i], inv, mod)

route = 0
for i in range(1, high-y+1):
        route += (nCr(x+i-2, i-1) * nCr(width+high-x-1-i, high-i)) % mod
        route = route % mod
print(int(route))

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

import math
route = 0
for i in range(1,high-y+1):
    if i != high-y:
        route += ((math.factorial(x+i-1)/(math.factorial(x)*math.factorial(i-1)))%(10**9+7))*((math.factorial(width-x-2+high-i)/(math.factorial(width-x-2)*math.factorial(high-i))))%(10**9+7)
    else:
        route += ((math.factorial(x+i-1)/(math.factorial(x)*math.factorial(i-1)))%(10**9+7))*((math.factorial(width-x-1+high-i)/(math.factorial(width-x-1)*math.factorial(high-i))))%(10**9+7)
print(int(route))
Problem p03324 (python)

Fixed submission:
#coding:utf-8

D, N = list(map(int, input().split()))

lis = []
for i in range(1,101):
    if i == 100:
        lis.append(101*(100**D))
    else:
        lis.append((100**D)*i)

print(lis[N-1])

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

D, N = list(map(int, input().split()))

lis = []
for i in range(1,100):
    lis.append((100**D)*i)

print(lis[N-1])
Problem p02995 (python)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
inputs = [int(s) for s in input().split()]
a = inputs[0]
b = inputs[1]
c = inputs[2]
d = inputs[3]
count = 0
minCD = min(c, d)
maxCD = max(c, d)

x0 = b-a+1
x1 = b//minCD - (a-1)//minCD
x2 = b//maxCD - (a-1)//maxCD
lcm = minCD * maxCD // gcd(minCD, maxCD)
x3 = b//lcm - (a-1)//lcm
if maxCD % minCD == 0:
    print(x0-x1)
else:
    print(x0-(x1+x2-x3))

Buggy submission (verdict: Runtime Error):
import math
inputs = [int(s) for s in input().split()]
a = inputs[0]
b = inputs[1]
c = inputs[2]
d = inputs[3]
count = 0
minCD = min(c, d)
maxCD = max(c, d)

x0 = b-a+1
x1 = b//minCD - (a-1)//minCD
x2 = b//maxCD - (a-1)//maxCD
lcm = minCD * maxCD // math.gcd(minCD, maxCD)
x3 = b//lcm - (a-1)//lcm
print(x0, x1, x2, x3)
if maxCD % minCD == 0:
    print(x0-x1)
else:
    print(x0-(x1+x2-x3))
Problem p02900 (python)

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

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if fractions.gcd(A,B) == 1:
    print(1)
else:
    print(len(factorization(fractions.gcd(A,B)))+1)

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

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

print(len(factorization(math.gcd(A,B)))+1)

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

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

print(len(factorization(math.gcd(A,B)))+1)
Problem p02924 (python)

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

N = int(input())
a = (N*(N-1)//2)
print (a)

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

N = int(input())

print((N**2-N)/2

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

 N = int(input())

 print(N**2-N)
Problem p02901 (python)

Fixed submission:
n,m = input().split(' ')
n = int(n)
m = int(m)
dp = [float('inf')]*2**n
dp[0] = 0
for i in range(m):
    a,b = input().split(' ')
    a = int(a)
    b = int(b)
    ngo = 0
    for j in input().split(' '):
        ngo += 2**(int(j)-1)
    for j in range(2**n):
        if dp[j|ngo] > dp[j]+a:
            dp[j|ngo] = dp[j]+a
    
if dp[2**n-1] == float('inf'):
    print(-1)
    exit(0)
print(dp[2**n-1])

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

n, m = map(int, input().strip().split())
dp = [float('inf')] * (1 << n)
dp[0] = 0
for i in range(m):
    a, b = map(int, input().strip().split())
    c = np.array(list(map(int, input().strip().split()))) - 1
    mask = 0b0
    for i in c:
        mask |= 0b1 << i

    for j in range(1 << n):
        if dp[j] < float('inf'):
            dp[j | mask] = min(dp[j] + a, dp[j | mask])

print(dp[1 << n] if dp[1 << n] < float('inf') else -1)
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
if A==B:
  K=1
  print(K)
else:
  if (A+B)%2==0:
    K=(A+B)/2
    print(int(K))
  else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A==B:
  K=1
  print(K)
else A!=B:
  if (A+B)%2==0:
    K=(A+B)/2
    print(K)
  else:
    print('IMPOSSIBLE')
Problem p02958 (python)

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
q=[]
cnt=0
for i in range(N):
  q.append(i+1)
for i in range(N):
  if p[i]==q[i]:
    cnt=cnt
  else:
    cnt=cnt+1
if cnt==2 or cnt==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [int(input()) for i in range(N)]
q=[]
cnt=0
for i in range(N):
  q.append(i+1)
for i in range(N):
  if p[i]==q[i]:
    cnt=cnt
  else:
    cnt=cnt+1
if cnt==2:
  print('YES')
else:
  print('NO')
Problem p02983 (python)

Fixed submission:
L,R = (int(i) for i in input().split())
ans=0
amari=2018
if R-L>=2018:
    print(ans)
else:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            if amari>=(i*j)%2019:
                amari=(i*j)%2019
    print(amari)

Buggy submission (verdict: Runtime Error):
L,R = (int(i) for i in input().split()) 
S=[]
j=0
if R-L>=2:
    for i in range(L,R):
        S.append((L+j)%2019)
        j=j+1
    S.sort()
    ans=(S[0]*S[1])%2019
print(ans)

Buggy submission (verdict: Runtime Error):
L,R = (int(i) for i in input().split()) 
S=[]
j=0
if R-L>=2:
    for i in range(L,R):
        S.append((L+j)%2019)
        j=j+1
    S.sort()
    for i in range(L,R):
        if S[i]%673==0 or S[0]==0:
            print(0)
        else:
            ans=(S[0]*S[1])%2019
            print(ans)
else:
    ans=(R*L)%2019
    print(ans)
Problem p03000 (python)

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

Buggy submission (verdict: Runtime Error):
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X and i<=N+1):
  D=D+L[i]
  i=i+1
print(i)

Buggy submission (verdict: Runtime Error):
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X and i<=N):
  D=D+L[i]
  i=i+1
print(i)

Buggy submission (verdict: Runtime Error):
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
print(i+1)

Buggy submission (verdict: Runtime Error):
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
if X=0:
  print(1)
else:
  print(i)

Buggy submission (verdict: Runtime Error):
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
print(i)
Problem p03001 (python)

Fixed submission:
W, H, x, y = (int(i) for i in input().split())
if x==W/2 and y==H/2:
  print(W*H/2, 1)
else:
  print(W*H/2, 0)

Buggy submission (verdict: Runtime Error):
W, H, x, y = (int(i) for i in input().split())
if x=W/2 and y=H/2:
  print(W*H/2, 0)
else:
  print(W*H/2, 1)
Problem p03035 (python)

Fixed submission:
A,B = (int(i) for i in input().split()) 
C=B/2
if A >= 13 :
  print( '%d' % B )
elif A<=12 and A>=6 :
  print( '%d' % C )
else:
  print( '0')

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=B/2
if A >= 13 :
  print( '%d' % B )
elif A<=12 and A>=6 :
  print( '%d' % C )
else:
  print( '0')

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
 
if A >= 13 :
  X=B
  print( '%d' % X )
elif X<=12 and X>=6 :
  X=B/2
  print( '%d' % X )
else:
  print( '0')

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())

if A >= 13 :
  X=B
     print( '%d' % X )
elif X<=12 && X>=6 :
  X=B/2
     print( '%d' % X )
else:
     print( '0')
Problem p03060 (python)

Fixed submission:
N=int(input())
V = list(int(i) for i in input().split()) 
C = list(int(i) for i in input().split()) 
S=[]
ans=0
for i in range(N):
    S.append(V[i]-C[i])
for i in range(N):
	if S[i]>0:
		ans=ans+S[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
V = list(int(i) for i in input().split()) 
C = list(int(i) for i in input().split()) 
S=[]
for i in range(N):
	S.append(V[i]-C[i])
for i in range(N):
	if S[i]>0:
		ans=ans+S[i]
print(ans)
Problem p03061 (python)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))

Buggy submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
print(L,R)
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans=0
N = int(input())
A = [int(i) for i in input().split()] 
B=A
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    c=math.gcd(L[i],R[i])
    if c>ans:
        ans=c
print(ans)
Problem p03062 (python)

Fixed submission:
N=int(input())
A = [int(i) for i in input().split()]
cnt=0
ans=0
B=[]
C=[]
for i in range(N):
    B.append(abs(A[i]))
for i in range(N):
    if A[i]<0:
        C.append(A[i])
if len(C)%2==0:
    ans=sum(B)
    print(ans)
else:
    sel=min(B)
    print(sum(B)-2*abs(sel))

Buggy submission (verdict: Runtime Error):
N=int(input())
A = [int(i) for i in input().split()]
cnt=0
ans=0
B=[]
for i in range(N):
    if A[i]<0:
        cnt+=1
if cnt%2==0:
    ans=sum(abs(A))
    print(ans)
else:
    for i in range(N):
        if A[i]<0:
            B.append(A[i])
    max(B)
    ans=sum(abs(A))
    ans=ans+2*B
    print(ans)
Problem p03071 (python)

Fixed submission:
A,B = (int(i) for i in input().split()) 
C=0
if A >= B+1 :
	C=2*A-1
	print( '%d' % C  )
elif B >= A+1 :
	C=2*B-1
	print( '%d' % C )
else:
	C=2*A
	print( '%d'% C)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i in input().split()) 

if A >= B+1 :
   print( '%d' % 2*A-1 )
elif B >= A+1 :
   print( '%d' % 2*B-1 )
else:
   print( '%d'% 2*A)
Problem p03086 (python)

Fixed submission:
s=list(input())
cnt=0
ans=0
l=list("ATCG")
 
for i in s:
    if i in l:
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)
ans=[]
for i in range(n):
  cnt=0
  for j in range(j,n):
    if S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T':
      cnt+=1
  ans.append(cnt)
print(max(ans))

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)
ans=[]
for i in range(n):
  j=i
  cnt=0
  while(S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T'):
    cnt+=1
    j+=1
  ans.append(cnt)
print(max(ans))

Buggy submission (verdict: Runtime Error):
S = input()
list = []
counter = 0
H = []
c = []
d = 0
j=0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
        j=0
    else:
        H.append(i)
for i in range(len(H)-1):
    d = H[i+1]-H[i]-1
    c.append(d)
c.append(H[0])
print(max(c))

Buggy submission (verdict: Runtime Error):
S=input()
H=[]
M=len(S)
an=[]
j=0
for i in range(M):
	if S[i]=="A":
	elif S[i]=='C':
	elif S[i]=='G':
	elif S[i]=='T':
	else:
		H.append(i)
N=len(H)    
for i in range(N)
   an=H[i+1]-H[i]+1
an.append(H[0])

c=Max(an)
print("%d"% c)
Problem p03324 (python)

Fixed submission:
A = input().split()
D = int(A[0])
N = int(A[1])
 
if N != 100:
  print(100 ** D * N)
else:
  print(100 ** D * 101)

Buggy submission (verdict: Runtime Error):
D, N= int(input().split())
print(N*(100**D))

Buggy submission (verdict: Runtime Error):
D, N= int(input().split())
print(N*100**D)
Problem p03479 (python)

Fixed submission:
X,Y= (int(i) for i in input().split())
x=X
i=0
while(x<=Y):
    x=2*x
    i+=1
print(i)

Buggy submission (verdict: Runtime Error):
X,Y= (int(i) for i in input().split())
x=X
i=1
while(x<=Y):
    x=2*x
    i+==1
print(i)
Problem p02909 (python)

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
if s=='Cloudy':
  print('Rainy')
if s=='Rainy':
  print('Sunny')

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

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]

    # 再帰的に分割を行う
    left = merge_sort(left)
    right = merge_sort(right)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

N,M=map(int,input().split())
A=list(map(int, input().split()))
merge_sort(A)
for i in range(M):
  A[N-1]=A[N-1]/2
  for j in range(N-1,0,-1):
    if A[j-1]>A[j]:
      a=A[j-1]
      A[j-1]=A[j]
      A[j]=a
    else:
      break
  #print(A)
ans=0
for i in range(N):
  ans+=math.floor(A[i])
print(ans)
Problem p02934 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
sums=0
for i in range(n):
  sums+=1/a[i]
print(1/sums)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
sums=0
for i in range(n):
  sums+=1/a[i]
print(1/sums)
Problem p03854 (python)

Fixed submission:
s = input()
if s.replace('eraser','').replace('erase','').replace('dreamer','').replace('dream',''):
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
s = input()
if s.replace('eraser','').replace('erase','').replace('dreamer','').replace('dream','')
:
    print('NO')
else:
    print('YES')
Problem p03972 (python)

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

W,H=map(int,input().split())
p=sorted(int(input()) for i in range(W))
q=sorted(int(input()) for i in range(H))
ans=sum(p)*(H+1)+sum(q)*(W+1)
for i in range(W+H):
  if p[len(p)-1]>=q[len(q)-1]:
    ans-=p[len(p)-1]*len(q)
    p.pop()
    if p==[]:
      print(ans)
      exit()
  else:
    ans-=q[len(q)-1]*len(p)
    q.pop()
    if q==[]:
      print(ans)
      exit()

Buggy submission (verdict: Runtime Error):
import sys #入力時間短縮
input = sys.stdin.readline

W,H=map(int,input().split())
p=sorted(int(input()) for i in range(W))
q=sorted(int(input()) for i in range(H))
ans=sum(p)*(H+1)+sum(q)*(W+1)
#1マスずつmax(pi,qj)→O(N^2)
#pi,qjが大きい順に列ごと消去→O(N)
for i in range(W+H-1):
  if p[len(p)-1]>=q[len(q)-1]:
    ans-=p[len(p)-1]*len(q)
    p.pop()
    if p==[]:
      print(ans)
      exit()
  else:
    ans-=q[len(q)-1]*len(p)
    q.pop()
    if q==[]:
      print(ans)
      exit()
  print(p,q)

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

W,H=map(int,input().split())
p=sorted(int(input()) for i in range(W))
q=sorted(int(input()) for i in range(H))
ans=sum(p)*(H+1)+sum(q)*(W+1)
for i in range(W+H-1):
  if p[len(p)-1]>=q[len(q)-1]:
    ans-=p[len(p)-1]*len(q)
    p.pop()
  else:
    ans-=q[len(q)-1]*len(p)
    q.pop()
print(ans)
Problem p03853 (python)

Fixed submission:
h, w = map(int, input().split())
dots = []
for i in range(h):
  dots.append(str(input()))
  print(dots[i])
  print(dots[i])

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
dots = []
for i in range(h):
  print(dots[i])
  print(dots[i])
Problem p03962 (python)

Fixed submission:
numbers=list(map(int,input().split()))
colors = set(numbers)
print(len(colors))

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