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

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

mo = n%k

mok = abs(mo - k)

if mo <= mok:
    print(mo)
else:
    print(mok)

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

mo = n%k

mok = abs(mo - k)

if mo = mok:
    print(mo)
else:
    print(mok)
Problem p02909 (python)

Fixed submission:
#atcoder beginner contest 141

weather = input("")

if weather == "Sunny":
    print("Cloudy")
elif weather == "Cloudy":
    print("Rainy")
elif weather == "Rainy":
    print("Sunny")

Buggy submission (verdict: Runtime Error):
#atcoder beginner contest 141

weather = input("")

if weather == "Sunny":
    print("Cloudy")
elif weather == "Cloudy":
    prinnt("Rainy")
elif weather == "Rainy":
    print("Sunny")
Problem p02713 (python)

Fixed submission:
from math import gcd
 
K = int(input())
 
result = 0
for a in range(1, K + 1):
  for b in range(1, K + 1):
    for c in range(1, K + 1):
      result += gcd(c, gcd(a, b))
      
print(result)

Buggy submission (verdict: Runtime Error):
from Math import gcd

K = int(input())

result = 0
for a in range(1, K + 1):
  for b in range(1, K + 1):
    for c in range(1, K + 1):
      result += gcd(c, gcd(a, b))
      
print(result)
Problem p03059 (python)

Fixed submission:
abt = input()
abt = list(map(int, abt.split(" ")))
output = (abt[2] + 0.5 ) //  abt[0] * abt[1]
print(int(output))

Buggy submission (verdict: Runtime Error):
import sys,os

f = open('a.txt', 'r')
sys.stdin = f

li = list(input().split())

A=int(li[0])
B=int(li[1])
T=int(li[2])

print(B*(T/A))
Problem p02744 (python)

Fixed submission:
N = int(input())
az = ['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']
def norm(n, in_list):
	out_list = []
	for line in in_list:
		for i in range(len(set(line))+1):
			new_line = line + az[i]
			out_list.append(new_line)
	return out_list
init_line = ['a']
for _ in range(N-1):
	init_line = norm(1, init_line)
for line in init_line:
	print(line)

Buggy submission (verdict: Runtime Error):
= int(input())
alphabet = ['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']
def norm(n, prev_list):
	out_list = []
	for line in prev_list:
		for i in range(len(set(line))+1):
			new_line = line + az[i]
			out_list.append(new_line)
	return out_list
init_line = ['a']
for _ in range(N-1):
	init_line = norm(1, init_line)
for line in init_line:
	print(line)

Buggy submission (verdict: Runtime Error):
N = int(input())
az = ['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']
def norm(n, in_list):
	out_list = []
	for line in in_list:
		for i in range(len(set(line))+1):
			new_line = line + alphabet[i]
			out_list.append(new_line)
	return out_list
init_line = ['a']
for _ in range(N-1):
	init_line = norm(1, init_line)
for line in init_line:
	print(line)

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

az = ['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']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new_l = l + az[i]
      		out_list.append(new_l)
	return out_list

line = ["a"]

for _ in range(n-1):
	line = norm(1,line)
  
for l in line:
	print(l)

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

az = ['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']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new_l = l + az[i]
      		out_list.append(new_l)
	return out_list

line = ["a"]

for _ in range(n-1):
  line = norm(1,line)
  
for l in line:
  print(l)

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

az = ['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']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new_l = l + az[i]
      		out_list.append(new_l)
	return out_list

line = ["a"]

for _ in range(N-1):
  line = norm(1,line)
  
for l in line:
  print(l)

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

az = ['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']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new = l + az[i]
      		out_list.append(new)
	return out_list

line = ["a"]

for _ in range(N-1):
  line = norm(1,line)
  
for l in line:
  print(l)
Problem p02778 (python)

Fixed submission:
import re
s = input()

print(re.sub("[a-z]", "x", s))

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

print(re.sub("[a-z]", "x"))
Problem p02780 (python)

Fixed submission:
n,k = map(int, input().split())
p = [int(e) for e in input().split()]
s = sum(p[0:k])
max = s
for i in range(n-k):
  s = s - p[i] + p[i+k]
  if max < s:
    max = s
    
