Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m,x=[int(i) for i in input().split()]
c=[]
arr=[[] for i in range(n)]
for i in range(n):
    l=[int(i) for i in input().split()]
    c.append(l[0])
    arr[i]=l[1:]

inf=10**18
ans=inf

limit=2**n
for bit in range(1,limit):
    sum=[0 for i in range(n)]
    cost=0
    for i in range(n):
        if (1<<i & bit):
            cost+=c[i]
            for j in range(m):
                sum[j]+=arr[i][j]
    flag=1
    for i in range(m):
        if sum[i]<x:
            flag=0
            break
    if flag==0:
        continue
    ans=min(ans,cost)
if ans!=inf:
    print(ans)
else:
    print(-1)


Fixed submission:
n,m,x=[int(i) for i in input().split()]
c=[]
arr=[[] for i in range(n)]
for i in range(n):
    l=[int(i) for i in input().split()]
    c.append(l[0])
    arr[i]=l[1:]

inf=10**18
ans=inf

limit=2**n
for bit in range(1,limit):
    sum=[0 for i in range(m)]
    cost=0
    for i in range(n):
        if (1<<i & bit):
            cost+=c[i]
            for j in range(m):
                sum[j]+=arr[i][j]
    flag=1
    for i in range(m):
        if sum[i]<x:
            flag=0
            break
    if flag==0:
        continue
    ans=min(ans,cost)
if ans!=inf:
    print(ans)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
n,m,x=[int(i) for i in input().split()]
c=[]
arr=[[] for i in range(n)]
for i in range(n):
    l=[int(i) for i in input().split()]
    c.append(l[0])
    arr[i]=l[1:]

inf=10**18
ans=inf

limit=2**n
for bit in range(1,limit):
    sum=[0]*n
    cost=0
    for i in range(n):
        if (1<<i & bit):
            cost+=c[i]
            for j in range(m):
                sum[j]+=arr[i][j]
    flag=1
    for i in range(m):
        if sum[i]<x:
            flag=0
            break
    if flag==0:
        continue
    ans=min(ans,cost)
if ans!=inf:
    print(ans)
else:
    print(-1)


Fixed submission:
n,m,x=[int(i) for i in input().split()]
c=[]
arr=[[] for i in range(n)]
for i in range(n):
    l=[int(i) for i in input().split()]
    c.append(l[0])
    arr[i]=l[1:]

inf=10**18
ans=inf

limit=2**n
for bit in range(1,limit):
    sum=[0 for i in range(m)]
    cost=0
    for i in range(n):
        if (1<<i & bit):
            cost+=c[i]
            for j in range(m):
                sum[j]+=arr[i][j]
    flag=1
    for i in range(m):
        if sum[i]<x:
            flag=0
            break
    if flag==0:
        continue
    ans=min(ans,cost)
if ans!=inf:
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define fori(i, m, n) for(int i = m; i < (int)n; i++)
#define forl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define all(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string bans(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  int a,b,c;cin>>a>>b>>c;
  int ans=(a>=c||b>=c||a+b>=c);
  cout << bans(ans) << endl;
  return 0;
}


Fixed submission:
a,b,c=map(int,input().split())
print("Yes" if a>=c or b>=c or a+b>=c else "No")

Buggy python submission (verdict: Runtime Error):
a,b,c=[map(int,input().split())]
print("Yes" if a>=c or b>=c or a+b>=c else "No")

Fixed submission:
a,b,c=map(int,input().split())
print("Yes" if a>=c or b>=c or a+b>=c else "No")
Buggy python submission (verdict: Runtime Error):
a, t = map(int, input().split())
print(a * t)
a, t = map(int, input().split())
print(a * t)


Fixed submission:
a, t = map(int, input().split())
print(a * t)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


k = int(input())
ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        tgcd = gcd(i, j)
        for k in range(1, k + 1):
            l = gcd(tgcd, k)
            ans += l

print(ans)


Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


