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

Fixed submission:
n, p = map(int, input().split())
s = [int(i) for i in input()]
p_cnt = 0

if p == 2 or p == 5:
    for i in range(n):
        if s[i] % p == 0:
            p_cnt += i+1
        
else:
    s = s[::-1]
    div_dic = dict(zip(range(p), [0] * p))
    tmp = 0

    for i in range(n):
        tmp += s[i] * pow(10, i, p)
        tmp %= p
        div_dic[tmp] += 1

    for v in div_dic.values():
        p_cnt += v * (v - 1)
    p_cnt //= 2
    p_cnt += div_dic.get(0)

print(p_cnt)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n, p = map(int, input().split())
s = input()
s += '0'
p_cnt = 0
div_list = []

if p == 2 or p == 5:
    for i in range(n):
        if s[i] % p == 0:
            p_cnt += i+1
else:
    for i in range(n+1):
        num = int(s[i:])
        div_list.append(num % p)

    div_ol = Counter(div_list)
    for v in div_ol.values():
        p_cnt += v * (v - 1) / 2



print(int(p_cnt))
Problem p02679 (python)

Fixed submission:
import math
mod = 10**9 + 7
n = int(input())
d = {}
d0 = 0
for _ in range(n):
    a, b = map(int, input().split())
    g = math.gcd(a, b)
    if g == 0:
        d0 += 1
    else:
        a //= g
        b //= g
        if a < 0:
            a = -a
            b = -b
        elif a == 0 and b < 0:
            b = -b
        if (a,b) in d:
            d[(a,b)] += 1
        else:
            d[(a,b)] = 1
ans = 1
for (a,b) in d.keys():
    if d[(a,b)] > 0:
        t = 2**d[(a,b)]
        if b <= 0:
            a = -a
            b = -b
        if (b,-a) in d:
            t += 2**d[(b,-a)] - 1
            d[(b,-a)] = 0
        ans *= t
        ans %= mod
print((ans+d0-1)%mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9 + 7
n = int(input())
d = {}
for _ in range(n):
    a, b = map(int, input().split())
    if a/b in d:
        d[a/b] += 1
    else:
        d[a/b] = 1
ans = 1
for k in d.keys():
    if d[k] > 0:
        t = 2**d[k]
        if -1/k in d:
            t += 2**d[-1/k] - 1
            d[-1/k] = 0
        ans *= t
        ans %= mod
print(ans-1)
Problem p03045 (python)

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0]*n

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)

n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    x, y, z = map(int, input().split())
    uf.unite(x-1, y-1)
print(len(set(uf.find(i) for i in range(n))))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [-1]*n
b = []
for i in range(m):
    x, y, z = map(int, input().split())
    if a[x-1] != -1:
        if a[y-1] != -1:
            if a[x-1] != a[y-1]:
                b[a[x-1]] |= b[a[y-1]]
                for j in b[a[y-1]]:
                    a[j] = a[x-1]
                b.pop(a[y-1])
        else:
            b[a[x-1]].add(y-1)
            a[y-1] = a[x-1]
    else:
        if a[y-1] != -1:
            b[a[y-1]].add(x-1)
            a[x-1] = a[y-1]
        else:
            b.append({x-1, y-1})
            a[x-1] = a[y-1] = len(b) - 1
print(len(b)+a.count(-1))
Problem p03104 (python)

Fixed submission:
A, B = map(int, input().split())
print([A-1, 1, A, 0][(A-1)%4]^[B, 1, B+1, 0][B%4])

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
C = list(range(A, B+1))
N = B - A + 1
D = []
while C[N-1] > 0:
    D.append(sum(C[i] % 2 == 1 for i in range(N)) % 2)
    C = [C[i] // 2 for i in range(N)]
ans = 0
for i in reversed(range(len(D))):
    ans = ans*2 + D[i]
print(ans)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal

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

print(int(a*b))

Buggy submission (verdict: Runtime Error):
from decimal import *

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

print(a*b)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int,float,input().split())
ans = int(a * (100*b))
print(int(ans/100))

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

int main(){
    long long a, ans;
    double b;
    cin >> a >> b;
    ans = a * b;
    cout << ans << endl;
}
Problem p02933 (python)

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

if a >= 3200:
  print(s)
elif a < 3200:
  print("red")

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

if a >= 3200:
  print(s)
elif a < 3200:
  print(red)
Problem p02659 (python)

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

a = int(a)
b = int(b.replace(".", ""))

