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

Fixed submission:
A,B,N=map(int,input().split())
if N+1>=B:
    T=int(A*(B-1)/B)
    print(T)
else:
    T=int(A*N/B)
    print(T)

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

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
N = int(input())
print(int(A*(N-1)/B)-A*int((N-1)/B))
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
if A<B and B <C:
    T = A
    A = B
    B = T
    print(A,B,C)
else:
    T1 = A
    A = C
    C = T1
    print(A,B,C)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
if A<B and B <C:
    T = A
    A = B
    B = T
    print(A,B,C)
else:
    T1 = A
    A = C
    C = T1
    print(A,B,C)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
if A<B and B <C:
    T = A
    A = B
    B = T
	print(A,B,C)
else:
    T1 = A
    A = C
    C = T1
    print(A,B,C)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
T = A
A = B
B = T
print(A,B,C)
T1 = A
A = C
C = T1
print(A,B,C)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())
T = X
X = Y
Y = T
print(X,Y,Z)
T1 = X
X = Z
Z = T1
print(X,Y,Z)
Problem p02724 (python)

Fixed submission:
l = int(input())
print(int(l/500)*1000+int((l%500)/5)*5)

Buggy submission (verdict: Runtime Error):
l = input()
if l>1000:
  print(l*2)
elif l>=0 and l<1000:
  print(l)
else:
  print("Invalid")
Problem p02607 (python)

