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

Fixed submission:
a,b=raw_input().split()
a=int(a)
b=int(b)
if (a==2)|(b==2):
  print "No"
else:
  print "Yes"

Buggy submission (verdict: Runtime Error):
a,b=raw_input().spilt()
a=int(a)
b=int(b)
if b-a==1:
  print "No"
else:
  print "Yes"
Problem p03409 (python)

Fixed submission:
N=int(raw_input())
ab=[]
cd=[]
for i in xrange(N):
 ab.append(map(int,raw_input().split()))
for i in xrange(N):
 cd.append(map(int,raw_input().split()))
ab.sort(key=lambda x:x[1],reverse=True)
cd.sort()
for c,d in cd:
 for a,b in ab:
  if a<c and b<d:
   ab.remove([a,b])
   break
print N-len(ab)

Buggy submission (verdict: Runtime Error):
#include <cstdio>
#include <algorithm>
using namespace std;
struct me{
    int x,y;
}a[105],b[105];
bool f[105];
bool cmp1(struct me v1,struct me v2){
    return v1.y>v2.y;
}
bool cmp2(struct me v1,struct me v2){
    return v1.x+v1.y<v2.x+v2.y;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&a[i].x,&a[i].y);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&b[i].x,&b[i].y);
    //sort(a+1, a+1+n, cmp1);
    sort(b+1, b+1+n, cmp2);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(f[j]==false&&a[j].x<b[i].x&&a[j].y<b[i].y){
                f[j]=true;
                break;
            }
        }
    }
    int s=0;
    for(int i=1;i<=n;i++)
        if(f[i]==true)
            s++;
    printf("%d\n",s);
    return 0;
}
Problem p02994 (python)

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

n,l = map(int,input().strip().split())

ringo=[]

for i in range(n):
	ringo.append(l+i)
min = abs(ringo[0])
min_num = 0
for i in range(len(ringo)):
	if min > abs(ringo[i]):
		min = abs(ringo[i])
		min_num = i
out = 0
for i in range(len(ringo)):
	if i != min_num:
		out = out + ringo[i]
print(out)

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

n,l = map(int,input().strip().split())

ringo=[]

for i in range(n):
	ringo.append(l+i)
min = abs(ringo[0])
min_nim = 0
for i in range(len(ringo)):
	if min > abs(ringo[i]):
		min = abs(ringo[i])
		min_num = i
out = 0
for i in range(len(ringo)):
	if i != min_num:
		out = out + ringo[i]
print(out)
Problem p03035 (python)

Fixed submission:
a,b=map(int, input().split())
if a>=13:
  out=b
elif a>=6:
  out=int(b/2)
else:
  out=int(0)
  
print(out)

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
if a=>13:
  out=b
elif a=6:
  out=b/2
else:
  out=0
  
print(out)
Problem p03136 (python)

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

if sum(b)-max(b) > max(b):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a=input()
c=list(map(int, input().split(" ")))
 
from statistics import mean, median,variance,stdev
 
if sum(list1)-max(list1)< max(list1):
    print("Yes")
else:
    print("No")

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

from statistics import mean, median,variance,stdev

if sum(list1)-max(list1)< max(list1):
    print("Yes")
else:
    print("No")
Problem p03068 (python)

Fixed submission:
n = int(input())
s = str(input())
k = int(input())
ans = ""

for l in s:
  if l != s[k-1]:
    l = "*"
  ans += l
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
k = int(input())
ans = ""

for l in s:
  if l != s[k]:
    l = "*"
  ans += l
print(ans)
Problem p03069 (python)

Fixed submission:
n = int(input())
s = str(input())
k = [s.count('.')]

for i in range(n):
  if s[i] == "#":
    k.append(k[i]+1)
  else:
    k.append(k[i]-1)
    
print(min(k))

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

a = s[0:s.rfind('.')].count('#')
b = s[s.find('#'):n].count('.')
c = 0

for i in range(n//2):
  if s[i] == "#" and s[i:n].find('.') != -1:
    c += 1
  if s[n-i] == "." and s[i:n].find('#') != -1:
    c += 1
    
ans = min([a, b, c])
print(ans)
Problem p03085 (python)

Fixed submission:
b = input()

if b == "A":
  ans = "T"
elif b == "T":
  ans = "A"
elif b == "G":
  ans = "C"
else:
  ans = "G"
  
print(ans)

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

if b == "A":
  ans = T
elif b == "T":
  ans = A
elif b == "G":
  ans = C
else:
  ans = G
  
print(ans)
Problem p03290 (python)

Fixed submission:
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)

    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

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