ans = a * b // 100

print(ans)

Buggy submission (verdict: Runtime Error):
import math
x,y = map(float,input().split())
x = int(x)
y = print('{:.2f}'.format(y))

print(math.floor(x*y))
Problem p02831 (python)

Fixed submission:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(a, b))

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))
Problem p02897 (python)

Fixed submission:
N = int(input())

kisu = 0

for i in range(1, N+1):
  if i % 2 == 1:
    kisu += 1
    
    
kakuritsu = kisu / N


print('{:.10f}'.format(kakuritsu))

Buggy submission (verdict: Runtime Error):

N = int(input())

kisu = 0
gusu = 0

for i in range(N):
  if i % 2 = 0:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu // (gusu + kisu)

print(kakuritsu)
Problem p02859 (python)

Fixed submission:
"""from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return [x for x in mi()]
def si(): return stdin.readline()
"""
n=int(input())
print(n*n)

Buggy submission (verdict: Runtime Error):
from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return [x for x in mi()]
def si(): return stdin.readline()
n=int(input())
print(n*n)

Buggy submission (verdict: Runtime Error):
from sys import stdin
#from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return [x for x in mi()]
def si(): return stdin.readline()
n=ii()
print(n*n)

Buggy submission (verdict: Runtime Error):
from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return [x for x in mi()]
def si(): return stdin.readline()
n=ii()
print(n*n)
Problem p03072 (python)

Fixed submission:
c=0
m=0
n=int(input())
a=input().split()
for i in range(n):
	if int(a[i])>=m:
		c+=1
		m=int(a[i])
print(c)

Buggy submission (verdict: Runtime Error):
c=0
m=0
for _ in range(int(input())):
	n=int(input())
	if n>=m:
		c+=1
		m=n
print(c)
Problem p03075 (python)

Fixed submission:
a=[]
for _ in range (6):
	a.append(int(input()))
k=a[5]
del a[5]
if max(a)-min(a)>k:
	print(":(")
else:
	print("Yay!")

Buggy submission (verdict: Runtime Error):
a=[]
for _ in range (6):
	a.append(int(input()))
k=a[5]
a.remove(5)
if max(a)-min(a)>k:
	print(":(")
else:
	print("Yay!")

Buggy submission (verdict: Runtime Error):
a=list(map(int, input().split()))
k=a[5]
a.remove(5)
if max(a)-min(a)>k:
	print(":(")
else:
	print("Yay!")
Problem p02627 (python)

Fixed submission:
def resolve():
    a = input()
    if a.isupper() == True:
        print("A")
    else:
        print("a")
        
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n,k = map(int, input().split())
    listA = list(map(int,input().split()))
    listA.sort()
    c = sum(listA[:k])
    print(c)
resolve()
Problem p02682 (python)

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

    if a>k:
        print(k)
    elif a + b >= k:
        print(a)
    elif a+b<k:
        d=k-a-b
        print(a-d)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a,b,c,k=map(int,input().split())
    if a+b >=k:
        print(a)
    else:
        d=k-a-b
        print(a-d)
reslove()
Problem p02771 (python)

Fixed submission:
a=list(map(int,input().split()))
count=0
if a[0]==a[1]:
  count=count+1
if a[0]==a[2]:
  count=count+1
if a[1]==a[2]:
  count=count+1  
if count==1:
  print("Yes")

else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
string_list=[input() for i in range(n)]
import collections
import numpy as np
c = collections.Counter(string_list)
d=c.most_common()
x=int(d[0][1])
z=[]
for i in range(len(d)):
  y=int(d[i][1])
  if x==y:
    z.append(str(d[i][0]))
    
z.sort()
for i in range(len(z)):
  print(z[i])
Problem p02831 (python)

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

def gcd(l,s):
    r = l%s
    if r == 0:
        return s
    else:
        return gcd(s,r)

def lcm(x,y):
    return (x * y) // gcd(x, y)

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
print(int(a * b / math.gcd(a, b)))
Problem p03041 (python)

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

# 文字列に対してk以前とｋ以降をそのまま表示。
# kのみstr.lower()を適用する
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n, k = list(map(int, input().split()))
s = input()
print(s[:k-1]+s[k].lower()+s[k:])
Problem p03072 (python)

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

count = 0

for i in range(n):
    if h[i] == max(h[:i+1]) :
        count = count + 1
print(count)

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

count = 0