ex = (max+k)/2.0
print(ex)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
p = [int(e) for e in input().split()]

max = 0
for i in range(n-k+1):
  j = i
  s = 0
  for j in range(k):
    s += e[j]
    j += 1
  if max < s:
    max = s
    
print((max+k)/1.0)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
p = [int(e) for e in input().split()]

e = [(q+1.0)/2 for q in p]

max = 0
for i in range(n-k+1):
  s = e[i]+e[i+1]+e[i+2]
  if max < s:
    max = s
    
print(max)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
p = [float(e) for e in input().split()]

e = [(q+1.0)/2.0 for q in p]

max = 0
for i in range(n-k+1):
  s = e[i]+e[i+1]+e[i+2]
  if max < s:
    max = s
    
print(max)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
p = [float(e) for e in input().split()]

e = [(q+1)/2 for q in p]

max = 0
for i in range(n-k+1):
  s = e[i]+e[i+1]+e[i+2]
  if max < s:
    max = s
    
print(max)

Buggy submission (verdict: Runtime Error):
n,k = map(float, input().split())
p = [float(e) for e in input().split()]

e = [(q+1)/2 for q in p]

max = 0
for i in range(n-k+1):
  s = e[i]+e[i+1]+e[i+2]
  if max < s:
    max = s
    
print(max)
Problem p02917 (python)

Fixed submission:
if __name__ == '__main__':
    n=int(input())
    a=[]
    b=[int(x) for x in input().split()]
    a.append(b[0])
    for i in range(n-2):
        a.append(min([b[i],b[i+1]]))
    a.append(b[-1])
    print(sum(a))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

