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

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

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

def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = 0
    B = [0] * n
    # ansList = []
    ansList = deque()

    def makeList(num):
        start = num + 1
        mul = n // start
        return [start * j - 1 for j in range(1, mul+1)]


    def makeRes(indices):
        flag = 0
        for elm in indices:
            if B[elm] == 1:
                flag = (flag + 1) % 2
        return flag


    for i in range(n-1, -1, -1):
        if i + 1 >  n / 2:
            if A[i] == 1:
                B[i] = 1
                ans += 1
                ansList.appendleft(i+1)
        else:
            indices = makeList(i)
            # print(indices)
            res = makeRes(indices)
            # print(res)
            if A[i] != res:
                B[i] = 1
                ans += 1
                ansList.appendleft(i+1)

    print(ans)

    if ans != 0:
        print(*(list(ansList)))


if __name__ == "__main__":
    main()
Problem p03289 (python)

Fixed submission:
s = input()
subs = s[2:-1]

if s[0] == 'A' and subs.count('C') == 1:
    for char in s[1:]:
        if char.isupper() and char != 'C':
            break
    else:
        print("AC")
        exit(0)

print("WA")

Buggy submission (verdict: Runtime Error):
(let ((s (read-line)))
  (princ (if (and (char= (char s 0) #\A)
                  (= 1 (count #\C s :start 2 :end (- (length s) 1) :test #'char=))
                  (not (some #'upper-case-p (remove #\C (subseq s 2) :count 1))))
    "AC"
    "WA")))
Problem p02858 (python)

Fixed submission:
def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)
H,W,T=map(int, input().split())
gh, gw = gcd(H, T), gcd(W, T)
h, w = H // gh, W // gw
MOD = 1000000007
print(pow(pow(2, h, MOD) + pow(2, w, MOD) + pow(2, gcd(h, w), MOD) - 3, gh * gw, MOD))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
gh, gw = gcd(H, T), gcd(W, T)
h, w = H // gh, W // gw
MOD = 1000000007
print(pow(pow(2, h, MOD) + pow(2, w, MOD) + pow(2, gcd(h, w), MOD) - 3, gh * gw, MOD))

Buggy submission (verdict: Runtime Error):
import math
H,W,T=map(int, input().split())
gh, gw = math.gcd(H, T), math.gcd(W, T)
h, w = H // gh, W // gw
MOD = 1000000007
print(pow(pow(2, h, MOD) + pow(2, w, MOD) + pow(2, math.gcd(h, w), MOD) - 3, gh * gw, MOD))

Buggy submission (verdict: Runtime Error):
import math
H,W,T=map(int, input().split())
gh, gw = math.gcd(H, T), math.gcd(W, T)
h, w = H // gh, W // gw
MOD = 1000000007
print(pow(pow(2, h, MOD) + pow(2, w, MOD) + pow(2, math.gcd(h, w), MOD) - 3, gh * gw, MOD))

Buggy submission (verdict: Runtime Error):
import math
H,W,T=map(int, input().split())
gh, gw = math.gcd(H, T), math.gcd(W, T)
h, w = H // gh, W // gw
MOD = 1000000007
print(pow(pow(2, h) + pow(2, w) + pow(2, math.gcd(h, w)) - 3, gh * gw, MOD))
Problem p02639 (python)

Fixed submission:
l = list(map(int, input().split()))
print(l.index(0) + 1)

Buggy submission (verdict: Runtime Error):
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[ll] = 1
  i = 1
  while true:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1
Problem p02641 (python)

Fixed submission:
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[ll] = 1
  i = 0
  while True:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1

Buggy submission (verdict: Runtime Error):
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[ll] = 1
  i = 0
  while true:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1

Buggy submission (verdict: Runtime Error):
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[ll] = 1
  i = 1
  while true:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1

Buggy submission (verdict: Runtime Error):
x, n = list(map(int, input().split()))
if not n:
  print(x) 
else:
  l = list(map(int, input().split()))
  dic = {} 
  for ll in l: dic[l] = 1
  i = 1
  while true:
    if not dic.get(x-i,0):
      print(x-i)
      break
    elif not dic.get(x+i, 0):
      print(x+i) 
      break
    i+=1
Problem p03434 (python)

Fixed submission:
N = int(input())
a = sorted([int(i) for i in input().split()], reverse=True)

Alice, Bob = 0, 0

for i in range(len(a)):
    if i % 2 == 0:
        Alice += a[i]
    else:
        Bob += a[i]

print(Alice - Bob)

Buggy submission (verdict: Runtime Error):


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    n = int(input())
    a = input().split()

    bob = 0
    alice = 0
    sort_a = sorted(a, reverse=True)
    count = 0
    for m in sort_a:
        if m % 2 == 0:
            alice = alice + int(m)
        else:
            bob = bob + int(m)

    print(alice - bob)
Problem p02778 (python)

Fixed submission:
s = input()
i = len(s)
print("x"*i)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() 
{
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    cout << "x";
  }

}
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()

print(s.count('ABC'))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = 0
for i in range(n):
    if s[i] == 'A' and s[i+1] == 'B' and s[i+2] == 'C':
        ans += 1
print(ans)
Problem p02639 (python)

Fixed submission:
# coding: utf-8
# 日本語を入力できるようにするために上記一文が必要

num_list = []
num_list = input().split()

ans = int(num_list.index('0')) + 1

print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# 日本語を入力できるようにするために上記一文が必要


x, y = map(int, input().split())
if y > 4*x or  2*x >y:
        print("No")
elif (4*x - y) % 2 == 0:
        print("Yes")
else:
        print("No")
Problem p02600 (python)

Fixed submission:
import sys

x = input()
y = int(x)


a = 400
b = 0
kyu = 8

while(1):
    
    if a + b <= y <= a + b + 199:
        print(str(kyu))
        break
    
    b = b + 200
    kyu = kyu - 1

Buggy submission (verdict: Runtime Error):
mylist = []
x = 0
while x <= 1:
  val = input()
  x = x + 1
  if val:
    mylist.append(val)
  else:
    break
 


a = mylist[0].split( )
A = int(a[0])
B = int(a[1])
C = int(a[2])
K = int(mylist[1])
r = A
g = B 
b = C



for k in range(K):
    if r > b and r > g:
        if r > b:
            b = b * 2
        elif r > g:
            g = g * 2
        elif g > b:
            b = b * 2
    elif g > r:
        g = g * 2
    elif b == g or b == r:
        b = b * 2
    elif b > g and g == r:
        g = g * 2


if b > g and g > r:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
mylist = []
x = 0
while x <= 1:
  val = input()
  x = x + 1
  if val:
    mylist.append(val)
  else:
    break
 


a = mylist[0].split( )
A = int(a[0])
B = int(a[1])
C = int(a[2])
K = int(mylist[1])
r = A
g = B 
b = C



for k in range(K):
    if r > b and r > g:
        if r > b:
            b = b * 2
        elif r > g:
            g = g * 2
        elif g > b:
            b = b * 2
    elif g > r:
        g = g * 2
    elif b == g or b == r:
        b = b * 2
    elif b > g and g == r
        g = g * 2


if b > g and g > r:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
mylist = []
x = 0
while x <= 1:
  val = input()
  x = x + 1
  if val:
    mylist.append(val)
  else:
    break
 


a = mylist[0].split( )
A = int(a[0])
B = int(a[1])
C = int(a[2])
K = int(mylist[1])
r = A
g = B 
b = C



for k in range(K):
    if r > b and r > g:
        if r > b:
            b = b * 2
        elif r > g:
            g = g * 2
        elif g > b:
            b = b * 2
    elif g > r:
        g = g * 2


if b > g and g > r:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
mylist = []
x = 0
while x <= 1:
  val = input()
  x = x + 1
  if val:
    mylist.append(val)
  else:
    break
 


a = mylist[0].split( )
A = int(a[0])
B = int(a[1])
C = int(a[2])
K = int(mylist[1])
r = A
g = B 
b = C



for k in range(K):
    if r > b:
        b = b * 2
    elif r > g:
        g = g * 2
    elif g > b:
        b = b * 2

if b > g and g > r:
    print("yes")
else:
    print("no")
Problem p02553 (python)

Fixed submission:
import itertools
def main():
    l = list(map(int, input().split()))
    all_pair = []
    all_pair.append(l[0]*l[2])
    all_pair.append(l[0]*l[3])
    all_pair.append(l[1]*l[2])
    all_pair.append(l[1]*l[3])
    print(sorted(all_pair)[-1])
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    l = list(map(int, input().split()))
    x = [i for i in range(l[0],l[1])]
    y = [i for i in range(l[2],l[3])]
    all_pair = [x*y  for i in x for j in y]
    print(sorted(all_pair)[-1])
if __name__ == '__main__':
    main()
Problem p02813 (python)

Fixed submission:
import itertools

def main():
    number = int(input())
    p = tuple(map(int, input().split()))
    q = tuple(map(int, input().split()))
    num_list = list(range(1, number+1))
    permu = list(itertools.permutations(num_list, number))
    where_p = permu.index(p)
    where_q = permu.index(q)
    print(abs(where_p-where_q))
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    number = int(input())
    p = tuple(map(int, input().split()))
    q = tuple(map(int, input().split()))
    num_list = list(range(1, number+1))
    permu = list(itertools.permutations(num_list, number))
    where_p = permu.index(p)
    where_q = permu.index(q)
    print(abs(where_p-where_q))
if __name__ == '__main__':
    main()
Problem p02687 (python)

Fixed submission:
s=input()
if s== 'ABC':
  print('ARC')
if s=='ARC':
  print('ABC')

Buggy submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
x=0
c=list()
for i in range(1,n+1):
  a=i+l[i-1]
  c.append(a)
  b=i-l[i-1]
  if b in c:
    x=x+c.count(b)
print(x)

Buggy submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
x=0
c=list()
for i in range(1,len(l)+1):
  a=i+l[i-1]
  c.append(a)
  b=i-l[i-1]
  if b in c:
    x=x+c.count(b)
print(x)
Problem p02717 (python)

Fixed submission:
x,y,z = map(int,input().split())
print(z,x,y)

Buggy submission (verdict: Runtime Error):
x,y,z = input()
print(z,y,x)
Problem p02600 (python)

Fixed submission:
Kyu = int(input())

if 400 <= Kyu < 600:
  print("8")
elif 600 <= Kyu < 800:
  print("7")
elif 800 <= Kyu < 1000:
  print("6")
elif 1000 <= Kyu < 1200:
  print("5")
elif 1200 <= Kyu < 1400:
  print("4")
elif 1400 <= Kyu < 1600:
  print("3")
elif 1600 <= Kyu < 1800:
  print("2")
elif 1800 <= Kyu < 2000:
  print("1")

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

if R < G < B:
  print("Yes")
  
for i in range(K):
  if R > G:
    G*=2
  elif G > B:
    B*=2
  elif R > B:
    B*=2
  elif R == G == B:
    B *= 2
  elif R == G:
    G *= 2
  elif G == B:
    B *= 2
  else:
    pass
if R < G < B:
  print("Yes")
else:
  print("No")
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+(a*a)+(a*a*a))

Buggy submission (verdict: Runtime Error):
a = input()
print(a+(a*a)+(a*a*a))
Problem p02645 (python)

Fixed submission:
S = input()

print(S[0:3])

Buggy submission (verdict: Runtime Error):
n = "NO"
y = "YES"

A, V = map(int, input().split()) #Aは初期座標 Vは1秒あたりの移動距離#
B, W = map(int, input().split()) #Aは初期座標 Wは1秒あたりの移動距離#
T = int(input()) #移動許可秒数#

##################################################
# 答えはT秒後に鬼が逃げ役と同じ座標or追い越せばYES#
# 計算はTLE対策として掛け算を使用　　　　　　　　　#
#V,W * T でT秒間の移動距離を算出 　　　　　　　　　#
# ANS = A,B + V,W * T　　　　　　　　　　　　　　　#   
##################################################

X = V * T
Y = W * T

A += X
B += Y

if B > A:
  print(y)
else:
  print(n)

Buggy submission (verdict: Runtime Error):
n = "NO"
y = "YES"

A, V = map(int, input().split()) #Aは初期座標 Vは1秒あたりの移動距離#
B, W = map(int, input().split()) #Aは初期座標 Wは1秒あたりの移動距離#
T = int(input()) #移動許可秒数#

##################################################
# 答えはT秒後に鬼が逃げ役と同じ座標or追い越せばYES#
# 計算はTLE対策として掛け算を使用　　　　　　　　　#
#V,W * T でT秒間の移動距離を算出 　　　　　　　　　#
# ANS = A,B + V,W * T　　　　　　　　　　　　　　　#   
##################################################

X = V * T
Y = W * T

A += X
B += Y

if B >= A:
  print(y)
else:
  print(n)
Problem p02898 (python)

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

c=0

for i in range(A):
  if N[i] >= B:
    c+=1
  else:
    pass
  i+=1
print(c)

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

c=0

for i in range(A):
  if N[i] >= B:
    c+=1
  else:
    pass
  i+=1
print(c)
Problem p02909 (python)

Fixed submission:
N = input()

W = ['Sunny','Cloudy','Rainy']

for i in range(3):
  if N == 'Rainy':
    print('Sunny')
    break
  elif N == W[i]:
    print(W[i+1])
  else:
    pass
  i+=1

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

W = ['Sunny','Cloudy','Rainy']

for i in range(3):
  if N == W[i]:
    print(W[i+1])
  else:
    pass
  i+=1
Problem p02945 (python)

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

p = A+B
m = A-B
M = A*B

L = []

L.append(p)
L.append(m)
L.append(M)

print(max(L))

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

p = A+B
m = A-B
M = A*B

L = []

L.append(p)
L.append(m)
L.append(M)

print(max(M))
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * r * r)

Buggy submission (verdict: Runtime Error):
r = input();
print(3 * r * r);
Problem p03160 (python)

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

dp = [0, abs(h[1]-h[0])]

for i in range(2, n):
    dp.append(min(dp[i-1] + abs(h[i-1]-h[i]), dp[i-2] + abs(h[i-2]-h[i])))

print(dp[-1])

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

dp = [0, abs(h[1]-[0])]

for i in range(2,n):
    dp.append(min(dp[i-1] + abs(h[i]-h[i+1]), dp[i] + abs(h[i]-h[i+2])))
    
print(dp[-1])
Problem p03361 (python)

Fixed submission:
H, W = map(int, input().split())
S = ["."*(W+2)] + ["." + input() + "." for _ in range(H)] + ["."*(W+2)] #塗りたし

for y in range(1, H+1):
    for x in range(1, W+1):
        if S[y][x] == '#' and (S[y-1][x] + S[y+1][x] + S[y][x-1] + S[y][x+1]).count('#') == 0:
            print("No")
            exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = ["."*(W+2)] + ["." + input() + "." for _ in range(H)] + ["."*(W+2)]
for y in range(1, H+1):
    for x in range(1, W+1):
        if S[y][x] = '#' and (S[y-1][x] + S[y+1][x] + S[y][x-1] + S[y][x+1]).count('#') == 0:
            print("No")
            exit()
print("Yes")
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
for a500 in range(A + 1):
    for b100 in range(B + 1):
        for c50 in range(C + 1):
            if a500 * 500 + b100 * 100 + c50 * 50 == X:
                res += 1
print(res)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
for a500 in range(A + 1):
    for b100 in range(B + 1):
        for c50 in range(C + 1):
            if a500 * 500 + b100 * 100 + c50 * 50 = X:
                res += 1
print(res)
Problem p03457 (python)

Fixed submission:
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 == (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print("Yes" if count == N else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 = (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print("Yes" if count == N else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 = (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print('Yes' if count == N else 'No')
Problem p03478 (python)

Fixed submission:
N, A, B = map(int, input().split())
res = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        res += num
print(res)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += num
print(sum)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += 1
print(sum)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int(input().split()))
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += 1
print(sum)
Problem p03493 (python)

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

Buggy submission (verdict: Runtime Error):
a = input()
print(a.count(1))
Problem p03680 (python)

Fixed submission:
N = int(input())
l = [int(input()) for i in range(N)]
index = 0
count = 0
for j in range(N):
    index = l[index] - 1
    count += 1
    if index == 1:
        print(count)
        exit()
print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [int(input()) for i in range(N)]
index = 0
count = 0
for j in range(N):
    index = l[index]
    count += 1
    if index == 2:
        print(count)
        exit()
print(-1)
Problem p02687 (python)

Fixed submission:
s = str(input())

if s == "ABC":
  print("ARC")
else:
  print("ABC")

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

if s = "ABC":
  print("ARC")
else:
  print("ABC")
Problem p02700 (python)

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

aoki = c
takahashi = a

for i in range(101):
  if aoki - b > 0: #高橋の攻撃
    if takahashi - d <= 0: #青木の攻撃で高橋負け
      print("No")
      break
    else: #戦闘続く
      takahashi = takahashi - d
      aoki = aoki - b
      continue
  else: #高橋勝ち
    print("Yes")
    break

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

aoki = c
takahashi = a

for i in range(101):
  if takahashi - d > 0: 
    if aoki - b =< 0: #高橋勝ち
      print("Yes")
      break
    else: #戦闘続く
      takahashi = takahashi - d
      aoki = aoki - c
      continue
  else: #高橋負け
    print("No")
    break
Problem p02742 (python)

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

if M == 1 or N == 1:
  print(1)
elif M * N % 2 == 1:
    print(M * N // 2 + 1)
elif M*  N % 2 == 0:
    print(M * N // 2)

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

if M == 1 or N == 1:
  print(1)
  break
  if M * N % 2 == 1:
    print(M * N // 2 + 1)
  elif M*  N % 2 == 0:
    print(M * N // 2)

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

if M*N % 2 == 1:
  print(M*N // 2 + 1)
elif M*N % 2 == 0:
  print(M*N // 2)
else M == 1 or N == 1:
  print(0)
Problem p03644 (python)

Fixed submission:
n = int(input())
list = [2**i for i in range(7)]

ans = 1

for k in list:
  if k <= n:
    ans = k
    if ans == 64:
      print(ans)
      break
    else:
      continue
  else:
    print(ans)
    break

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

for i in range(n+1): #nまでの数字について扱うよ
  for j in range(n): #それぞれの数字が割り切れなくなるまで割るよ
    if j % 2 != 1:
      j = j % 2
      cnt += 1
      continue
    else:
      list.append(j)
      
print(list.index(max(list))
Problem p03672 (python)

Fixed submission:
s = list(str(input()))

s_rev = list(reversed(s))
n = len(s_rev)

for i in range(n):
  del s_rev[0]
  if len(s_rev) % 2 == 1:
    continue
  elif s[0:len(s_rev)// 2] != s[(len(s_rev) // 2):len(s_rev)]:
    continue  
  elif len(s_rev) != 0:
    print(len(s_rev))
    break

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

s_rev = list(reversed(s))
n = len(s_rev)

for i in range(len(s_rev)):
  del s_rev[0]
    if len(s_rev) % 2 == 1:
      continue
    elif s[0:len(s_rev) // 2] != s[len(s_rev) // 2:len(s_rev)]:
      continue  
    elif len(s_rev) != 0:
      print(len(s_rev))
Problem p02548 (python)

Fixed submission:
n=int(input())
counter=0
for i in range(1,n+1):
    counter=counter+(n-1)//i
print(counter)

Buggy submission (verdict: Runtime Error):
n=int(input())
counter=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n-i*k):
            if((i*j+k)==n):
                counter=counter+1
print(counter)
Problem p02553 (python)

Fixed submission:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[3])

Buggy submission (verdict: Runtime Error):
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)d
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[3])

Buggy submission (verdict: Runtime Error):
a,b,c,d=int(input().split())
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*c)
list1.sort()
print(list1[3])

Buggy submission (verdict: Runtime Error):
a,b,c,d=int(input())
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*c)
list1.sort()
print(list1[3])
Problem p02548 (python)

Fixed submission:
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
N = int(input())
count = 0
for i in range(1,N):
    count += len(sympy.divisors(N-i))
print(count)
Problem p02553 (python)

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

print(max([a*c,a*d,b*c,b*d]))

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

if a < 0 and b < 0 :
    if c <= 0 :
        print(a*c)
    else :
        print(b*c)
elif a < 0 and b == 0:
    if c <= 0:
        print(a*c)
    else :
        print(b*c)
elif a < 0 and b > 0 :
    if d<=0 :
        print(a*c)
    else :
     if a * c < b * d :
        print(b*d)
    else :
        print(a*c)
elif a==0 and b > 0:
    if d <= 0:
        print(0)
    else :
        print(b*d)
elif a > 0 and b > 0:
    if d <= 0:
        print(a*d)
    else :
        print(b*d)
Problem p02582 (python)

Fixed submission:
S = list(input())
count = 0
max_count =0
for i in S :
    if(i=='R'):
        count = count + 1
    else :
        if(max_count < count) :
            max_count = count
            count = 0
if(max_count < count) :
    max_count = count

print(max_count)

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

if X <= K * D :
  if abs(X % D -D) < X % D :
    answer = abs(X % D -D)
  else :
    answer = X % D
else :
  answer = X - K * D

Buggy submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
answer = X
while K > 0 :
    if X > 0 :
        X = X - D
    else :
        X = X + D

    K = K - 1        
    if answer > abs(X) :
        answer = abs(X)  

print(answer)

Buggy submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
answer = X
while K > 0 :
  if X > 0 :
    X = X - D
  else :
    X = X + D
  K = K - 1        
  if answer > abs(X) :
    answer = abs(X)  
print(answer)