ans = float("inf")

for bit in range(1 << D):
    count = 0
    sum = 0
    rest = list(range(1, D+1))

    for i in range(D):
        if bit & (1 << i):
            sum += 100 * i * pc[i][0] + pc[i][1]
            count += pc[i][0]
            rest.remove(i+1)
    if sum < G:
        max_num = max(rest)
        n = min(pc[max_num - 1][0], (G - sum) // (max_num * 100))
        count += n
        sum += n*max_num * 100
    if sum >= G:
        ans = min(ans, count)

print(ans)
Problem p03545 (python)

Fixed submission:
def make7(i, f, sum):
    if i == 3:
        if sum == 7:
            print(f + "=7")
            exit()
    else:
        make7(i+1, f+"+"+S[i+1], sum+int(S[i+1]))
        make7(i+1, f+"-"+S[i+1], sum-int(S[i+1]))


S = input()
n = len(S)

make7(0, S[0], int(S[0]))

Buggy submission (verdict: Runtime Error):
def make7(i, f, sum):
    if i == 3:
        if sum == 7:
            print(f + "=7")
            exit()
    else:
        make7(i+1, f+"+"+S[i+1], sum+S[i+1])
        make7(i+1, f+"-"+S[i+1], sum-S[i+1])


S = input()
n = len(S)

make7(0, S[0], S[0])

Buggy submission (verdict: Runtime Error):
def make7(i, f, sum):
    if i == 3:
        if sum == 7:
            print(f + "=7")
            exit()
    else:
        make7(i+1, f+"+"+S[i+1], sum+S[i+1])
        make7(i+1, f+"-"+S[i+1], sum+S[i+1])


S = input()
n = len(S)

make7(0, S[0], 0)

Buggy submission (verdict: Runtime Error):
def make7(i, f):
    if i == 3:
        if sum(map(int, f.split("+"))) == 7:
            print(f + "=7")
            exit()
    else:
        make7(i+1, f+"+"+S[i+1])
        make7(i+1, f+"-"+S[i+1])


S = input()
n = len(S)

make7(0, S[0])
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l=list(map(int,input().split()))
cnt=1
suml=0
for i in range(n):
  suml+=l[i]
  if suml<=x:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l=[0]
for _ in range(n):
  l.append(int(input()))
cnt=0
sum=0
for i in range(n):
  sum+=l[i]
  if sum<=x:
    cnt+=1
print(cnt)
Problem p03061 (python)

Fixed submission:
#3.7.3 -> import math
from fractions import gcd

# [0,--list--,0]
N = int(input())
A = [0]+list(map(int,input().split()))+[0]
L = [0]*(N+2)
R = [0]*(N+2)
#0,A[1]->L[i-1],A[i]->L[N-1],A[N]
for i in range(1,N+1):
    L[i] =gcd(L[i-1],A[i])
#0,A[N]->R[i+1],A[i]->R[2],A[1]
for i in range(N,0,-1):
    R[i] = gcd(R[i+1],A[i])
#A[i]を含めないL,Rのgcdをすべて並べてmaxをとる
print(max(gcd(L[i-1],R[i+1]) for i in range(1,N+1)))

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

# [0,--list--,0]
N = int(input())
A = [0]+list(map(int,input().split()))+[0]
L = [0]*(N+2)
R = [0]*(N+2)
#0,A[1]->L[i-1],A[i]->L[N-1],A[N]
for i in range(1,N+1):
    L[i] = math.gcd(L[i-1],A[i])
#0,A[N]->R[i+1],A[i]->R[2],A[1]
for i in range(N,0,-1):
    R[i] = math.gcd(R[i+1],A[i])
#A[i]を含めないL,Rのgcdをすべて並べてmaxをとる
print(max(math.gcd(L[i-1],R[i+1]) for i in range(1,N+1)))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

N = int(input())
A = list(map(int,input().split()))
max = 0
L = []
R = []
for i in range(N):
    L = A[:i]
    R = A[i:]
    if i > 0 :
        L.pop()
    while 2>len(L) or 2>len(R):
        L.append(0)
        R.append(0)
    x = reduce(math.gcd,L)
    y = reduce(math.gcd,R)
    gcdmax = math.gcd(x,y)
    if max < gcdmax:
        max = gcdmax
print(max)
Problem p03080 (python)

Fixed submission:
n = int(input())
s = str(input())
if s.count("R")>s.count("B"):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
if s.count(“R”)>s.count(“B”):
  print(“Yes”)
else:
  print(“No”)
Problem p03211 (python)

Fixed submission:
s = str(input())
mins = 1000
for i in range(len(s)-2):
    mins = min(mins,abs(753-(int(s[i:i+3]))))
print(mins)

Buggy submission (verdict: Runtime Error):
s = input()
mins = 1000
for i in renge(len(s)-2):
  mins = min(mins,abs(753-((int(s[i])+int(s[i+1])+int(s[i+2])))
print(mins)
Problem p03251 (python)

Fixed submission:
n,m,x,y = map(int,input().split())
xx = list(map(int,input().split()))
yy = list(map(int,input().split()))
if x<y and max(xx)<min(yy) and x<min(yy) and max(xx)<y:
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
n,m,x,y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if x<y-1 and max(x)<min(y)-1:
    print("No War")
else:
    print("War")
Problem p03285 (python)

Fixed submission:
n =int(input())
for i in range(16):
    for j in range(26):
        if i*7+j*4==n:
            print("Yes")
            exit()
print("No")

Buggy submission (verdict: Runtime Error):
n =int(input())
for i in range(16):
    if (n%(i*7))%4==0:
        print("Yes")
        exit()
print("No")
Problem p03361 (python)

Fixed submission:
h,w = map(int,input().split())
s=[]
for _ in range(h):
  s.append(str(input()))
for i in range(h):
  for j in range(w):
    flag=False
    if s[i][j]!="#":
      continue
    for k in [-1,1]:
      if 0<=i+k<h:
        if s[i+k][j]=="#":
          flag=True
      if 0<=j+k<w:
        if s[i][j+k]=="#":
          flag=True
    if not flag:
      print("No")
      exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
s=[]
for _ in range(h):
  s.append(str(input()))
for i in range(h):
  for j in range(w):
    flag=False
    if s[i][j]!="#":
      continue
    for k in [-1,1]:
      if 0<=i+k<h:
        if s[i+k][j]=="#":
          flag=True
      if 0<=j+k<h:
        if s[i][j+k]=="#":
          flag=True
    if not flag:
      print("No")
      exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
s=[]
for _ in range(h):
  s.append(str(input()))
for i in range(h):
  for j in range(w):
    flag=False
    if s[i][j]!="#":
      break
    for k in [-1,1]:
      if 0<=i+k<h:
        if s[i+k][j]=="#":
          flag=True
      if 0<=j+k<h:
        if s[i][j+k]=="#":
          flag=True
    if not flag:
      print("No")
      exit()
print("Yes")
Problem p03563 (python)

Fixed submission:
r = int(input())
g = int(input())
print(2*g-r)

Buggy submission (verdict: Runtime Error):
r = input()
g = input()
print(2*g-r)
Problem p03578 (python)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
d.sort()
t.sort()
i=0
j=0
while i<m and j<n:
    if t[i]==d[j]:
        i+=1
        j+=1
    elif t[i]<d[j]:
        print("NO")
        exit()
    else:
        j+=1
print("YES")

Buggy submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
dd=[0]*(max(d)+1)
tt=[0]*(max(t)+1)
for i in range(n):
    dd[d[i]]+=1
for i in range(m):
    tt[t[i]]+=1
for i in range(m):
    if tt[t[i]]>dd[t[i]]:
        print("NO")
        exit()
print("YES")
Problem p03280 (python)

Fixed submission:
a, b = (int(i) for i in input().split())

print((a-1) * (b-1))

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

print((a-1) * (b-1))
Problem p03323 (python)

Fixed submission:
a,b = (int(i) for i in input().split())

if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')

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

if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')
Problem p03337 (python)

Fixed submission:
a,b=(int(i) for i in input().split())

c=[]
c.append(a+b)
c.append(a-b)
c.append(a*b)
c.sort()

print(c[-1])

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

count=0
i=0
j=N-1

while i<j:
    if s[i]=="E":
        i+=1
        continue
    if s[j]=="W":
        j-=1
        continue
    sub_i=i
    sub_j=j
    j_i=0
    j_j=0
    while s[sub_i]=="W":
        sub_i+=1
        j_i+=1
    while s[sub_j]=="E":
        sub_j-=1
        j_j+=1
    if j_i<j_j:
        i=sub_i
        count+=1
    else:
        j=sub_j
        count+=1
    
print(count)

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

count=0
i=0
j=N-1

while i<=j:
    if s[i]=="E":
        i+=1
        continue
    if s[j]=="W":
        j-=1
        continue
    sub_i=i+1
    sub_j=j-1
    j_i=0
    j_j=0
    while s[sub_i]=="E":
        sub_i+=1
        j_i+=1
    while s[sub_j]=="W":
        sub_j-=1
        j_j+=1
    if j_i>j_j:
        i=sub_i
        count+=1
    else:
        j=sub_j
        count+=1
Problem p03377 (python)

Fixed submission:
a,b,x=(int(i) for i in input().split())

if a>x:
    print('NO')
elif a+b<x:
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
a,b,x=(int(i) for i in input().split()))

if a>x:
    print('NO')
elif a+b<x:
    print('NO')
else:
    print('YES')
Problem p02999 (python)

Fixed submission:
x, a = input().split()
if x < a:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
if x < a:
    print(0)
else:
    print(10)
Problem p03059 (python)

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

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

import fractions
from functools import reduce
from copy import copy

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

gcds=[]
for i in range(N):
    A_=copy(A)
    A_=pop(i)
    gcds.append(gcd(*A_))

print(max(gcds))

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

import fraction
from functools import reduce
from copy import copy

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

gcds=[]
for i in range(N):
    A_=copy(A)
    A_=pop(i)
    gcds.append(gcd(*A_))

print(max(gcds))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
T=int(input())
print(T//A*B)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
T=int(input())
print(T/A*B)
Problem p02988 (python)

Fixed submission:
def calc(n, p):
    count = 0
    for i in range(1, n-1):
        if p[i-1] < p[i] and p[i] < p[i+1]:
            count += 1
            continue
        if p[i-1] > p[i] and p[i] > p[i+1]:
            count += 1
            continue
    return count
print(calc(int(input()), [int(a) for a in input().split()]))

Buggy submission (verdict: Runtime Error):
def calc(n, p):
    count = 0
    for i in range(1, n-1):
        if p[i-1] < p[i] and p[i] < p[i+1]:
            count += 1
            continue
        if p[i-1] > p[i] and p[i] > p[i+1]:
            count += 1
            continue

    return count
print(calc(input(), list(input().split())))
Problem p03110 (python)

Fixed submission:
n = int(input())
 
li = []
for i in range(n):
    li.append(list(input().split()))
 
 
for money in li:
    if money[1] == 'JPY':
        continue
    else:
        money[0] = float(money[0]) * 380000.0
 
sum_money = sum([float(i[0]) for i in li])
  
print(sum_money)

Buggy submission (verdict: Runtime Error):

n = int(input())

li = []
for i in range(n):
    li.append(list(input().split()))


for money in li:
    if money[1] == 'JPN':
        continue
    else:
        money[0] = int(money[0]) * 380000.0

sum_money = sum([int(i[0]) for i in li])

print(sum_money)

Buggy submission (verdict: Runtime Error):

n = int(input())

li = []
for i in range(n):
    li.append(list(map(float, input().split())))


for money in li:
    if money[1] == 'JPN':
        continue
    else:
        money[0] *= 380000.0

sum_money = sum([i[0] for i in li])
Problem p03125 (python)

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

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
import sys

argvs = sys.argv

if len(argvs) < 2:
    sys.exit(1)

try:
    a = int(argvs[1])
    b = int(argvs[2])
except TypeError:
    sys.exit(1)

if b % a == 0:
    print(a+b)
else:
    print(b-a)
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

allnum =  B -A +1
E = lcm(C, D)

Cnum = (B//C) - ((A-1)//C)
Dnum = (B//D) - ((A-1)//D)
Enum = (B//E) - ((A-1)//E)

num = allnum - Cnum - Dnum + Enum
print(int(num))

Buggy submission (verdict: Runtime Error):
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

allnum =  B -A +1
if A%C==0:
    Csta = A
else:    
    Csta = A + (C-A%C)
if B%C==0:
    Cowa = B
else:    
    Cowa = B -B%C

if A%D==0:
    Dsta = A
else:    
    Dsta = A + (D-A%D)
if B%D==0:
    Dowa = B
else:    
    Dowa = B -B%D     

E = lcm(C, D)
if A%E==0:
    Esta = A
else:    
    Esta = A + (E-A%E)
if B%E==0:
    Eowa = B
else:    
    Eowa = B -B%E     

if A>Csta or B<Csta:
    Cnum = 0
else:
    Cnum = (Cowa-Csta+C)/C

if A>Dsta or B<Dsta:
    Dnum = 0
else:
    Dnum = (Dowa-Dsta+D)/D

if A>Esta or B<Esta:
    Enum = 0
else:
    Enum = (Eowa-Esta+E)/E


num = allnum - Cnum - Dnum + Enum
print(int(num))
Problem p03001 (python)

Fixed submission:


W, H, x, y = map(float, input().split())

if x/W == 0.5 and y/H == 0.5:   
	print(W*H/2,"1")
else:
	print(W*H/2,"0")

Buggy submission (verdict: Runtime Error):

W, H, x, y = map(int, input().split())
if x=W:
    if H-y < y:
        y = H-y
    print(y*W, "0")    
elif y=H:
    if W-x < x:
        x = W-x
    print(x*H, "0")
    
else:
    if W-x < x:
        x = W-x
    if H-y < y:
        y = H-y

    if x*H > y*W: 
        print(y*W, "0")
    elif x*H < y*W:
        print(x*H, "0")
    else:
        print(x*H, "1")
Problem p03049 (python)

Fixed submission:

N = int(input())
countA = 0
countB = 0
countC = 0
kcount = 0

for i in range(N):
    K = input()
    kcount += K.count("AB")
    K = list(K)
    if K[0] == "B" and K[-1] == "A":
        countC += 1 
    if K[-1] == "A":
        countA += 1
    if K[0] == "B":
        countB += 1
if countC>=1 and (countB-countC)==0 and (countA-countC)==0:
    print(kcount+countC-1)
elif countC >=1 and (countB-countC)==0 and (countA-countC)>=1:
    print(kcount+countC)
elif countC >=1 and (countB-countC)>=1 and (countA-countC)==0:
    print(kcount+countC)
elif countB > countA:
    print(kcount+countA)
else:
    print(kcount+countB)

Buggy submission (verdict: Runtime Error):

N = int(input())
countA = 0
countB = 0
countC = 0
kcount = 0

for i in range(N):
    K = input()
    kcount += K.count("AB")
    K = list(K)
    if K[0] == "B" and K[-1] == "A":
        countC += 1 
    if K[-1] == "A":
        countA += 1
    if K[0] == "B"
        countB += 1
if countC>=1 and (countB-countC)==0 and (countA-countC)==0:
    print(kcount+countC-1)
elif countC >=1 and (countB-countC)==0 and (countA-countC)>=1:
    print(kcount+countC)
elif countC >=1 and (countB-countC)>=1 and (countA-countC)==0:
    print(kcount+countC)
elif countB > countA:
    print(kcount+countA)
else:
    print(kcount+countB)
Problem p03085 (python)

Fixed submission:
b = input()
 
if  b=="A":
    print("T")
elif b=="C":
    print("G")
elif b=="T":
    print("A")
else:
    print("C")

Buggy submission (verdict: Runtime Error):
b = input()
 
if  "A"==b
    print("T")
elif "C"==b
    print("G")
elif "T"==b
    print("A")
else:
    print("C")

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

if b == "A"
    print("T")
elif b == "C"
    print("G")
elif b == "T"
    print("A")
else:
    print("C")
Problem p03086 (python)

Fixed submission:
S = input()
count = 0
num = 0


for i in S:
    if i=="A" or i=="C" or i=="G" or i=="T":
         count = count + 1
         if count >= num:
             num = count
    else:
        count = 0

print(num)

Buggy submission (verdict: Runtime Error):
b = input()
 
if  "A"==b
    print("T")
elif "C"==b
    print("G")
elif "T"==b
    print("A")
else:
    print("C")
Problem p03101 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:07:57 2019

@author: iwata
"""

H,W = map(int, input().split())
h,w = map(int, input().split())

num = H*W - (h*W+(H-h)*w)
print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count < M:
    while numlist[count1][1] > count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count <= M:
    while numlist[count1][1] >= count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)
Problem p03103 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count < M:
    while numlist[count1][1] > count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count <= M:
    while numlist[count1][1] <= count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)