if __name__ == '__main__':
    n=int(input())
    a_list=[int(x)-1 for x in input().split()]
    b_list=[int(x) for x in input().split()]
    c_list=[int(x) for x in input().split()]
    score=sum(b_list)
    pre_a=-100
    for a in a_list:
        if(a-pre_a==1):
            score+=c_list[pre_a]
        pre_a=a
    print(score)
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d=list(map(int, input().split()))
lcm=int(c*d/fractions.gcd(c,d))
could_divide=(b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm-(a-1)//lcm)
#print("could divide by "+str(c)+" : "+str(b//c-(a-1)//c))
#print("could divide by "+str(d)+" : "+str(b//d-(a-1)//d))
print(b-a+1-could_divide)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d=list(map(int, input().split()))
lcm=int(c*d/math.gcd(c,d))
could_divide=(b//c-(a-1)//c) + (b//d-(a-1)//d) - (b//lcm-(a-1)//lcm)
#print("could divide by "+str(c)+" : "+str(b//c-(a-1)//c))
#print("could divide by "+str(d)+" : "+str(b//d-(a-1)//d))
print(b-a+1-could_divide)
Problem p02995 (python)

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
G = gcd(C, D)
L = C * D // G
ca = (A - 1) // C
cb = B // C
da = (A - 1) // D
db = B // D
la = (A - 1) // L
lb = B // L
div = cb + db - (ca + da) - (lb - la)
print(B - (A - 1) - div)

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

A, B, C, D = map(int, input().split())
G = gcd(C, D)
L = C * D // G
ca = (A - 1) // C
cb = B // C
da = (A - 1) // D
db = B // D
la = (A - 1) // L
lb = B // L
div = cb + db - (ca + da) - (lb - la)
print(B - (A - 1) - div)
Problem p03026 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10000000)

N = int(input())
M = [[] for _ in range(N)]
P = [0] * N
V = [0] * N
for _ in range(N - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    M[a].append(b)
    M[b].append(a)
C = sorted(map(int, input().split()), reverse=True)

def dfs(n, cur):
    if V[n] == 1:
        return cur
    P[n] = C[cur]
    V[n] = 1
    cur += 1
    for c in M[n]:
        cur = dfs(c, cur)
    return cur

dfs(0, 0)
print(sum(C[1:]))
print(' '.join(map(str, P)))

Buggy submission (verdict: Runtime Error):
class Node():
    def __init__(self, p, l, r, n):
        self.p = p
        self.l = l
        self.r = r
        self.n = n


N = int(input())
T = [Node(-1, -1, -1, -1) for _ in range(N)]
S = []
for _ in range(N - 1):
    a, b = map(int, input().split())
    a, b = min(a, b), max(a, b)
    S.append([a - 1, b - 1])
S.sort()
C = sorted(map(int, input().split()), reverse=True)
for s in S:
    if T[s[0]].l == -1:
        T[s[0]].l = s[1]
        T[s[1]].p = s[0]
    else:
        T[l].r = s[1]
        T[s[1]].p = T[l].p
    l = s[1]


def rec(n, cur):
    if n == -1:
        return cur
    T[n].n = C[cur]
    cur += 1
    cur = rec(T[n].l, cur)
    cur = rec(T[n].r, cur)
    return cur


rec(0, 0)
print(sum(C[1:]))
print(' '.join(map(str, [t.n for t in T])))

# for i, t in enumerate(T):
#     print("node: {}, parent: {}, left-child: {}, right-sibling: {}, N: {}"
#           .format(i, t.p, t.l, t.r, t.n))
Problem p03029 (python)

Fixed submission:
a, p = map(int, input().split())
print((a * 3 + p) // 2)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = []
right = [0]
right_m = []
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
for i in range(K):
    for j in range(K - i):
        p = K - i - j
        minus = list(sorted(left_m[:i] + right_m[:j]))
        point = max(point, left[i] + right[j] - sum(minus[:p]))
print(point)
Problem p03032 (python)

Fixed submission:
N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = []
right = [0]
right_m = []
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
m = min(N, K)
for i in range(m + 1):
    for j in range(m - i + 1):
        p = K - i - j
        minus = list(sorted(left_m[:i] + right_m[:j]))
        point = max(point, left[i] + right[j] - sum(minus[:p]))
print(point)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = []
right = [0]
right_m = []
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
for i in range(K):
    for j in range(K - i):
        p = K - i - j
        minus = list(sorted(left_m[:i] + right_m[:j]))
        point = max(point, left[i] + right[j] - sum(minus[:p]))
print(point)

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

N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = []
right = [0]
right_m = []
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
for i in range(K + 1):
    for j in range(K + 1 - i):
        p = K - i - j
        minus = list(sorted(left_m[:i] + right_m[:j]))
        point = max(point, left[i] + right[j] - sum(minus[:p]))
print(point)

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

N, K = map(int, input().split())
d = list(map(int, input().split()))
left = [0]
left_m = [0]
right = [0]
right_m = [0]
for i, l, r in zip(range(K), d, d[::-1]):
    left.append(left[i] + l)
    left_m.append(l if l < 0 else 0)
    right.append(right[i] + r)
    right_m.append(r if r < 0 else 0)
point = 0
for i in range(K + 1):
    for j in range(K + 1 - i):
        minus = list(sorted(left_m[:i + 1] + right_m[:j + 1]))
        point = max(point, left[i] + right[j] - sum(minus[:K - i - j]))
print(point)
Problem p03050 (python)

Fixed submission:
import math

N = int(input())
ans = 0
for k in range(1, int(math.sqrt(N)) + 1):
  if N % k == 0:
    m = int(N / k) - 1
    if m == 0:
      continue
    ans += m if N % m == N // m else 0
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
ans = 0
for k in range(1, int(math.sqrt(N)) + 1):
  if N % k == 0:
    m = int(N / k) - 1 
    ans += m if N % m == N // m else 0
print(ans)
Problem p03074 (python)

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

left = 0
right = 0
op = 0
prev = '1'
ans = 0
while right < N:
    while right < N:
        if prev == '1' and S[right] == '0':
            op += 1
            if op > K:
                break
        prev = S[right]
        right += 1
    ans = max(ans, right - left)
    prev = S[left]
    while left < right:
        if prev == '0' and S[left] == '1':
            break
        prev = S[left]
        left += 1
    op -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
M = [[0], [0]]
start = int(S[0])
M[start].append(1)
prev = start
for s in S[1:]:
    if int(s) == prev:
        M[prev][-1] += 1
    else:
        prev = (prev + 1) % 2
        M[prev].append(M[prev][-1] + 1)
if len(M[0]) - 1 <= K:
    print(N)
else:
    ans = 0
    if start == 0:
        for i in range(len(M[1]) - K):
            ns = M[0][i + K] - M[0][i]
            hs = M[1][i + K] - M[1][i]
            ans = max(ans, ns + hs)
    else:
        for i in range(len(M[0]) - K):
            ns = M[0][i + K] - M[0][i]
            hs = M[1][i + K + 1] - M[1][i]
            ans = max(ans, ns + hs)
    print(ans)
Problem p03076 (python)

Fixed submission:
foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

if any(rest):
    print(time - 10 + min([i for i in rest if i != 0]))
else:
    print(time)

Buggy submission (verdict: Runtime Error):
foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

print(time - 10 + min([i for i in rest if i != 0]))
Problem p03078 (python)

Fixed submission:
from itertools import product

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

AB = sorted([a + b for a, b in product(A, B)], reverse=True)
ABC = sorted([ab + c for ab, c in product(AB[:max(K, Z)],
                                          sorted(C, reverse=True))],
             reverse=True)
for s in ABC[:K]:
    print(s)

Buggy submission (verdict: Runtime Error):
import heapq

X, Y, Z, K = map(int, input().split())
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)

heap = []
heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))
for _ in range(K):
    p, i, j, k = heapq.heappop(heap)
    heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
    heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
    heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
    print(-p)
