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

Fixed submission:
n = input()
if (n[0]==n[1] and n[1]==n[2]) or (n[1]==n[2] and n[2]==n[3]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
count=0
for i in range(len(n)-1):
    if n[i] = n[i+1]:
        count +1

if count >=3:
    print("Yes")
else:
    print("No")
Problem p03565 (python)

Fixed submission:
s = input()
t = input()
cand = []
if len(s) < len(t):
  print('UNRESTORABLE')
else:
  for i in range(len(s)-len(t)+1):
    if s[i] != t[0] and s[i] != '?':
      continue
    else:
      for j in range(len(t)):
        if s[i+j] != t[j] and s[i+j] != '?':
          break
        elif j == (len(t)-1):
          cand.append(i)
  if len(cand) > 0:
    result = max(cand)
    S = s[:result]+t+s[result+len(t):]
    S = S.replace('?','a')
    print(S)
  else:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
cand = []
if len(s) < len(t):
  print('UNRESTORABLE')
else:
  for i in range(len(s)):
    if s[i] != t[0] and s[i] != '?':
      continue
    else:
      for j in range(len(t)):
        if s[i+j] != t[j] and s[i+j] != '?':
          break
        elif j == (len(t)-1):
          cand.append(i)
  if len(cand) > 0:
    result = max(cand)
    S = s[:result]+t+s[result+len(t):]
    S = S.replace('?','a')
    print(S)
  else:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
cand = []
if len(s) < len(t):
  print('UNRESTORABLE')
else:
  for i in range(len(s)):
    if s[i] != t[0] and s[i] != '?':
      continue
    else:
      for j in range(len(t)):
        if s[i+j] != t[j] and s[i+j] != '?':
          break
        elif j == (len(t)-1):
          cand.append(i)
  if len(cand) > 0:
    result = max(cand)
    S = s[:result]+t+s[result+len(t):]
    S = S.replace('?','a')
    print(S)
  else:
    print('UNRESTORABLE')
Problem p03601 (python)

Fixed submission:
A,B,C,D,E,F=map(int,input().split())
conc = 0.0
liq,sug = 100*A,0
for a in range(1 + F//(100*A)):
  for b in range(1 + (F-100*A*a)//(100*B)):
    if a + b < 1 or F <= 100*(A*a + B*b):
      break
    for c in range(1 + min(((A*a+B*b)*E)//C,F-100*(A*a+B*b))):
      for d in range(1 + min(((A*a+B*b)*E-C*c)//D,F-100*(A*a+B*b)-C*c)):
        tmp_sug = C*c+D*d
        tmp = 100*(A*a+B*b)+tmp_sug
        if tmp <= F and tmp_sug <= (A*a+B*b)*E and conc < (100*tmp_sug/tmp):
          conc = (100*tmp_sug/tmp)
          liq = tmp
          sug = tmp_sug
print(liq,sug)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F=map(int,input().split())
conc = 0.0
liq,sug=0,0
for a in range(31):
  for b in range(16):
    for c in range(31):
      for d in range(16):
        if 100*a+100*b+c+d <= F and  c+d <= (a+b)*E:
          if conc < 100*(c+d)/(100*(a+b)+c+d):
            conc = 100*(c+d)/(100*(a+b)+c+d)
            liq = 100*(a+b)
            sug = c+d
print(liq,sug)
Problem p03623 (python)

Fixed submission:
x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b):
  print('A')
else:
  print('B')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input())
if abs(x-a)<abs(x-b):
  print('A')
else:
  print('B')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b):
  print('A'):
else:
  print('B')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input())
if abs(x-a)<abs(x-b):
  print('A'):
else:
  print('B')
Problem p03644 (python)

Fixed submission:
N = int(input())
N2 = [64,32,16,8,4,2,1]
for i in range(len(N2)):
	if N2[i] <=N:
		print(N2[i])
		break

Buggy submission (verdict: Runtime Error):
N = int(input())
N2 = [64,32,16,8,4,2]
for i in range(len(N)):
  if N2[i] <=N:
    print(N2[i])
	break
Problem p03673 (python)

Fixed submission:
n = int(input())
num = list(map(str,input().split()))
a,b = [],[]
result = ''
for i in range(n):
  if i%2 == 0:
    a.append(num[i])
  else:
    b.append(num[i])
if n%2 ==1:
  result = ' '.join(a[::-1])
  result += ' ' + ' '.join(b)
else:
  result = ' '.join(b[::-1])
  result += ' ' + ' '.join(a)
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
b = []
for i in range(n):
  if n%2 == 0:
  	if i%2== 1:
      b.insert(0,a[i])
    else:
      b.append(a[i])
  else:
    if i%2== 0:
      b.insert(0,a[i])
    else:
      b.append(a[i])
result= map(b)
print(result)
Problem p03844 (python)

Fixed submission:
tmp = input().split()

if tmp[1] == '+':
  print(int(tmp[0])+int(tmp[2]))
else:
  print(int(tmp[0])-int(tmp[2]))

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

if tmp[1] == '+':
  print(tmp[0]+tmp[2])
else:
  print(tmp[0]-tmp[2])
Problem p03962 (python)

Fixed submission:
a,b,c=map(int,input().split())
color = [a]
if b not in color:
  color.append(b)
if c not in color:
  color.append(c)
print(len(color))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input())
color = [a]
if b not in color:
  color.append(b)
if c not in color:
  color.append(c)
print(len(color))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input())
color = [a]
if b not in color:
  color.append(b)
if c not in color:
  color.append(c)
print(color)
Problem p03971 (python)

Fixed submission:
N,A,B=map(int,input().split())
s = input().rstrip()
count = 0
countB = 0
for i in range(N):
  if A+B <= count:
    print('No')
  else:
    if s[i] == 'a':
      print('Yes')
      count += 1
    elif s[i] =='b':
      if countB < B:
        print('Yes')
        countB += 1
        count += 1
      else:
        print('No')
    else:
      print('No')

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
s = input().rstrip()
count = 0
countB = 0
for i in range(N):
  if A+B <= count:
    print('No')
  else:
    if s[i] == 'a':
      print('Yes')
      count += 1
    elif s[i] =='b'"
      if countB <= B:
        print('Yes')
        countB += 1
        count += 1
      else:
        print('No')
    else:
      print('No')
Problem p03993 (python)

Fixed submission:
n = int(input())
nums = list(map(int,input().split()))
count = 0
for i in range(n):
  if i < nums[i] and (i+1) == nums[nums[i]-1]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int,input().split()))
