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

Fixed submission:
s = list(input())
k = int(input())

s2 = s + s
s3 = s + s + s

tmp = s[0]
c = 0
for i in range(1,len(s)):
    if s[i] == tmp:
        s[i] = "@"
        c += 1
    tmp = s[i] 

tmp = s2[0]
c2 = 0
for i in range(1,len(s2)):
    if s2[i] == tmp:
        s2[i] ="@"
        c2 += 1
    tmp = s2[i]

tmp = s3[0]
c3 = 0
for i in range(1,len(s3)):
    if s3[i] == tmp:
        s3[i] ="@"
        c3 += 1
    tmp = s3[i]

if c2-c == c3-c2:
    ans = c + (k-1)*(c2-c)
else:
    if k%2 != 0:
        ans = c + ((k-1)//2)*(c3-c)
    else:
        ans = c + ((k-2)//2)*(c3-c2) + c2 - c
print(ans)

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

s2 = s + s
s3 = s + s + s

tmp = s[0]
c = 0
for i in range(1,len(s)):
    if s[i] == tmp:
        s[i] = "@"
        c += 1
    tmp = s[i] 

tmp = s2[0]
c2 = 0
for i in range(1,len(s2)):
    if s2[i] == tmp:
        s2[i] ="@"
        c2 += 1
    tmp = s2[i]

tmp = s3[0]
c3 = 0
for i in range(1,len(s3)):
    if s3[i] == tmp:
        s3[i] ="@"
        c3 += 1
    tmp = s3[i]

if c2-c == c3-c2:
    ans = c + (k-1)*(c2-c)
else:
    if K%2 != 0:
        ans = c + ((k-1)//2)*(c3-c)
    else:
        ans = c + ((k-2)//2)*(c3-c2) + c2 - c
print(ans)
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())

ng = [0]*(n+1)
for i in range(m):
    ng[int(input())] = 1

mod = (10**9)+7
dp = [0]*(n+1)
dp[0] = 1

for i in range(1,n+1):
    if ng[i] == 1:
        dp[i] = 0
        continue
    if i == 1:
        dp[1] = 1
        continue
    dp[i] = (dp[i-2] + dp[i-1])%mod

print(dp[n])

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

s = [0]*(n+1)
for i in range(m):
    s[int(input())] = 1

mod = (10**9)+7
ans = 0

def steps(now):
    if now == n:
        global ans
        ans += 1
        ans %= mod
    else:
        if s[now+1] == 0:
            steps(now+1)
        if now+2 <= n:
            if s[now+2] == 0:
                steps(now+2)
            
steps(0)
print(ans)
Problem p02701 (python)

Fixed submission:
import numpy as np

N = int(input())
S = [input() for i in range(N)]

print(len(np.unique(S)))

Buggy submission (verdict: Runtime Error):
import pandas as pd

N = int(input())
S = [input() for i in range(N)]

data = pd.Series(S)

print(data.nunique())
Problem p02729 (python)

Fixed submission:
#coding:utf-8
import itertools

N, M = map(int, input().split())

ansN = len(list(itertools.combinations(range(N), 2)))
ansM = len(list(itertools.combinations(range(M), 2)))

ans = ansN + ansM
print(ans)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

N, M = map(int, input().split())

ans = comb(N,2,exact = True) + comb(M,2,exact = True)

print(ans)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import perm, comb

N, M = map(int, input().split())

ansN = comb(N,2,exact = True)
ansM = comb(M,2,exact = True)

ans = ansN + ansM

print(ans)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import perm, comb

N, M = map(int, input().split())

ansN = comb(N,2,exact = True)
ansM = comb(M,2,exact = True)

ans = ansN + ansM

print(ans)
Problem p02771 (python)

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

if A == B == C:
    print('No')
elif A == B and B != C:
    print('Yes')
elif A != B and A == C:
    print('Yes')
elif A != B and B ==C:
    print('Yes')
elif A != B and A != C:
    print('No')
else:
    print('No')

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

if A == B and A==C:
    print('No')
elif A<> B and B <> C :
    print('No')
elif A == B :
    print('Yes')
elif A == C :
    print('Yes')
elif B == A :
    print('Yes')
elif C == A :
    print('Yes')
else :
    print('No')
Problem p02597 (python)

Fixed submission:
N = int(input())
cs = list(input())

ans = 0
sorted = N - 1
for i in range(N):
  if cs[i] == "W":
    for j in range(sorted, i, -1):
      sorted = j - 1
      if cs[j] == "R":
        cs[i], cs[j] = cs[j], cs[i]
        ans += 1
        break
  if (i + 1) > sorted:
    break
print(str(ans))

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

ans = 0
sorted = N - 1
for i in range(N):
  if cs[i] == "W":
    j = i
    for j in range(sorted, i, -1):
      if cs[j] == "R":
        cs[i], cs[j] = cs[j], cs[i]
        ans += 1
        sorted = j
        break
  if (i + 1) == j:
    break
print(str(ans))

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

ans = 0
sorted = N - 1
for i in range(N):
  if cs[i] == "W":
    for j in range(sorted, i, -1):
      if cs[j] == "R":
        cs[i], cs[j] = cs[j], cs[i]
        ans += 1
        sorted = j
        break
  if (i + 1) == j:
    break
print(str(ans))
Problem p02547 (python)

Fixed submission:
N=int(input())
x = [list(map(int, input().split())) for i in range(N)]
count=0
for i in range(N-2):
  if x[i][0]==x[i][1] and x[i+1][0]==x[i+1][1] and x[i+2][0]==x[i+2][1]:
     count=count+1
  else:
     count=count+0
else:
  if count>0 :
    print('Yes')
  else :
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
x = [list(map(int, input().split())) for i in range(N)]
count=0
for i in range(N-2):
  if x[i][0]==x[i][1] and x[i+1][0]==x[i+1][1] and x[i+2][0]==x[i+2][1]:
     count=count+1
  else:
     count=count
else:
  if count>0 :
    print'Yes'
  else :
    print'No'
Problem p02777 (python)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else:
  print(A,B-1)

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else
  print(A,B-1)

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else
  print(A,B-1)

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U=S:
  print(A-1,B)
else
  print(A,B-1)

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U=S:
  print(A-1,B)
else
  print(B,A-1)
Problem p02552 (python)

Fixed submission:
x = int(input())
print(1 - x)

Buggy submission (verdict: Runtime Error):
x = input()
print(1 - x)
Problem p02598 (python)

Fixed submission:
#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 1

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))

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

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 0

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))

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

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 0

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += (i - 0.01) // f
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))
Problem p02707 (python)