Problem p03085 (python)

Fixed submission:
b = input()
d = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'}
print(d[b])

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

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

for _ in range(q):
    l, r = map(int, inp().split())
    print(sum(a[l-1:r-1]))
Problem p03086 (python)

Fixed submission:
s = [i for i in input()]
ans = 0
tmp = 0
acgt = ['A', 'C', 'G', 'T']
while s:
  if s.pop(0) in acgt:
    tmp += 1
  else:
    ans = max([ans, tmp])
    tmp = 0

ans = max([ans, tmp])
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
tmp = 0
acgt = ['A', 'C', 'G', 'T']
while s:
  if s.pop(0) in acgt:
    tmp += 1
  else:
    ans = max([ans, tmp])
    tmp = 0

ans = max([ans, tmp])
print(ans)
Problem p03129 (python)

Fixed submission:
n, k = [int(x) for x in input().split()]
if n % 2 == 1:
    ans = 'YES' if (n + 1) / 2 >= k else 'NO'
else :
    ans = 'YES' if n / 2 >= k else 'NO'

print(ans)

Buggy submission (verdict: Runtime Error):
print('YES' if (int(input()) + 1) // 2 > int(input()) else 'NO')

Buggy submission (verdict: Runtime Error):
import collections

a1, b1 = [int(x) for x in input().split()]
a2, b2 = [int(x) for x in input().split()]
a3, b3 = [int(x) for x in input().split()]

l = [a1, b1, a2, b2, a3, b3]
col = list(collections.Counter(l).values())
if col.count(1) == 2 & col.count(2) == 2:
    print('YES')
else:
    print('NO')
Problem p03212 (python)

Fixed submission:
N = int(input())

def dfs(s):
  if int(s) > N:
    return 0
  ret = 1 if all(s.count(c) > 0 for c in '753') else 0
  for c in '753':
    ret += dfs(s + c)
  return ret

print(dfs('0'))

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

def dfs(s):
  if int(s) > N:
    return 0
  ret = 1 if all(s.count(c) > 0 for c in '753') else 0
  for c in s:
    ret += dfs(s + c)
  return ret

print(dfs('0'))
Problem p03324 (python)

Fixed submission:
D, N = map(int, input().split())
print(100 ** D * N if N != 100 else 100 ** D * 101)

Buggy submission (verdict: Runtime Error):
print(100 ** int(input()) * int(input())
Problem p03854 (python)

Fixed submission:
def solve(s):
  while True:
    if s == '':
      return True
    else:
      if s[0:7] == 'dreamer'[::-1]:
        s = s[7:]
      elif s[0:5] == 'dream'[::-1]:
        s = s[5:]
      elif s[0:5] == 'erase'[::-1]:
        s = s[5:]
      elif s[0:6] == 'eraser'[::-1]:
        s = s[6:]
      else:
        return False
  
print('YES' if solve(input()[::-1]) else 'NO')

Buggy submission (verdict: Runtime Error):
def rec(s):
  if s == '':
    return True
  else:
    res = False
    res = res or rec(s[7:]) if len(s) > 6 and s[0:7] == 'dreamer' else res
    res = res or rec(s[5:]) if len(s) > 4 and s[0:5] == 'dream' else res
    res = res or rec(s[5:]) if len(s) > 4 and s[0:5] == 'erase' else res
    res = res or rec(s[6:]) if len(s) > 5 and s[0:6] == 'eraser' else res
    return res
  
print('YES' if rec(input()) else 'NO')

Buggy submission (verdict: Runtime Error):
def rec(s):
  if s == '':
    return True
  else:
    res = False
    res = res or rec(s[7:]) if s[0:7] == 'dreamer' else res
    res = res or rec(s[5:]) if s[0:5] == 'dream' else res
    res = res or rec(s[5:]) if s[0:5] == 'erase' else res
    res = res or rec(s[6:]) if s[0:6] == 'eraser' else res
    return res
  
print('YES' if rec(input()) else 'NO')
Problem p02765 (python)

Fixed submission:
a,b=map(int, input().split())
if a >= 10:
  x = b
else:
  x = b+100*(10-a)
print(x)

Buggy submission (verdict: Runtime Error):
int(input(a,b))
if a >= 10:
  x = b
else:
  x = b+100*(10-a)
print(x)
Problem p02909 (python)

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

Buggy submission (verdict: Runtime Error):
today = input()
if (today == "Sunny") print("Cloudy")
elif (today == "Cloudy") print("Rainy")
else print("Sunny")
Problem p03219 (python)

Fixed submission:
x,y=(int(n) for n in input().split())
print(x+y//2)

Buggy submission (verdict: Runtime Error):
x=int(input())
y=int(input())
print(x+y//2)
Problem p03556 (python)

Fixed submission:
n=int(input())
i=1
while i*i<=n:
    i+=1
print((i-1)*(i-1))

Buggy submission (verdict: Runtime Error):
n=int(input())
i=1
while i*i<=n:
    i+=1
print(i-1)*(i-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
i=1
while i^2<=N:
    i+=1
print(N-1)
Problem p02714 (python)

Fixed submission:
N = int(input())
S = input()
 
r = S.count('R')
g = S.count('G')
b = S.count('B')
max = r * g * b 
 
count = 0
for i in range(N-2):
	for j in range(i+1, N-1):
		k = 2 * j - i
		if k > N - 1:
			break
	
		if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
			count += 1
		
		
 
print(max - count)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
c=0
for i in range(1,n+1):
    for j in range(i+1,n+1):
        if if s[i-1]==s[j-1]:
            continue
        for k in range(j+1,n+1):
            if s[k-1]!=s[j-1] and s[i-1]!=s[k-1]:
                if j-i != k-j:
                    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
c=0
for i in range(1,n+1):
    for j in range(i+1,n+1):
        if if s[i-1]==s[j-1]:
            break
        for k in range(j+1,n+1):
            if s[k-1]!=s[j-1] and s[i-1]!=s[k-1]:
                if j-i != k-j:
                    c+=1
print(c)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1"))
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
Problem p03494 (python)

Fixed submission:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
Problem p02731 (python)

Fixed submission:
l = int(input())

v = (l/3)**3

print(v)

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

v = (l/3)**2

print(v)
Problem p02755 (python)

Fixed submission:

a, b = map(int, input().split())

c =0 
for n in range(0,10000):
    taxa = int(n*8/100)
    taxb = int(n*10/100)
    if a == taxa and b == taxb:
        print(n)
        break
    else:
        c += 1
if c > 9999:
    print(-1)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
A = math.floor(a/0.08)
B = math.floor((a/0.8)/0.1)


c = math.gcd(A, B)
if c == 1 or c >= 100:
    print(-1)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
A = math.floor(a/0.08)
B = math.floor((a/0.8)/0.1)


c = math.gcd(A, B)
if c == 1:
    print(-1)
else:
    print(c)
Problem p02921 (python)

Fixed submission:
s = str(input())
t = str(input())
 
ans = 0
 
for i in range(3):
  if s[i]==t[i]:
    ans += 1
print(ans)

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

ans = 0

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