for i in range(n):
    if h[i] == max(h[:i+1]) :
        ans = ans + 1
print(count)
Problem p03307 (python)

Fixed submission:
a = int(input())
if a % 2 == 1:
    print(a*2)
else:
    print(a)

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

a = int(input())
if a % 2 == 1:
    print(a*2)
else:
    print(a)
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
r=int(input)
print(r*r)
Problem p02622 (python)

Fixed submission:
import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

def main():
  S = input()
  T = input()
  count = 0
  for i in range(len(S)):
    if(S[i] != T[i]):
      count+=1
  print(count)

if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

def main():
  S = int(input())
  T = int(input())
  count = 0
  for i in range(len(S)):
    if(S[i] != T[i]):
      count+=1
  print(len(T)-count)

if __name__=='__main__':
  main()
Problem p02623 (python)

Fixed submission:
n, m, k = map(int, input().split())
a_ = list(map(int, input().split()))
b_ = list(map(int, input().split()))

a = [0]
for i in range(n):
    a.append(a[i]+a_[i])

b = [0]
for i in range(m):
    b.append(b[i]+b_[i])

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

print(ans)

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

a = [0]
for i in range(n):
    a.append(a[i]+a_[i])

b = [0]
for i in range(m):
    b.append(b[i]+b_[i])

for i in range(n):
    j = m
    if a[i] > k:
        break
    while 1:
        if b[j] < k - a[i]:
            break
        j -= 1

print(i+j)
Problem p02629 (python)

Fixed submission:
n = int(input())

# # 名前の長さを求める
i = 1
while 1:
    # print(i)
    if n <= 26 ** i:
        break
    else:
        n -= 26**i
    i += 1

name = ""
n -= 1
for j in range(i):
    name += chr(ord('a') + n % 26)
    n //= 26

print(name[::-1])

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

ascii = 'abcdefghijklmnopqrstuvwxyz'

out = ''
l = []
while n > 0:
    l.append(n%26)
    out = str(n%26) + ", " + out
    n = int(n/26)
# print(out)
# print(l)

flg = 0
for i in range(len(l)):
    if l[i] != 0:
        l[i] -= 1
    else:
        if i == len(l)-2:
            flg = 1
        l[i+1] = 0
        l[i] = 25

if len(l)==1:
    l[0] -= 1

name = ""
for i in range(len(l)-flg):
    name = ascii[l[i]] + name
print(name)

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

ascii = 'abcdefghijklmnopqrstuvwxyz'

i = 1
name = ""
while 1:
    # print(i)
    # print(n)
    if n - (26 ** i) > 0:
        n -= 26 ** i
    else:
        while i != 0:
            if i == 1:
                name += ascii[int(n%(26**i))-1]
            else:
                name += ascii[int(n/(26**(i-1)))]
            n = n % (26**(i-1))
            i -= 1
        break
    i += 1
print(name)
Problem p02659 (python)

Fixed submission:
import decimal

a, b = input().split()

a = decimal.Decimal(a)
# print(b)
b = decimal.Decimal(b)
# print(b)

print(int(a*b))

Buggy submission (verdict: Runtime Error):
import decimal

a, b = input().split()

a = Decimal(a)
# print(b)
b = Decimal(b)
# print(b)

print(int(a*b))
Problem p02711 (python)

Fixed submission:
n = int(input())
 
yesno = "No"
 
if int(n/100)==7:
  yesno = "Yes"
if n%10==7:
  yesno = "Yes"
n = n%100
if int(n/10)==7:
  yesno = "Yes"
print(yesno)

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

yesno = "No"

if int(n/100)==7:
  yesno = "Yes"
if n$10==7:
  yesno = "Yes"
n = n%100
if int(n/10)==7:
  yesno = "Yes"
print(yesno)
Problem p02659 (python)

Fixed submission:
import math
import re
from decimal import *

a = input()
b = int(re.sub('\s.+$','',a))
c = Decimal(re.sub('^.+\s','',a))
d = Decimal(b * c)
d = math.floor(d)
d = int(d)

print(d)

Buggy submission (verdict: Runtime Error):
import math
import re

a = input()
b = int(re.findall('^.',a))
c = float(re.findall('.$',a))

c = a * b
print(math.floor(c))

Buggy submission (verdict: Runtime Error):
import math

a, b = (int(i) for i in input().split())  
c = a * b
print(math.floor(c))
Problem p02880 (python)