k = int(input())
ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        tgcd = gcd(i, j)
        for k in range(1, k + 1):
            l = gcd(tgcd, k)
            ans += l

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
if s == "hi" * len(s) // 2:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input()
if s == "hi" * (len(s) // 2):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
cities = [int(input()) for i in range(5)]

#print ("N:",N)
#print ("cities:",cities)

ans = 0

people = [N,0,0,0,0,0]
latest = 0

# maybe O(N)

while True:
	if (people[-1] == N):
		break
	else:
		for i in reversed(range(len(cities))):
			tmp = people[i]
			people[i] = max(0, people[i] - cities[i])
			people[i+1] += tmp - people[i]


	ans += 1

print (ans)


Fixed submission:
N = int(input())
cities = [int(input()) for i in range(5)]

#print ("N:",N)
#print ("cities:",cities)

ans = 0

people = [N,0,0,0,0,0]
latest = 0

# maybe O(N)
'''
while True:
	if (people[-1] == N):
		break
	else:
		for i in reversed(range(len(cities))):
			tmp = people[i]
			people[i] = max(0, people[i] - cities[i])
			people[i+1] += tmp - people[i]


	ans += 1
'''

critical = (N - 1) // min(cities) 


print (5 + critical)
Buggy python submission (verdict: Runtime Error):
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

A.sort()
A.reverse()
B.sort()
B.reverse()
C.sort()
C.reverse()

m = max(X,Y,Z)


ansl = [0] * 3000
tmp = (5,5,5)
inda = 0
indb = 0
indc = 0

hoge = 10**12

sumab = []
for i in range(X):
	for j in range(Y):
		sumab.append(A[i] + B[j])

sumab.sort()
sumab.reverse()

anslist = []
for k in range(K):
	for cc in range(Z):
		anslist.append(sumab[k] + C[cc])
		
anslist.sort()
anslist.reverse()
for aa in range(K):
	print (anslist[aa])

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

A.sort()
A.reverse()
B.sort()
B.reverse()
C.sort()
C.reverse()

anslist = []

for i in range(X):
	for j in range(Y):
		for k in range(Z):
			if (i+1)*(j+1)*(k+1) <= K:
				anslist.append(A[i] + B[j] + C[k])
			else:
				break

anslist.sort()
anslist.reverse()
for hoge in range(K):
	print (anslist[hoge])
Buggy python submission (verdict: Runtime Error):
n,k = int(split(input()))
cnt=0
for i in range(1,n+1,2):
  cnt++

if k <= cnt:
  print("YES")
else:
  print("NO")


Fixed submission:
n,k = map(int,input().split())
cnt=0
for i in range(1,n+1,2):
  cnt += 1

if k <= cnt:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n,k = int(split(input()))
cnt=0
for i in range(1,n+1,2):
  cnt++

if (k<=cnt):
  print("YES")
else:
  print("NO")

Fixed submission:
n,k = map(int,input().split())
cnt=0
for i in range(1,n+1,2):
  cnt += 1

if k <= cnt:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a = int(input())

if (a == 7) or (a == 5) or (a == 3):
  print("YES")
else print("NO")



Fixed submission:
a = int(input())
 
if (a == 7) or (a == 5) or (a == 3):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
m = np.mean(a)
ans = 0
mx = 999999
for i in range(n):
  if abs(a[i] - m) < dist:
    dist = abs(a[i] - m)
    ans = i
print(ans)


Fixed submission:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
m = np.mean(a)
ans = 0
mx = 999999
for i in range(n):
	if abs(a[i] - m) < mx:
		mx = abs(a[i] - m)
		ans = i
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,x = int(input().split())

if (a <= x) and (a + b >= x):
  print("YES")
else:
  print("NO")

Fixed submission:
a,b,x = map(int,input().split())
 
if (a <= x) and (a + b >= x):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
s = input()

ans = ""
for i in range(len(s)):
  if (i == 3) ans += "8"
  else ans += s[i]
 

print (ans)

Fixed submission:
s = input()

ans = ""
for i in range(len(s)):
  if (i == 3):
    ans += "8"
  else:
    ans += s[i]
 

print (ans)
Buggy python submission (verdict: Runtime Error):
n,a = map(int,input().split())
print(n*n-a)

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
parents = [i for i in range(N+1)]

def find(x):
    if x == parents[x]:
        return x
    else:
        x = find(parents[x])
        return x
    
def same(x, y):
    if x==y:
        pass
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    x, y = find(A), find(B)
    same(x, y)

print(len(set(parents)) - 2)

Fixed submission:
N, M = map(int, input().split())
parents = [i for i in range(N+1)]

def find(x):
    if x == parents[x]:
        return x
    else:
        parents[x] = find(parents[x])
        return parents[x]
    
def same(A, B):
    x, y = find(A), find(B)
    if x==y:
        return
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    same(A, B)
    
for i in range(N):
    find(i+1)

print(len(set(parents)) - 2)

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

def find(x):
    if x == parents[x]:
        return x
    else:
        x = find(parents[x])
        return x
    
def same(x, y):
    if x==y:
        pass
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    x, y = find(A), find(B)
    same(x, y)

print(len(set(uni.parents)) - 2)

Fixed submission:
N, M = map(int, input().split())
parents = [i for i in range(N+1)]

def find(x):
    if x == parents[x]:
        return x
    else:
        parents[x] = find(parents[x])
        return parents[x]
    
def same(A, B):
    x, y = find(A), find(B)
    if x==y:
        return
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    same(A, B)
    
for i in range(N):
    find(i+1)

print(len(set(parents)) - 2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

a = 1
b = 1
ans = 0

while a<N:
    b = 1
    while a*b <N:
        ans += 1
        b += 1
    a+=1
print(ans)

Fixed submission:
N = int(input())

a = 1
ans = 0

while a< N:
    b = a+1
    while a*b < N:
        ans += 2
        b += 1
    a+=1
a=1
while a**2 < N:
    ans+=1
    a += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
p = input('P:')
q = input('Q:')
r = input('R:')

ABC = p + q
BCA = q + r
CAB = r + p

min = ABC
if min > BCA:
  min = BCA
  
if min > CAB:
  min = CAB

print(min)

Fixed submission:
p,q,r = map(int,input().split())


ABC = p + q
BCA = q + r
CAB = r + p

min = ABC
if min > BCA:
  min = BCA
  
if min > CAB:
  min = CAB

print(min)
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
a = -1
b = -1
c = -1
judge = False

money = x * 10000 + y * 5000 + z * 1000
for x in range(20, -1, -1):
    money_max = x * 10000 + (N-x) * 5000
    money_min = x * 10000 + (N-x) * 1000
    if money_min <= Y and Y <=money_max:
        for y in range(N-x, -1, -1):
            money = x * 10000 + y * 5000 + (N - x - y)* 1000
            if money == Y:
                a = x
                b = y
                c = N - (x + y)
                judge = True
                break
    if judge:
        break
print(a, b, c)


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

a = -1
b = -1
c = -1
judge = False

for x in range(N, -1, -1):
    money_max = x * 10000 + (N-x) * 5000
    money_min = x * 10000 + (N-x) * 1000
    if money_min <= Y and Y <= money_max:
        for y in range(N-x, -1, -1):
            money = x * 10000 + y * 5000 + (N - x - y)* 1000
            if money == Y:
                a = x
                b = y
                c = N - (x + y)
                judge = True
                break
    if judge:
        break
print(a, b, c)
Buggy python submission (verdict: Runtime Error):
W, H, N = map(int, input().split())

xy = [0, W, 0, H]
judge = True
for n in range(N):
    x, y, a = map(int, input().split())
    a -= 1
    if a<=1 and judge:
        xy[a] = x
        if xy[0] >= xy[1]:
            judge = False
    else:
        xy[a] = y
        if xy[2] >= xy[3]:
            judge = False
    print(xy)
area = (xy[1] - xy[0]) * (xy[3] - xy[2])
if not judge:
    area = 0
    print(area)

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

li = sorted([a, b, c])
ans = 'No'
if sum(li[:2])==li[2]:
    ans ='Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input())

num5 = 0
num7 = 0
ans = 'NO'

for num in [A, B, C]:
  if num == 5:
    num5+=1
  elif num == 7:
    num7+=1
  else:
    break
if num5 ==2 and num7 == 1:
  ans = 'YES'
print(ans)

Fixed submission:
A, B, C = map(int, input().split())
 
num5 = 0
num7 = 0
ans = 'NO'
 
for num in [A, B, C]:
  if num == 5:
    num5+=1
  elif num == 7:
    num7+=1
  else:
    break
if num5 ==2 and num7 == 1:
  ans = 'YES'
print(ans)
Buggy python submission (verdict: Runtime Error):
return "ACL" * int(input())

Fixed submission:
print("ACL" * int(input()))
Buggy python submission (verdict: Runtime Error):
print(["No","Yes"][int(input)>=30]) 

Fixed submission:
print(["No","Yes"][int(input())>=30])
Buggy python submission (verdict: Runtime Error):
days = int(input())
vals = [int(x) for x in input().split()]
has = 1000
for i in range(days - 1)
    if vals[i] <= vals[i+1]:
        can, has = divmod(has, vals[i])
        has += can * (vals[i+1])
return has        
       


Fixed submission:
days = int(input())
vals = [int(x) for x in input().split()]
has = 1000
for i in range(days - 1):
    if vals[i] <= vals[i+1]:
        can, has = divmod(has, vals[i])
        has += can * (vals[i+1])
print(has)
Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())
print(sum([1 for x, y in zip(s, t) if x != y])

Fixed submission:
s = input()
t = input()
print(sum([1 for x, y in zip(s, t) if x != y]))
Buggy python submission (verdict: Runtime Error):
print(int(input() * int(input()))

Fixed submission:
a, b = [int(x) for x in input().split()]
print(a * b)
Buggy python submission (verdict: Time Limit Exceeded):
answer = 1
lens = int(input())
arrs = [int(x) for x in input().split()]
for x in arrs:
    answer *= x
if answer > int(10 ** 18):
    answer = -1
print(answer)


Fixed submission:
answer = 1
lens = int(input())
arrs = [int(x) for x in input().split()]
if 0 in arrs:
    answer = 0
else:
    for x in arrs:
        answer *= x
        if answer > int(10 ** 18):
            answer = -1
            break
print(answer)
Buggy python submission (verdict: Runtime Error):

counter = int(input())
res = counter % 10
if res in [2,4,5,7,9]:print("hon")
elif res in [0, 1 6, 8]:print("pon")
else:print("bon")  

Fixed submission:
counter = int(input())
res = counter % 10
if res in [2,4,5,7,9]:
    print("hon")
elif res in [0, 1, 6, 8]:
    print("pon")
else:print("bon")
Buggy python submission (verdict: Runtime Error):
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer)

Fixed submission:
from math import floor
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor


a, b, n = [int(x) for x in input().split()]
x  = 1
maxs =  0
while x <= n:
    curr = floor(a * x / b) - a * floor(x / b)
    maxs = max(maxs, curr)
    x += 1
print(maxs)

Fixed submission:
from math import floor
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer)
Buggy python submission (verdict: Runtime Error):
radius = int(input())
answer = 2 * math.pi * radius
print(answer)

Fixed submission:
from math import pi
radius = int(input())
answer = 2 * pi * radius
print(answer)
Buggy python submission (verdict: Runtime Error):
fun main()
{
    var has = readLine()!!.toInt()
    var happiness = 0
    if (has > 500)
    {
        var _500 = has / 500
        happiness = _500 * 1000
        has = has - _500 * 500
    }
    if (has > 5)
    {
        var _5 = has / 5
        happiness += _5 * 5
    }
    print(happiness)
}

Fixed submission:
has = int(input())
canbe = 0
_500, has = divmod(has, 500)
canbe += _500 * 1000
_5, has  = divmod(has, 5)
canbe += _5 * 5
print(canbe)
Buggy python submission (verdict: Runtime Error):
fun main()
{
    val given = readLine()!!
    println(if ( given.contains("AB") || given.contains("BA")) "Yes" else "No")
}

Fixed submission:
s= input()
if "AB" in s or "BA" in s:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
if len(set(input())==1:
       print("NO")
else:
       print("YES")
       
      

Fixed submission:
s= input()
if "AB" in s or "BA" in s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
'''
red blue
3 4
red
'''
a, b = [x for x in input().split()]
an, bn = [int(x) for x in input().split()]
threw = input()
if threw == a:an -= 1
  else:
    bn -= 1
print(an, bn)    
  

Fixed submission:
'''
red blue
3 4
red
'''
a, b = [x for x in input().split()]
an, bn = [int(x) for x in input().split()]
threw = input()
if threw == a:an -= 1
else:
    bn -= 1
print(an, bn)
Buggy python submission (verdict: Runtime Error):
print("X" * len(input())

Fixed submission:
ins = input()
lens = len(ins)
print("x" * lens)
Buggy python submission (verdict: Runtime Error):
'''
Sample Input 1 

5
2 6 1 4 5
Sample Output 1 

YES
'''
lens = int(input())
arrs = [int(x) for x in input(),split()]
print(["NO", "YES"][len(arrs) == len(set(arrs))])

Fixed submission:
'''
Sample Input 1

5
2 6 1 4 5
Sample Output 1

YES
'''
lens = int(input())
arrs = [int(x) for x in input().split()]
print(["NO", "YES"][len(arrs) == len(set(arrs))])
Buggy python submission (verdict: Runtime Error):
'''
211 5
31 41 59 26 53
'''
power, moves = [int(x) for x in input().split()]
powers = sum([int(x) for x in input().split()])
print(["No","Yes"][powers >= power])

Fixed submission:
H, A = [int(x) for x in input().split()]
print( (H // A ) + (H % A > 0))
Buggy python submission (verdict: Runtime Error):
# 7 7
a, b = [xfor x in input().split()]
print(sorted([a * b, b * a])[-1])

Fixed submission:
a, b = [x for x in input().split()]
print(sorted([a * int(b), b * int(a)])[0])
Buggy python submission (verdict: Runtime Error):
from strings import ascii_lowercase as lc
given = input()
print(lc[lc.index(given) + 1])

Fixed submission:
from string import ascii_lowercase as lc
given = input()
print(lc[lc.index(given) + 1])
Buggy python submission (verdict: Runtime Error):
return "".join(input().split()[::-1])

Fixed submission:
print("".join(input().split()[::-1]))
Buggy python submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split()]
print(*[max(0, A - k),max(0, B - k)])

Fixed submission:
# B - Greedy Takahashi

A, B, K = [int(x) for x in input().split()]
AB = A + B
if A > K:
    print(A - K, B)
elif AB > K:
    print(0, AB - K)
else:
    print(0, 0)

Buggy python submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split()]
return max(0, A - k) + max(0, B - k)

Fixed submission:
# B - Greedy Takahashi

A, B, K = [int(x) for x in input().split()]
AB = A + B
if A > K:
    print(A - K, B)
elif AB > K:
    print(0, AB - K)
else:
    print(0, 0)
Buggy python submission (verdict: Runtime Error):
a, b = [int(x)-1 for x in input().split()]
won = 0
if a in range(3):
  won  += [300000,200000,200000][a]
if b in range(3):
  won  += [300000,200000,200000][a]
won += 400000 * (a == 0 and b == 0)
print(won)

Fixed submission:
a, b = [int(x) for x in input().split()]
won = 0
if a in range(1, 4):
  won  += [0,300000,200000,100000][a]
if b in range(1, 4):
  won  += [0,300000,200000,100000][b]
if a == 1 and b == 1:won += 400000  
 
print(won)
Buggy python submission (verdict: Runtime Error):
return (int(input()) ** 3)

Fixed submission:
print(int(input()) ** 3)
Buggy python submission (verdict: Runtime Error):
'''
CSS
CSR
'''
prin( sum([1 for x, y in zip(input(), input()) if x == y]

Fixed submission:
print( sum([1 for x, y in zip(input(), input()) if x == y]) )
Buggy python submission (verdict: Runtime Error):
'''
2
10 30
'''
lens = int(input())
arrs = [1/int(x) for x in input().split()]
print(1/arrs)

Fixed submission:
lens = int(input())
arrs = sum([1/int(x) for x in input().split()])
if arrs != 0:
  print(1/arrs)
Buggy python submission (verdict: Runtime Error):
a, b = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b)

Fixed submission:
a, b = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b ))
Buggy python submission (verdict: Runtime Error):
lens = int(input())
hashes = sorted()[''.join(sorted(input())) for _ in range(lens)])
i = 0
j = 0
r = 0
ans = 0
while i < lens - 1:
    i += 1
    if hashes[i] == hashes[j]:
        r += 1
    else:
        ans += (r * (r + 1)) // 2
        r = 0
        j = i
ans += (r ( r + 1))//2
print(ans)

Fixed submission:
n = int(input())
ws = [list(input()) for _ in range(n)]
 
def sort_l(l):
    l.sort()
    return l
ws = list(map(sort_l, ws))
ws.sort()
 
i = 0
j = 0
r = 0
ans = 0
while(i<n-1):
    i += 1
    if ws[i] == ws[j]:
        r += 1
    else:
        ans += r * (r+1) // 2
        r = 0
        j = i
ans += r * (r+1) // 2
 
print(ans)

Buggy python submission (verdict: Runtime Error):

lens = int(input())
hashes = [''.join(sorted(input())) for _ in range(lens)]
i = 0
j = 0
r = 0
ans = 0
while i < lens - 1:
    i += 1
    if hashes[i] == hashes[j]:
        r += 1
    else:
        ans += (r * (r + 1)) // 2
        r = 0
        j = i
ans += (r ( r + 1))//2
print(ans)

Fixed submission:
n = int(input())
ws = [list(input()) for _ in range(n)]
 
def sort_l(l):
    l.sort()
    return l
ws = list(map(sort_l, ws))
ws.sort()
 
i = 0
j = 0
r = 0
ans = 0
while(i<n-1):
    i += 1
    if ws[i] == ws[j]:
        r += 1
    else:
        ans += r * (r+1) // 2
        r = 0
        j = i
ans += r * (r+1) // 2
 
print(ans)
Buggy python submission (verdict: Runtime Error):
given = int(input())
ans = 0
for i in range(given):
  current = str(i + 1)
  if len(current) & 1:
    ans += 1
  
print(ans)

Fixed submission:
a, b, c = [int(x) for x in input().split()]
print(c - min(c, a - b))

Buggy python submission (verdict: Runtime Error):
given = int(input())
ans = 0
for i in range(given):
  current = str(i + 1)
  ans += len(current) & 1
print(ans)

Fixed submission:
a, b, c = [int(x) for x in input().split()]
print(c - min(c, a - b))
Buggy python submission (verdict: Runtime Error):
n, a, b = [int(x) for x in input().split()]
print(min(a * n,b) 

Fixed submission:
n, a, b = [int(x) for x in input().split()]
print(min(a * n,b))
Buggy python submission (verdict: Runtime Error):

# -*- coding: utf-8 -*-
# @Date    : 2019-06-15 20:02:29
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

import sys
sys.setrecursionlimit(10**5+1)

inf     =  int(10 ** 20)
max_val =  inf
min_val = -inf

RW  = lambda : sys.stdin.readline().strip()
RI  = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from collections import defaultdict

nb_points = RI()
points    = [RMI() for _ in range(nb_points)]
pq = defaultdict(int)
for i in range(nb_points):
    for j in range(nb_points):
        if i == j : continue
        p1 = points[i][0] - points[j][0]
        q1 = points[i][1] - points[j][1]
        pq[(p1, q1)]  = pq.get((p1, q1), 0) + 1
print(nb_points - max(pq.values()))


Fixed submission:
n, k = [int(x) for x in input().split()]
if k == 1:print(0)
else:
  print( ((n - k) + 1) - 1)