Fixed submission:
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]

for i in a:
    lis[int(i) - 1] += 1

for i in lis:
    print("{}".format(i))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]
count = 0

for i in a:
    lis[int(i - 1)] += 1

for i in lis:
    print("{}".format(i))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]
count = 0

for i in a:
    lis[i] += 1

for i in lis:
    if count == 0:
        count = 1
        continue
    print("{}".format(i))
Problem p02577 (python)

Fixed submission:
n = list(input())
a = 0
for i in n:
    a += int(i)
if(a % 9 == 0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=int(intput())
if(n%9==0):
   print("YES')
else:
  print("NO")
Problem p03137 (python)

Fixed submission:
def solve(n, m, x):
    if n >= m:
        return 0

    y = [x[i + 1] - x[i] for i in range(m - 1)]
    y.sort(reverse=True)

    return x[-1] - x[0] - sum(y[:n-1])

def main():
    n, m = map(int, input().split())
    x = [int(s) for s in input().split()]
    x.sort()

    print(solve(n, m, x))

main()

Buggy submission (verdict: Runtime Error):
def solve(current, n, idx, x):
    if n >= len(x) - idx:
        return 0

    if n == 0:
        return x[-1] - current


    if current is None:
        return solve(x[idx], n - 1, idx + 1, x)

    a = x[idx] - current + solve(x[idx], n, idx + 1, x)
    b = solve(x[idx], n - 1, idx + 1, x)
    return min(a, b)

def main():
    n, m = map(int, input().split())
    x = [int(s) for s in input().split()]
    x.sort()

    print(solve(None, n, 0, x))

main()
Problem p02571 (python)

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

i = 0
ans = []
while i <= len(s) - len(t):
    cnt = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            cnt += 1
    ans.append(cnt)
    i += 1

print(min(ans))

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

i = 0
ans = []
while i < len(s) - len(t):
    cnt = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            cnt += 1
    ans.append(cnt)
    i += 1

print(min(ans))
Problem p02623 (python)

Fixed submission:
import numpy as np

n, m, k = map(int, input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

a = [0]
b = [0]

a = np.append(a, np.cumsum(A))
b = np.append(b, np.cumsum(B))

j = m
ans = 0
for i in range(n + 1):
    if a[i] > k:
        break
    while a[i] + b[j] > k:
        j -= 1
    ans = max(ans, i + j)
    
print(ans)

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

n, m, k = map(int, input().split())

a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

a_cum = np.cumsum(a)
b_cum = np.cumsum(b)

j = m-1
ans = 0
for i in range(n):
    if a_cum[i] > k:
        break
    while a_cum[i] + b_cum[j] > k:
        j -= 1
    ans = max(ans, i + 1 + j + 1)
    
print(ans)
Problem p02546 (python)

Fixed submission:
import sys, re
import math
import numpy as np
from decimal import Decimal
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul	# 
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd	# 最大公約数
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.maxsize = 10 ** 15
sys.setrecursionlimit(10 ** 9 + 7)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

n = input()
if n[-1] == "s":
    print(n + "es")
else:
    print(n + "s")

Buggy submission (verdict: Runtime Error):
import sys, re
import math
import numpy as np
from decimal import Decimal
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul	# 
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd	# 最大公約数
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.maxsize = 10 ** 15
sys.setrecursionlimit(10 ** 9 + 7)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

n = input()
if n[len(n) - 1] == s:
    print(n + "es")
else:
    print(n + "s")
Problem p02729 (python)

Fixed submission:
import sys, re
import math
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7


n, m = MAP()

ans = 0

for x in range(0, n ):
    ans += x
for x in range(0, m ):
    ans += x

print(ans)

Buggy submission (verdict: Runtime Error):
n, m = MAP()

ans = 0

for x in range(0, n ):
    ans += x
for x in range(0, m ):
    ans += x

print(ans)
Problem p02550 (python)

Fixed submission:


def main():
    n, x, m = map(int, input().split())
    mflg = [-1] * m
    mflg[x] = 0
    ltot = [x]

    tot = x
    a = x
    for i in range(1, n):
        a = a ** 2 % m

        if mflg[a] >= 0:
            b = mflg[a]
            z = (n - i) // (i - b)
            y = (n - i) % (i - b)
            if b == 0 and y == 0:
                tot += ltot[i - 1] * z
            elif b == 0:
                tot += ltot[b - 1 + y] + ltot[i - 1] * z
            else:
                tot += (ltot[b - 1 + y] - ltot[b - 1]) + (ltot[i - 1] - ltot[b - 1]) * z
            break

        mflg[a] = i
        tot += a
        ltot.append(tot)

    print(tot)


main()

Buggy submission (verdict: Runtime Error):


def main():
    n, x, m = map(int, input().split())
    mflg = [0] + [-1] * (m-1)
    ltot = [x]

    tot = x
    a = x
    for i in range(1, n):
        a = a ** 2 % m
        if mflg[a-1] >= 0:
            z = (n - i) // (i - mflg[a-1]) - 1
            y = (n - j) % (i - mflg[a-1])
            tot += (ltot[mflg[a-1] - 1 + y] - ltot[mflg[a-1] - 1]) + (ltot[-1] - ltot[mflg[a-1] - 1]) * z
            break
        
        mflg[a-1] = i
        tot += a
        ltot.append(tot)

    print(tot)


main()
Problem p02580 (python)

Fixed submission:
h, w, m = map(int, input().split())

mp = set()
hp = [0] * h
wp = [0] * w

for i in range(m):
    a, b = map(int, input().split())
    mp.add((a, b))
    l = [a, b]
    hp[l[0]-1] += 1
    wp[l[1]-1] += 1

maxhp = max(hp)
maxwp = max(wp)
hpdex = [i for i, x in enumerate(hp) if x == maxhp]
wpdex = [i for i, x in enumerate(wp) if x == maxwp]

for i in hpdex:
    for j in wpdex:
        if (i+1, j+1) not in mp:
            print(max(hp) + max(wp))
            exit()

print(max(hp) + max(wp) - 1)

Buggy submission (verdict: Runtime Error):
h, w, m = map(int, input().split())

mp = set()
hp = [0] * h
wp = [0] * w

for i in range(m):
    l = list(map(int, input().split()))
    mp.add(l)
    hp[l[0]-1] += 1
    wp[l[1]-1] += 1

hpdex = [i for i, x in enumerate(hp) if x == max(hp)]
wpdex = [i for i, x in enumerate(wp) if x == max(wp)]

for i in range(len(hpdex)):
    for j in range(len(wpdex)):
        if [hpdex[i] + 1, wpdex[j] + 1] not in mp:
            print(max(hp) + max(wp))
            exit()

print(max(hp) + max(wp) - 1)
Problem p03012 (python)

Fixed submission:
min = 9999999
input()
balances = list(map(int, input().split()))
for i in range(1, len(balances)):
    S1=sum(balances[:i])
    S2=sum(balances[i:])

    if min > abs(S1-S2):
        min = abs(S1-S2)
print(min)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
hole=[]
for i in range(M):
    hole.append(int(input()))
res = 0

def serach(locale, num):
    global res
    if locale + num > N:
        return

    if locale + num == N:
        res+=1
        if res >= 1000000007:
            res=res%1000000007
        return

    if locale + num in hole:
        return

    serach(locale+num, 1)
    serach(locale+num, 2)

serach(0,1)
serach(0,2)

print(res)
Problem p02729 (python)

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

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
a=0
list1 = list(map(int, input().split()))
c = collections.Counter(list1)
for i in range(N):
    a+=int(c[i+1]*(c[i+1]-1)/2)
for i in range(N):
    if c[list1[i]]!=0:
        print(a-c[list1[i]]+1)
    else:
        print(a)
Problem p02759 (python)

Fixed submission:
i= int(input())
i= int((i+1)/2)
print(i)

Buggy submission (verdict: Runtime Error):
c=-1
d=0
f=0
g=0
N, M = map(int, input().split())
list = []
for i in range(M):
    a,b=input().split()
    list.append((int(a), int(b)))

for i in range(M):
	if list[i][0]>N and list[i][0]+list[i][1]==1:
		print(c)
		f=1
		break
	for j in range(i+1,M):
		if list[i][0]==list[j][0]:
			g=1
			if list[i][0]!=list[j][0]:
				print(c)
				f=1
				break
	if f==1:
		break
	if g==0:
		d+=list[i][1]*(10**(M-list[i][0]))
	g=0
if f==0:
	print(d)
Problem p02771 (python)

Fixed submission:
i = list(map(int, input().split()))
if i[0]==i[1] and i[0]!=i[2]:
    print('Yes')
elif i[0]==i[2] and i[0]!=i[1]:
    print('Yes')
elif i[1]==i[2] and i[0]!=i[1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
j = int(input())
i = list(map(int, input().split()))
l=0
for k in range(j):
    if i[k]%2==0:
        if i[k]%3!=0 and i[k]%5!=0:
            print('DENIED')
            l=1
            break
if l == 0:
    print('APPROVED')
Problem p02777 (python)

Fixed submission:
i = input().split()
j = list(map(int, input().split()))
k = input()
if k==i[0]:
    j[0]=j[0]-1
else:
    j[1]=j[1]-1
print(j[0], j[1])

Buggy submission (verdict: Runtime Error):
i = input()
print(re.sub'[abcdefghijklmnopqrstuvwyz]', 'x',i)
Problem p02688 (python)

Fixed submission:
from collections import Counter
import itertools
n, k = map(int, input().split())
d = []
sunuke = []
for i in range(k):
    d.append(int(input()))
    sunuke.append(list(map(int, input().split())))

new = list(itertools.chain.from_iterable(sunuke))

c = Counter(new)

print(n - len(c))

Buggy submission (verdict: Runtime Error):
from collections import Counter
import itertools
n, k = map(int, input().split())
d = []
sunuke = []
for i in range(k * 2 - 2):
    d.append(int(input()))
    sunuke.append(list(map(int, input().split())))

new = list(itertools.chain.from_iterable(sunuke))

c = Counter(new)

print(n - len(c))
Problem p02779 (python)

Fixed submission:
from collections import Counter

n = int(input())
a = list(map(int, input().split()))

c = Counter(a)
new = c.values()

for i in new:
    if i != 1:
        re = "NO"
        break
    else:
        re = "YES"

print(re)

Buggy submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
re = 0

c = Counter(a)

for i in values():
    if i >= 2:
        re += 1

if re >= 0:
    print("No")
else:
    print("Yes")
Problem p02725 (python)

Fixed submission:
K,N=input().split()
K=int(K)
N=int(N)
A=list(map(int,input().split()))
i=0
C=[]
for i in range(N-1):
    if (2<=K<=10**6)and(2<=N<=2*10**5)and(0<=A[i]<A[i+1]<K)and(i<N-1):
        B=A[i+1]-A[i]
        C.append(B)
        i+=1
    if (i==N-1)and(A[N-1]<K):
        B=K-A[N-1]+A[0]
        C.append(B)
d=max(C)
e=K-d
print(e)

Buggy submission (verdict: Runtime Error):
K,N=input().split()
K=int(K)
N=int(N)
A=list(map(int,input().split()))
i=0
C=[]
for i in range(N-1):
    if (2<=K<=10**5)and(2<=N<=2*10**5)and(0<=A[i]<A[i+1]<K)and(i<N-1):
        B=A[i+1]-A[i]
        C.append(B)
        i+=1
    if (i==N-1)and(A[N-1]<K):
        B=K-A[N-1]+A[0]
        C.append(B)
d=max(C)
e=K-d
print(e)
Problem p02753 (python)

Fixed submission:
S=input()
S=str(S)
if "AAA" in S:
    print("No")
elif "BBB" in S:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if 1<=A<=B<=100:
    A_a=A+1
    B_b=B+1
    A_1=A*(100/8)
    B_1=B*(100/10)
    A_1a=A_a*(100/8)
    B_1b=B_b*(100/10)
    if (A_1<B_1b)and(B_1<A_1a):
        if A_1<B_1:
            A_2=int(A_1)
            print(A_2)
        else:
            B_2=int(B_1)
            print(B_2)
    else:
        print(-1)
else:
    None
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split())
if (0<A+B<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    if N%(A+B)<=A:
        c=(N//(A+B))*A+N%(A+B)
        print(c)
    else:
        d=(N//(A+B))*A+A
        print(d)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
if (0<A+B<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue="a"*A+"b"*B
    while len(queue)<N:
        queue+="a"*A+"b"*B
    number=queue.count("a",0,N)
    print(number)
else:
    None

Buggy submission (verdict: Runtime Error):
N,A,B=input().split()
N=int(N)
A=int(A)
B=int(B)
C=A+B
if (0<C<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue="a"*A+"b"*B
    while len(queue)<N:
        queue+="a"*A+"b"*B
    number=queue.count("a",0,N)
    print(number)
else:
    None

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
C=A+B
if (0<C<10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*N
    number=queue.count("a",0,N)
    print(number)
else:
  None

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
C=A+B
if (0<C<10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*N
    number=queue.count("a",0,N)
    print(number)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
C=A+B
if (0<C<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*(10**100)
    number=queue.count("a",0,N)
    print(number)

Buggy submission (verdict: Runtime Error):
N,A,B=input().split()
N=int(N)
A=int(A)
B=int(B)
C=A+B
if (0<C<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*(10**18)
    number=queue.count("a",0,N)
    print(number)
Problem p02759 (python)

Fixed submission:
N=input("")
N=int(N)
if 1<=N<=100:
  if N%2==0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None

Buggy submission (verdict: Runtime Error):
N=input("")
try:N=int(N)
if 1<=N<=100:
  if N%2==0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None
except:
  None

Buggy submission (verdict: Runtime Error):
N=input("")
N=int(N)
if 1<=N<=100:
  if N%2=0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None