Fixed submission:
N = int(input())
a = [int(a) for i, a in enumerate(input().split()) if i%2 == 0]
ans = [i for i in a if i%2==1]
print(len(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(a) for i, a in enumerate(input().split()) if i%2 == 0]
ans = [i for i in a if a%2==1]
print(len(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = [int(a) for i, a in enumerate(input().split()) if i%2 == 0 and if a%2==1]

print(len(ans))
Problem p02687 (python)

Fixed submission:
s = input()
if s[1] == "R":
  print("ABC")
else:
  print("ARC")

Buggy submission (verdict: Runtime Error):
s = input();print("ABC"*s==ARC or "ARC")
Problem p02694 (python)

Fixed submission:
m = 100
quota = int(input())
cnt = 0
while(True):
    if m >= quota:
        print(cnt)
        exit()
    m = int(m*1.01)
    cnt += 1

Buggy submission (verdict: Runtime Error):
m = 100
quota = int(input())
cnt = 0
while(m<=quote):
  m = int(m*1.01)
  cnt += 1
  
print(cnt)
Problem p02696 (python)

Fixed submission:
import math
a, b, n = map(int, input().split())
if b>n:
    print(math.floor(a*n/b))
else:
    x = b-1
    print(math.floor(a*x/b))

Buggy submission (verdict: Runtime Error):
import math
a, b, n = map(int, input().split())
if b>n:
    print(math.floor(a*n/b))
else:
  	x = b-1
    print(math.floor(a*x/b))
Problem p02732 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
 
from collections import Counter
c=Counter(a)
 
max_c=0			# max combination
for i in c.values():
    max_c+=i*(i-1)//2     # 6+1+1 = 8
 
for num in a:
    k=c[num]      # 4 2 4 2 2 4 2 4
 
    print(max_c-(k*(k-1)//2)+((k-1)*(k-2)//2)) # different from max combination
                # 8 - 6 + 3
                # 5

Buggy submission (verdict: Runtime Error):
import numpy as np
 
def comb2(n):
    return n*(n-1)//2

n = int(input())
 
a = np.array([int(i) for i in input().split()])
 
b = a+a.reshape(n,1)
 
e = np.ones(n, dtype=int) - np.identity(n, dtype=int)
 
c = b * e
 
for nums in c:
    sums = 0
    tmp, counts = np.unique(nums, return_counts=True)
    for num in counts:
        sums += comb2(num)
    print(sums)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
 
from collections import Counter
c=Counter(a)
 
max_c=0			# max combination
for i in c.values():
    max_c+=i*(i-1)//2     # 6+1+1 = 8
 
for num in a:
    k=c[num]      # 4 2 4 2 2 4 2 4
 
    print(ans-(k*(k-1)//2)+((k-1)*(k-2)//2)) # different from max combination
                # 8 - 6 + 3
                # 5

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

from collections import Counter
c=Counter(A)

ANS=0	# max combination
for i in C.values():
    ANS+=i*(i-1)//2     # 6+1+1 = 8
 
for a in A:
    k=C[a]      # 4 2 4 2 2 4 2 4
 
    print(ANS-(k*(k-1)//2)+((k-1)*(k-2)//2)) # different from max combination
                # 8 - 6 + 3
                # 5

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

def comb2(n):
    return int(n*(n-1)/2)

n = int(input())

a = np.array([int(i) for i in input().split()])

b = a+a.reshape(n,1)

e = np.ones(n, dtype=int) - np.identity(n, dtype=int)


c = b * e

for nums in c:
    sums = 0
    tmp, counts = np.unique(nums, return_counts=True)
    for num in counts:
        sums += comb2(num)
    print(sums)

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

def comb2(n):
    return int(n*(n-1)/2)

n = int(input())

a = np.array([int(i) for i in input().split()])

b = a+a.reshape(n,1)

e = np.ones(n, dtype=int) - np.identity(n, dtype=int)


c = b * e

for i in range(n):
    sums = 0
    tmp, counts = np.unique(c[i], return_counts=True)
    for num in counts:
        sums += comb2(num)
    print(sums)
Problem p02748 (python)

Fixed submission:
# coding: utf-8
# Your code here!

x, y, m = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num = [min(a)+min(b)]

for _ in range(m):
    tmp = [int(i) for i in input().split()]
    num.append(a[tmp[0]-1]+b[tmp[1]-1]-tmp[2])

print(min(num))

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

x, y, m = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num = [min(a)+min(b)]

for _ in range(m):
    tmp = [int(i) for i in input().split()]
    num.append(a[tmp[0]]-1+b[tmp[1]]-1-tmp[2])

print(min(num))
Problem p02921 (python)

Fixed submission:
pred = [i for i in input()]
data = [i for i in input()]
cnt = 0

for i in range(3):
  if pred[i] == data[i]:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
s = int(input())
t = int(input())
cnt = 0
for i, a in enumerate(s):
  if t[i] == a:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
pred = [i for i in input()]
data = [i fpr i in input()]
cnt = 0

for i in range(3):
  if pred[i] == data[i]:
    cnt += 1

print(cnt)
Problem p02945 (python)

Fixed submission:
a,b = map(int, input().split())
print(max([a+b, a-b, a*b]))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(max([a+b, a-b, a×b]))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
print([a+b, a-b, a×b])
Problem p02952 (python)

Fixed submission:
print(sum(len(str(x+1))%2for x in range(int(input()))))

Buggy submission (verdict: Runtime Error):
n = input()
cnt = 0
if len(n)%2==0:
    for i in range(len(n)//2):
        cnt += 100**i *9
        
else:
    cnt += int(n[1:]) + 1
    for i in range(len(n)//2):
        cnt += 100**i *9

print(cnt)
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
 
for i in reversed(range(1,n)):
    if h[i] < h[i-1]:
        h[i-1] -= 1
        if h[i] < h[i-1]:
            print("No")
            exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n, *a = [*open(0)]

if n==1:
    print('Yes')
    exit()
    
a = [int(i) for i in "".join(a).replace(" ", "")]
for i, x in enumerate(a[:-1]):
    if x-1 > a[i+1]:
        print('No')
        exit()
    
print('Yes')
Problem p02957 (python)

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

if (A+B) % 2:
  print('IMPOSSIBLE')
else:
  print((A+B)//2)

Buggy submission (verdict: Runtime Error):
a=eval(input().replace(' ', '+');print(a%2*'IMPOSSIBLE' or a//2)
Problem p02658 (python)

Fixed submission:

# number of elements 
n = int(input()) 
  
# Below line read inputs from user using map() function  
a = list(map(int,input().strip().split()))[:n] 
  
mask = 1;
flag = 0;
for num in a:
    if(num == 0):
            flag = 1
mask = 1;
flagex  = 0;
if(flag == 1):
    print(0)
else:
    for num in a:
        mask *= num;
        if(mask > 1000000000000000000):
            flagex = -1;
            break;
    if(flagex == -1):
        print(-1);
    else:
        print(mask);

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int lli;
#define MAX 100005
#define endl "\n"
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	lli n;
	cin>>n;
	lli mask = 1;
	lli temp;
	bool flag = false;
	bool fzero = false;
	for(lli i = 0; i<n; i++){
		cin>>temp;
		mask *= temp;
		if(mask < 0 || mask > 1000000000000000000){
			flag = true;
		}
		if(temp == 0)
			fzero = true;
	}
	if(fzero){
		cout<<0<<endl;
		return 1;
	}
	if(flag){
		cout<<"-1"<<endl;
		return 1;
	}
	cout<<mask<<endl;
}
Problem p02573 (python)

Fixed submission:
import os

n,m = (int(x) for x in input().split())

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    unite(a,b)

ans = 0
for i in range(0,n):
    ans = max([ans,size(i)])

print(ans)

Buggy submission (verdict: Runtime Error):
n,m = (int(x) for x in input().split())
friendlist = [0]*(n+1)
classes = 0
for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    if friendlist[a]!=0:
        friendlist[b] = friendlist[a]
    elif friendlist[b]!=0:
        friendlist[a] = friendlist[b]
    else:
        classes += 1
        friendlist[a] = classes
        friendlist[b] = classes

count = [0]*(classes+1)
for i in range(n):
    count[friendlist[i]] += 1
print(max(count[1:]))

Buggy submission (verdict: Runtime Error):
n,m = (int(x) for x in input().split())
friendlist = [0]*n
classes = 1
for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    if friendlist[a]!=0:
        friendlist[b] = friendlist[a]
    elif friendlist[b]!=0:
        friendlist[a] = friendlist[b]
    else:
        friendlist[a] = classes
        friendlist[b] = classes
        classes += 1

count = [0]*classes
for i in range(n):
    count[friendlist[i]] += 1

print(max(count[1:]))

Buggy submission (verdict: Runtime Error):
n,m = (int(x) for x in input().split())
friendlist = [0]*n
classes = 1
for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    if friendlist[a]!=0:
        friendlist[b] = friendlist[a]
    elif friendlist[b]!=0:
        friendlist[a] = friendlist[b]
    else:
        friendlist[a] = classes
        friendlist[b] = classes
        classes += 1

count = [0]*classes
for i in range(n):
    count[friendlist[i]] += 1

print(count)
print(max(count[1:]))
Problem p02630 (python)

Fixed submission:
n = int(input())
dic = {}
list = [int(i) for i in input().split()]
for i in list:
    if i not in dic:
        dic[i] = 0
    dic[i] += 1
q = int(input())
ans = sum(list)
for j in range(q):
    b,c = (int(x) for x in input().split())
    if b not in dic:
        print(ans)
        continue
    else:
        if c not in dic:
            dic[c] = dic[b]
        else:
            dic[c] += dic[b]
    ans = ans + (c-b)*dic[b]
    dic[b] = 0
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
dic = {}
list = [int(i) for i in input().split()]
for i in list:
    if i not in dic:
        dic[i] = 0
    dic[i] += 1
q = int(input())
ans = sum(list)
for j in range(q):
    b,c = (int(x) for x in input().split())
    if b not in dic:
        pass
    else:
        if c not in dic:
            dic[c] = dic[b]
        else:
            dic[c] += dic[b]
    ans = ans + (c-b)*dic[b]
    dic[b] = 0
    print(ans)
Problem p02658 (python)

Fixed submission:
n = int(input())
list = [int(i) for i in input().split()]

ans = 1
flag = True
for i in range(n):
    ans *= list[i]
    if ans>10**18:
        flag = False
        ans = ans%(10**18)
    if list[i]==0:
        flag = True
        break

if flag:
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
list = [int(i) for i in input().split()]

ans = 1
flag = True
for i in range(n):
    if i%2==0:
        right *= list[i]
    else:
        left *= list[i]

ans = left*right
if ans>10**18:
    print(-1)
else:
    print(ans)
Problem p02683 (python)

Fixed submission:
n,m,x = (int(x) for x in input().split())
C = []
A = []
for i in range(n):
    list = [int(i) for i in input().split()]
    C.append(list[0])
    A.append(list[1:])
i = 0
case = [0]*(2**n)
chk = []
for i in range(2**n):
    chk.append([0]*m)
i = 0
for i in range(2 ** n):
    for j in range(n):
        if ((i >> j) & 1):
            case[i] += C[j]
            for l in range(m):
                chk[i][l] += A[j][l]
i = 0
j = 0
ans = []
flag = [True]*(2**n)
for i in range(2**n):
    for j in range(m):
        if chk[i][j]<x:
            flag[i] = False
    if flag[i]:
        ans.append(case[i])

if ans==[]:
    print(-1)
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
n,k,x = (int(x) for x in input().split())
C = []
A = []
for i in range(n):
    list = [int(i) for i in input().split()]
    C.append(list[0])
    A.append(list[1:])
i = 0
case = [0]*(2**n)
chk = []
for i in range(2**n):
    chk.append([0]*m)
i = 0
for i in range(2 ** n):
    for j in range(n):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            case[i] += C[j]
            for l in range(m):
                chk[i][l] += A[j][l]
i = 0
j = 0
ans = []
flag = [True]*(2**n)
for i in range(2**n):
    for j in range(m):
        if chk[i][j]<x:
            flag[i] = False
    if flag[i]:
        ans.append(case[i])

if ans==[]:
    print(-1)
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
n,k,x = (int(x) for x in input().split())
C = []
A = []
for i in range(n):
    list = [int(i) for i in input().split()]
    C.append(list[0])
    A.append(list[1:])
case = [0]*(2**n)
chk = []
for i in range(2**n):
    chk.append([0]*m)

for i in range(2 ** n):
    for j in range(n):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            case[i] += C[j]
            for l in range(m):
                chk[i][l] += A[j][l]

ans = []
flag = [True]*(2**n)
for i in range(2**n):
    for j in range(m):
        if chk[i][j]<x:
            flag[i] = False
    if flag[i]:
        ans.append(case[i])

if ans==[]:
    print(-1)
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
n,k,x = (int(x) for x in input().split())
C = []
A = []
for i in range(n):
    list = [int(i) for i in input().split()]
    C.append(list[0])
    A.append(list[1:])
case = [0]*(2**n)
chk = []
for i in range(2**n):
    chk.append([0]*m)

for i in range(2 ** n):
    for j in range(n):  
        if ((i >> j) & 1):  
            case[i] += C[j]
            for l in range(m):
                chk[i][l] += A[j][l]

ans = []
flag = [True]*(2**n)
for i in range(2**n):
    for j in range(m):
        if chk[i][j]<x:
            flag[i] = False
    if flag[i]:
        ans.append(case[i])

if ans==[]:
    print(-1)
else:
    print(min(ans))
Problem p02684 (python)

Fixed submission:
n,k = (int(x) for x in input().split())
town = [int(i) for i in input().split()]
warp  = [1]
checklist = [0]+[-1]*n
i = 0
j = 1
s = 0
while j<=n:
    warp.append(town[i])
    if checklist[town[i]-1]!=-1:
        s = checklist[town[i]-1]
        loop = warp[s:j]
        break
    checklist[town[i]-1] = j
    i = town[i]-1
    j += 1
if k>=s:
    m = len(loop)
    print(loop[(k-s)%m])
else:
    print(warp[k])

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
town = [int(i) for i in input().split()]
warp  = [1]
checklist = [0]+[-1]*n
i = 0
j = 0
s = 0
while j<=n:
    warp.append(town[i])
    if checklist[town[i]-1]!=-1:
        s = checklist[town[i]-1]
        warp = warp[s:j]
        break
    checklist[town[i]-1] = j
    i = town[i]-1
    j += 1

m = len(warp)
print(warp[(k-s)%m])

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
town = [int(i) for i in input().split()]
warp  = [1]
checklist = [0]+[-1]*n
i = 0
j = 0
while j<=n:
    warp.append(town[i])
    if checklist[town[i]-1]!=-1:
        s = checklist[town[i]-1]
        warp = warp[s:j]
        break
    checklist[town[i]-1] = j
    i = town[i]-1
    j += 1


m = len(warp)
print(warp[(k-s)%m])

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
town = [int(i) for i in input().split()]
warp  = [1]
checklist = [0]+[-1]*n
i = 0
j = 0
while j<=n:
    #print(town[i])
    warp.append(town[i])
    #print(warp,checklist)
    if checklist[town[i]-1]!=-1:
        s = checklist[town[i]-1]
        warp = warp[s:j]
        #print(checklist[town[i]-1],j)
        #print("a",warp)
        break
    checklist[town[i]-1] = j
    i = town[i]-1
    j += 1


m = len(warp)
print(warp[(k-s)%m])
Problem p02717 (python)

Fixed submission:
x,y,z = (str(x) for x in input().split())
print(" ".join([z,x,y]))

Buggy submission (verdict: Runtime Error):
x,y,z = (int(x) for x in input().split())
print(" ".join([z,x,y]))
Problem p02756 (python)

Fixed submission:


s = input()
q = int(input())

def addflont(s,c):
    text = "".join([c,s])
    return text
def addback(s,c):
    text = "".join([s,c])
    return text

reverse = 0
r = "";u = ""
for i in range(q):
    t = input()
    if t[0]=="1":
        reverse = reverse^1
    if t[0]=="2":
        if t[2]=="1":
            if reverse==0:
                r = addflont(r,t[4])
            else:
                u = addback(u,t[4])
        elif t[2]=="2":
            if reverse==0:
                u = addback(u,t[4])
            else:
                r = addflont(r,t[4])

s = r + s + u
if reverse==1:
    print(s[::-1])
else:
    print(s)

Buggy submission (verdict: Runtime Error):


s = input()
q = int(input())

def addflont(s,c):
    return c+s
def addback(s,c):
    return s+c

reverse = 0

for i in range(q):
    t = input()
    if t[0]=="1":
        reverse = reverse^1
    if t[0]=="2":
        if t[2]=="1":
            if reverse==0:
                s = c+s
            else:
                s = s+c
        elif t[2]=="2":
            if reverse==0:
                s = s+c
            else:
                s = c+s

if reverse==1:
    print(s[::-1])
else:
    print(s)
Problem p02802 (python)

Fixed submission:
n,m = (int(x) for x in input().split())
memo = [0]*n
pena = [0]*n
ans2 = 0
for i in range(m):
    p,s = (str(x) for x in input().split())
    p = int(p)
    if s=="AC":
        memo[p-1] = 1
    elif s=="WA":
        if memo[p-1]==0:
            pena[p-1] += 1

for j in range(n):
    if memo[j]==1:
        ans2 += pena[j]

print("{} {}".format(sum(memo),ans2))

Buggy submission (verdict: Runtime Error):
n,m = (int(x) for x in input().split())
memo = [0]*n
pena = [0]*n
ans2 = 0
for i in range(m):
    p,s = (str(x) for x in input().split())
    p = int(p)
    if s=="AC":
        memo[p-1] = 1
    elif s=="WA":
        if memo[p-1]==0:
            pena[p-1] += 1

for j in range(p):
    if memo[j]==1:
        ans2 += pena[j]

print("{} {}".format(sum(memo),ans2))

Buggy submission (verdict: Runtime Error):
n,m = (int(x) for x in input().split())
memo = [0]*n
pena = [0]*n
ans2 = 0
for i in range(m):
    p,s = (str(x) for x in input().split())
    p = int(p)
    if s=="AC":
        memo[p-1] = 1
    elif s=="WA":
        if memo[p-1]==0:
            pena[p-1] += 1

for j in range(p):
    if memo[j]==1:
        ans2 += pena[j]

print("{} {}".format(sum(memo),ans2))
Problem p02899 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]

i = 0
person = []
for j in range(n):
    person.append(0)
ans = []
for k in a:
    i += 1
    person[k-1] = i

a.sort()
for l in a:
    ans.append(str(person[l-1]))

order = ' '.join(ans)
print(order)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

i = 0
person = [0,0,0,0,0,0,0,0]
ans = []
for k in a:
    i += 1
    person[k-1] = i

a.sort()
for l in a:
    ans.append(str(person[l-1]))

order = ' '.join(ans)
print(order)
Problem p02921 (python)

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

k = 0
count = 0
while k < 3:
    if s[k] == t[k]:
        count += 1
    k += 1
print(count)

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

mod = (N-1)*N/2
print(int(mod))

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

mod = (N-1)*N/2
print(mod)
Problem p02981 (python)

Fixed submission:
N,A,B =(int(x) for x in input().split())
An = N*A
if(An < B):
    print(An)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
L,R =(int(x) for x in input().split())
if(L<2019<R):
    print(1)
elif(L<=3 and R>=673):
    print(0)
else:
    if((L%2019)^2 < (R%2019)^2):
        if(((L+1)%2019)^2 < (R%2019)^2):
            print((L*(L+1))%2019)
        else:
            print((L*R)%2019)
    else:
        if((L%2019)^2 < ((R-1)%2019)^2):
            print((R*L%2019))
        else:
            print(((R+1)*R)%2019)
Problem p02993 (python)

Fixed submission:
list = input()
chk = 10
for code in list :
    if chk == code :
        print("Bad")
        break
    chk = code
else :
    print("Good")

Buggy submission (verdict: Runtime Error):
A,B,C,D = (int(x) for x in input().split())
n = A
count = 0
while n <= B:
    if n%C != 0 
        if n%D != 0:
            count += 1
    n += 1
print(count)
Problem p03068 (python)

Fixed submission:
n = int(input())
s = list(map(str,input()))
k = int(input())

a = s[k-1]

for i in range(n):
    if s[i]==a:
        continue
    else:
        s[i] = "*"

print("".join(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(str,input()))
k = input()

a = s[k-1]

for i in range(n):
    if s[i]==a:
        continue
    else:
        s[i] = "*"

print("".join(s))
Problem p03478 (python)

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

ans = 0

def keta(N):
    sum = 0
    while N>0:
        sum += N%10
        N = N//10
    return sum

for i in range(1,n+1):
    if a<=keta(i)<=b:
        ans +=i
print(ans)

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

ans = 0

def keta(n):
    sum = 0
    while n>0:
        sum += n%10
        n = n//10
return sum

for i in range(1,n):
    if a<=keta(i)<=b:
        ans +=keta(i)
print(ans)

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

ans = 0

def keta(n):
    sum = 0
    while n>0:
        sum += n%10
        n = n//10
return sum

for i in range(1,n):
    if a<=keta(i)<=b:
        ans +=keta(i)
print(ans)