count = 0
for i in range(n):
  if i < nums[i] and (i+1) == nums[nums[i]]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int,input().split()))
count += 1
for i in range(n):
  if i < nums[i] and (i+1) == nums[nums[i]]:
    count += 1
print(count)
Problem p02811 (python)

Fixed submission:
a,b = input().strip().split()
a = int(a)
b = int(b)
p = 500 * a
if p >= b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b = int(input()).strip().split()
p = 500 * a
if p >= b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b = int(input().strip().split())
p = 500 * a
if p >= b:
  print("Yes")
else:
  print("No")
Problem p02812 (python)

Fixed submission:
N = int(input())
S = str(input())
S = S.replace("ABC","ab")
print(N - len(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
p = "abc"
print(len(re.findall("abc", S)))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
p = "abc"
print(N.count(p))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
p = "abc"
print(s.count(p))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
p = "abc"
print(s.count(p))
Problem p02885 (python)

Fixed submission:
a,b = input().strip().split()
a = int(a)
b = int(b)
if b * 2 >= a:
  print(0)
else:
  print(a - (b * 2))

Buggy submission (verdict: Runtime Error):
a,b = input().strip().split()
if b * 2 >= a:
  print(0)
else:
  print(a - (b * 2))
Problem p02898 (python)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)

Buggy submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Buggy submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 
print(p)

Buggy submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = []
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Buggy submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Buggy submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Buggy submission (verdict: Runtime Error):
N ,K = int(input().strip().split())
a = list(map(int, input().strip().split()))
for i range (N):
  if a[i] >= K:
    p += 1
print(p)
Problem p02945 (python)

Fixed submission:
a,b = map(int, input().split())
x = a + b
y = a - b
z = a * b
i = []
i.append(x)
i.append(y)
i.append(z)
i.sort()
print(i[-1])

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
x = a + b
y = a - b
z = a * b
i[1] = x
i[2] = y
i[3] = z
i.sort
print(i[2])
Problem p03433 (python)

Fixed submission:
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print("Yes");  
else:
  print("No");

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
C = 0
C = N % 500
if C <= A:
  print(Yes)
else:
  print(No)

Buggy submission (verdict: Runtime Error):
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print(Yes);  
else:
  print(No);

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
C = 0
C = N % 500
if C <= A:
   print(Yes)
else:
   print(No)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
C = 0
C = N % 500
if C <= A;
   print(Yes)
else;
   print(No)

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
C = 0
C = N % 500
if C <= A;
   print(Yes)
else;
   print(No)
Problem p02811 (python)

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
K X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
K=int(input())
X=int(input())

if 500*K < X:
	print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
if 500*K < X:
	print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
if 500*K < X :
	print("No")
else :
  print("Yes")

Buggy submission (verdict: Runtime Error):
if 500*K < X :
	print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
if 500*K < X 
	print("Yes")
else print("No")
Problem p02910 (python)

Fixed submission:
s= input()
a = 0
for i in range(len(s)):
    if i%2:
        if s[i]=="R":
            a = 1
            break
    else:
        if s[i]=="L":
            a = 1
            break
if a == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()
Problem p03378 (python)

Fixed submission:
N,M,X = map(int,input().split())
#print(N)
num = list(map(int, input().split()))
#print(str_)
s = [i for i in num if i > X]
p = len(s)
q = M-p
if p >q:
    print(q)
else:
    print(p)

Buggy submission (verdict: Runtime Error):
N,M,X = map(int,input().split())
print(N)
num = list(map(int, input().split()))
print(str_)
s = [i for i in num if i > X]
p = len(s)
q = M-p
if p >q:
    print(q)
else:
    print(p)
Problem p02811 (python)

Fixed submission:
K, X = map(int, input().split())

if K * 500 >= X:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
readline = sys.stdin.readline
write = sys.stdout.write

def main():
  N = int(readline())
  a = np.array(list(map(int, readline().split())))
  b = np.array(list(map(int, readline().split())))
  NA = np.arange(N)

  #for k in range(N):
  #  pass
    #r = np.bitwise_xor(a[(NA+k)%N], b)
    #if np.all(r == r[0]):
    #  pass
    #  #print(k, r[0])

if __name__ == '__main__':
    main()

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

def main():
  N = int(readline())
  a = list(map(int, readline().split()))
  b = list(map(int, readline().split()))
  buf = []
  
  for k in range(N):
    c = []
    last = None
    for i in range(N):
      r = c.append(a[(i+k)%N] ^ b[i])
      if last != r:
      	break
      last = r
    else:
      buf.append((k, c[0]))
  for d in buf:
    print(d[0], d[1])

if __name__ == '__main__':
    main()
Problem p02812 (python)

Fixed submission:
cnt = int(input())
s = input()
print(s.count('ABC'))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
cnt = int(input())
str = input()
print(srt.count('ABC'))
Problem p03945 (python)

Fixed submission:
S = raw_input()

s = S
n = 0
while len(s):
    s = s.lstrip(s[0])
    if len(s):
        n += 1

print n

Buggy submission (verdict: Runtime Error):
S = raw_input()

def count_least_turns(s, n=0):
    stripped = s.lstrip(s[0])
    if len(stripped):
        return count_least_turns(stripped, n + 1)
    return n

print count_least_turns(S)

Buggy submission (verdict: Runtime Error):
S = raw_input()

def count_least_turns(s, n=0):
    stripped = s.lstrip(s[0])
    if len(stripped) <= 1:
        return n
    return count_least_turns(stripped, n + 1)

print count_least_turns(S)

Buggy submission (verdict: Runtime Error):
S = raw_input()

def count_least_turns(s, n=0):
    print s
    stripped = s.lstrip(s[0])
    if len(stripped) <= 1:
        return n
    return count_least_turns(stripped, n + 1)

print count_least_turns(S)
Problem p02811 (python)

Fixed submission:
K, X = map(int, input().split())

if 500*K >= X:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
K, X = map(int(input().split())

if 500*K >= X:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
K, X = input(), input()

if 500*K >= X:
  print("Yes")
else:
  print("No")
Problem p02939 (python)

Fixed submission:
#coding: utf-8;

data = input()
#\nは？

K = 0
count = 0
prev = ""
now = ""
i = 0

if len(data)==1:
  print("1")
  exit()

while True:
  if count==len(data):
    if len(now)==0:
      break
    if now!=prev:
      K+=1
      break
    #こっからが問題
    break

  now += data[count]
  count += 1
  if now != prev:
    prev = now
    now = ""
    K += 1

print(K)

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

def hoge(i,flag):
  s = list(flag)
  s[i] = "B"
  return "".join(s)

N = int(input())
data = input()

R=[]
G=[]
B=[]
count = 0

for i,c in enumerate(data):
  if c=="R":
    R.append(i)
    continue
  if c=="G":
    G.append(i)
    continue
  if c=="B":
    B.append(i)
    continue

temp_max = 999999999999
min_list = []
#全探索(N!^2)でやってみようか
for num,x in enumerate(itertools.permutations(G)):
  for y in itertools.permutations(B):
      for i in range(N):
        ti = R[i]+G[i]+B[i]
        if ti==temp_max:
          min_list.append(R[i]+G[i]+B[i])
        elif ti<temp_max:
          temp_max = ti
          min_list = [R[i]+G[i]+B[i]]

print((len(min_list)*math.factorial(N))%998244353)

##TLE -> temp_maxより大きいのは登録しないようにしようか
Problem p02882 (python)

Fixed submission:
import math
a,b,x = input().split()
a,b,x = int(a),int(b),int(x)


if(x<=(a*a*b)/2):
    S = x/a
    h = (2*S/b)
    print(90.-math.atan(h/b)/(2.*math.pi)*360)
else:
    #a,x = math.sqrt(a),math.sqrt(x)
    x /= a
    d = 2*x/a-b
    if(b==d):
        print(0)
    else:
        print(90.-math.atan(a/(b-d))*360/(2*math.pi))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = input().split()
a,b,x = int(a),int(b),int(x)


if(x<=(a*a*b)/2):
    S = x/a
    h = (2*S/b)
    print(90.-math.atan(h/b)/(2.*math.pi)*360)
else:
    x /= a
    d = 2*x/a-b
    print(90.-math.atan(a/(b-d))*360/(2*math.pi))
Problem p02885 (python)

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

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

dic = {}

for i in range(N):
    if(ns[i] in dic.keys() and dic[ns[i]]<=2):
        dic[ns[i]] += 1
    elif(ns[i] not in dic.keys()):
        dic[ns[i]] = 1

a,b,c = 0,0,0
for key in dic.keys():
    if(dic[key] == 1):
        a += 1
    elif(dic[key] == 2):
        b += 1
    elif(dic[key] == 3):
        c += 1

unique = a+b+c
sum_ = 0

sum_ += c
sum_ += (b+c)*(unique-1)

key_list = list(dic.keys())
n = len(key_list)
for p in range(n-2):
    for q in range(n-1):
        if(p<q):
            for r in range(n):
                if(q<r):
                    x,y,z = int(key_list[p]),int(key_list[q]),int(key_list[r])
                    if(x+y>z):
                        sum_ += unique-(r+1-1)
                            break

print(int(sum_))

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

sum_ = 0

for i in range(N):
    for j in range(N):
        sum_ += int(ns[i])*int(ns[j])
        
print(sum_)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
#a,b = int(a),int(b)
print(max(a-2*b,0))

Buggy submission (verdict: Runtime Error):
a,b = input().split()
a,b = int(a),int(b)
print(max(a-2*b,0))

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print(max(0,a-2*b))

Buggy submission (verdict: Runtime Error):
a,b = input().split()
A,B = int(a),int(b)
if(A>(B*2)):
	print(A-B*2)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
a,b = (int(x) for x in input().split())
if(a>(b*2)):
  	print(a-(b*2))
else:
	print(0)

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

try:
    if(a>(b*2)):
      print(a-b*2)
    else:
      print(0)
except:
	print(0)

Buggy submission (verdict: Runtime Error):
try:
	a,b = input().split()
    if(a>(b*2)):
  		print(a-(b*2))
    else:
    	print(0)
except:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if(a>(b*2)):
  print(a-(b*2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if(a>(b*2)):
  print(a-b*2)
else:
  print(0)

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

if(a>(b*2)):
  print(a-b*2)
 
else:
  0
Problem p02886 (python)

Fixed submission:
N = int(input())
ns = input().split()

sum_ = 0

for i in range(N):
    for j in range(N):
        if(i>j):
            sum_ += int(ns[i])*int(ns[j])
        
print(sum_)

Buggy submission (verdict: Runtime Error):
N = input().split()
ns = input().split()

sum_ = 0
for i in range(N):
  	for j in range(N):
  		sum_ += ns[i]*ns[j]
print(sum_)
Problem p02909 (python)

Fixed submission:
S = input()
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print("Sunny")

Buggy submission (verdict: Runtime Error):
S = input()
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print(Sunny)

Buggy submission (verdict: Runtime Error):
S = input()
Sunny, Cloudy, Rainy
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print(Sunny)
Problem p02994 (python)

Fixed submission:
N,L = input().split()
N,L = int(N),int(L)


if(L>=0):
    print(int(0.5*N*(N+1)+N*L-N-(L)))
else:
    n = min([-L,N-1])
    print(int(0.5*N*(N+1)+N*L-N-(L+n)))

Buggy submission (verdict: Runtime Error):
import math
N,L = input().split()
N,L = int(N),int(L)
c = math.gcd(6,8)

if(L>=0):
    print(int(0.5*N*(N+1)+N*L-N-(L)))
else:
    n = min([-L,N-1])
    print(int(0.5*N*(N+1)+N*L-N-(L+n)))

Buggy submission (verdict: Runtime Error):
import math
N,L = input().split()
N,L = int(N),int(L)
c = math.gcd(N,L)

if(L>=0):
    print(int(0.5*N*(N+1)+N*L-N-(L)))
else:
    n = min([-L,N-1])
    print(int(0.5*N*(N+1)+N*L-N-(L+n)))
Problem p02995 (python)

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

from fractions import gcd

def div(x):
    if(a%x == 0):
        return (b//x-a//x)*(x-1)+(b%x)
    else:
        return (b//x-a//x)*(x-1)+(b%x)-(a%x-1)

ans = div(c)+div(d)-div(int(c*d//gcd(c,d)))
print(ans)

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

import math

def div(x):
    if(a%x == 0):
        return (b//x-a//x)*(x-1)+(b%x)
    else:
        return (b//x-a//x)*(x-1)+(b%x)-(a%x-1)

ans = div(c)+div(d)-div(int(c*d/math.gcd(c,d)))
print(ans)

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

import math

def div(x):
    #print("{}:{},{},{}".format(x,(b//x-a//x)*(x-1),(b-b//x*x),(a-a//x*x)))
    if(a%x == 0):
        return (b//x-a//x)*(x-1)+(b%x)
    else:
        return (b//x-a//x)*(x-1)+(b%x)-(a%x-1)


print(div(c)+div(d)-div(int(c*d/math.gcd(c,d))))
Problem p03001 (python)

Fixed submission:
W,H,x,y = input().split()
W,H,x,y = int(W),int(H),int(x),int(y)

cw = W/2
cH = H/2

if(cw==x):
    print(W*H/2)
    if(cH==y):
        print(1)
    else:
        print(0)

else:
    y0 = y-((y-cH)/(x-cw))*x
    y1 = y-((y-cH)/(x-cw))*(x-W)
    print((y0+y1)*W/2)
    print(0)

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

cw = W/2
cH = H/2

if(cw==x):
    print(W*H/2)
    if(cH==y):
        print(1)
    else:
        print(0)

else:
    y0 = y-((y-cJ)/(x-cW))*x
    y1 = y-((y-cJ)/(x-cW))*(x-W)
    print((y0+y1)*W/2)
    print(0)

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

cw = W//2
cH = H//2

if(cw==x):
    print(W*H//2)
    if(cH==y):
        print(1)
    else:
        print(0)
else:
    y0 = y-((y-cJ)/(x-cW))*x
    y1 = y-((y-cJ)/(x-cW))*(x-W)
    print((y0+y1)*W//2)
    print(0)
Problem p02811 (python)

Fixed submission:
K, X = map(int, input().split())
result = K*500
if result >= X:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a  = int(input())
if a == 2:
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())
    print()
elif a == 3:
    a1, a2, a3 = map(int, input().split())
    a1, a2, a3 = map(int, input().split())
    print(1,3)
elif a == 5:
    a1, a2, a3, a4, a5 = map(int, input().split())
    a1, a2, a3, a4, a5 = map(int, input().split())
    print(a1,a2)
    print(a1+1,a2)
    print(a1+2,a2)
    print(a1+3,a2)
    print(a1+4,a2)
elif a == 6:
    a1, a2, a3, a4, a5, a6 = map(int, input().split())
    a1, a2, a3, a4, a5, a6 = map(int, input().split())
    print(2,2)
    print(5,5)

Buggy submission (verdict: Runtime Error):
K, X = map(int, input().split())
result = K*500
if result >= X:
    print("yes")
elif result < X:
    print("no")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
result = a*500
if result >= b:
    print("yes")
else: 
    print("no")