Fixed submission:
n = int(input())
bl = 0
for i in range(1,10):
    for j in range(1,10):
        if n == (i * j):
            bl = 1
            break
if bl == 1:
    print ("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
bl = false
for i in 9
    for j in 9
        if n = i * j:
            bl = true
            break

if bl = true:
    print ("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
n = input()
bl = false
for i in 9
    for j in 9
        if n = i * j:
            bl = true
            break
if bl = true:
    print ("Yes")
else:
    print ("No")
Problem p02689 (python)

Fixed submission:
N, M = map(int, input().split())
Hs = list(map(int, input().split()))
ans = [1 for i in range(N)]
for i in range(M):
	a, b = map(int, input().split())
	if Hs[a-1] <= Hs[b-1]:
		ans[a-1] = 0
	if Hs[b-1] <= Hs[a-1]:
		ans[b-1] = 0
print(sum(ans))

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

ans = 0
for idx, aa in enumerate(edges):
	for a in aa:
		if Hs[idx] <= Hs[a]:
			break
		ans += 1
		break
print(ans)
Problem p02711 (python)

Fixed submission:
import sys
n = input()
for i in n:
	if i == '7':
		print('Yes')
		sys.exit(0)
print('No')

Buggy submission (verdict: Runtime Error):
import sys
n = input()
for i in n:
	if i == '7'
		print('Yes')
		sys.exit(0)
print('No')
Problem p02725 (python)

Fixed submission:
kp = list(map(int, input().rsplit()))
A = list(map(int, input().rsplit()))
max_range = kp[0]-A[-1]+A[0]
for idx in range(len(A)-1):
  dif = A[idx+1]-A[idx] 
  if dif >max_range:
    max_range = dif
 
print(kp[0] - max_range)

Buggy submission (verdict: Runtime Error):
kp = list(map(int, input().rsplit()))
A = list(map(int, input().rsplit()))
max_range = kp[0]-A[-1]+A[0]
for idx in range(len(A)):
  dif = A[idx+1]-A[idx] 
  if dif >max_range:
    max_range = dif

print(kp[0] - max_range)
Problem p02984 (python)

Fixed submission:
import numpy as np

n = map(int, raw_input().split())

x = map(int, raw_input().split())
n = n[0]
ans = []

x = np.asarray(x)
double_x = 2 * x
x0 = 0
multiple = 1
for j in range(n):
    x0 += x[j] * multiple
    multiple *= -1
ans.append(x0)
for i in range(0, n-1):
    ans.append(double_x[i] - ans[i])

print ' '.join(map(str, ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
c = 0
for idx, i in enumerate(a):
  if idx %2 ==0:
    c += i
  else: 
    c -= i
x1 = c/2
print(x1)
for i in range(1,N):
  x1 = 2*a[i] - x1
  print(x1)
Problem p02753 (python)

Fixed submission:
s=input()
if s[0]==s[1]==s[2] or s[0]==s[1]==s[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]==s[1]==s[2] or =s[0]==s[1]==s[2]:
  print("No")
else:
  print("Yes")
Problem p02699 (python)

Fixed submission:
s,w =map(int,input().split())
if(s<=w):
    print('unsafe')
if(s>w):
    print('safe')

Buggy submission (verdict: Runtime Error):
s=int(input())
w=int(input())
if(s<=w):
    print("unsafe")
if(s>w):
    print("safe")

Buggy submission (verdict: Runtime Error):
s=int(input())
w=int(input())
if(s<=w):
    print("unsafe")
else:
    print("safe")
Problem p02701 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())

kind = []

for i in range(n):
    kind.append(input())

print(len(set(kind)))

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

a, b, c, d = map(int, input().split(' '))

n = max([int(a / d) + 1, int (c / b) + 1])

for i in range(n):
    a -= d
    c -= b
    # print(a,c)
    if c <= 0:
        print('Yes')
        exit()
    elif a <= 0:
        print('No')
        exit()
Problem p02707 (python)

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

# for i in range(n):
#     print(boss_list.count(i + 1))

import collections
c = collections.Counter(boss_list)

for i in range(n):
    print(c[i + 1])

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

# for i in range(n):
#     print(boss_list.count(i + 1))

import collections
c = collections.Counter(boss_list)

for i in range(n):
    print(boss_list[i + 1])
Problem p02729 (python)

Fixed submission:
# -*- coding: utf-8 -*-

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

print(int(m * (m - 1) / 2 + n * (n - 1) / 2))

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

import collections

n = int(input())
balls = list(map(int, input().split(' ')))

for k in range(n):
    # print(balls[ : k])
    # print(balls[ k + 1: ])
    arr = balls[ : k] + balls[ k + 1 : ]

    dic = collections.Counter(arr)
    total = 0
    for v in dic.values():
        total += int(v * (v - 1) / 2)
    print(total)
Problem p02779 (python)

Fixed submission:
#154c
n = int(input())
a = list(input().split())

if len(list(set(a))) != len(a):
  print('NO')
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
#154c
n = int(input())
a = [input() for _ in range(n)]

if len(list(set(a))) != len(a):
  print('NO')
else:
  print('YES')
Problem p02699 (python)

Fixed submission:
tmp = input().split()
S = int(tmp[0])
W = int(tmp[1])

if W >= S:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
tmp = input().split()
N = int(tmp[0])

ListG = []

for i in range(N):
    Si = input().split()
    p = Si in ListG
    if not p :
        ListG.append(Si)
    
print(len(ListG))
Problem p02707 (python)

Fixed submission:
EN = input().split()
Bc = [0] * int(EN[0])

tmp = input().split()

for i in tmp:
    BossN = int(i)
    Bc[BossN-1] = Bc[BossN-1] + 1

print(*Bc,sep='\n')

Buggy submission (verdict: Runtime Error):
EN = input().split()
Bc = [0] * int(EN[0])

tmp = input().split()
BossN = [int(s) for s in tmp]

for i in tmp:

    Bc[i-1] = Bc[i-1] + 1

print(*Bc,sep='\n')
Problem p03107 (python)

Fixed submission:
s = input()
zero = s.count('0')
one = s.count('1')
print(2*min(zero, one))

Buggy submission (verdict: Runtime Error):
s = list(map(int,input()))
cnt = 0
def func(s):
    for i, a in enumerate(zip(s, s[1:])):
        if a[0]^a[1] == 1:
            global cnt
            cnt += 2
            s.pop(i)
            s.pop(i)
            return func(s)

func(s)
print(cnt)
Problem p03135 (python)

Fixed submission:
list = list(map(int, input().split()))
A = int(list[0]) / int(list[1])
print(A)

Buggy submission (verdict: Runtime Error):
time = input('time')
xtimes = input('xtimes')

A = int(time) / int(xtimes)

print(A)
Problem p02627 (python)

Fixed submission:
a = str(input())
if str.isupper(a):
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a = str.input()
if a.isupper:
  print("A")
else:
  print("a")
Problem p02659 (python)

Fixed submission:
a,b = map(str, input().split())
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(math.floor(a*b))
Problem p02951 (python)

Fixed submission:
a, b, c=map(int,input().split())
d=c-(a-b)
if d>0:
  print(d)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<10:
  print(n)
elif n<100:
  print(9)
elif n<1000:
  print(9+(n-99))
elif n<10000:
  print(909)
elif n<100000:
  print(909+(n-9999))
else:
  print(90909)
Problem p02987 (python)

Fixed submission:
s=input()
ans=False
if s[0]==s[1]:
    if s[0]!=s[2] and s[2]==s[3]:
        ans=True
elif s[0]==s[2]:
    if s[0]!=s[1] and s[1]==s[3]:
        ans=True
elif s[0]==s[3]:
    if s[0]!=s[1] and s[1]==s[2]:
        ans=True
if ans:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
ans = False
if s[0] == s[1] :
  if s[0] != s[2] and s[2] ==s[3] :
    ans = True
elif s[0] == s[2] :
  if s[0] != s[1] and s[1] ==s[3] :
    ans = True
else s[0] == s[3] :
  if s[0] != s[1] and s[2] ==s[1] :
    ans = True
if ans :
  print('Yse')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
ans = False
if s[0] == s[1] :
  if s[0] != s[2] and s[2] ==s[3] :
  ans = True
elif s[0] == s[2] :
  if s[0] != s[1] and s[1] ==s[3] :
  ans = True
else s[0] == s[3] :
  if s[0] != s[1] and s[2] ==s[1] :
  ans = True
if ans :
  print('Yse')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
ans = Felse
if s[0] == s[1] and s[2] == s[3] :
  ans = True
if s[0] == s[2] and s[1] == s[3] :
  ans = True
if s[0] == s[3] and s[0] == s[2] :
  ans = True
if ans :
  print('Yse')
else:
  print('No')