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

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
l =[0]*n
for j in range(n):
  a = s.count(s[j])
  b = t.count(s[j])
  l[j] = a-b
print(max(max(l),0))

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
  rep(k,m){
    if(s.at(i)==t.at(k)){
      ttt++;
    }
  }
    o.at(i) = sss - ttt;
 }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
  }
  rep(k,m){
    if(s.at(i)==t.at(k)){
      ttt++;
    }
    o.at(i) = sss - ttt;
  }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n,m;
  vector<string> s(n),t(m),o(n);
  cin>>n;
  rep(i,n){
    cin>>s.at(i);
  }
  cin>>m;
  rep(j,m){
    cin>>t.at(j)
  }
  rep(i,n){
    int sss=0, ttt=0;
      rep(j,n){
        if(s.at(i)==s.at(j)){
          sss++;
        }
      }
      rep(k,m){
        if(s.at(i)==t.at(k)){
          ttt++;
        }
      o.at(i) = sss - ttt;
    }
  int max=0;
  rep(i,n){
    if(max<o.at(i)){
      max = o.at(i);
    }
  }
  cout<<max;
}
  
  
  
      
          
        
  
  
  
  
  
}
Problem p03280 (python)

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
menseki=(a-1)*(b-1)
print(str(menseki))
Problem p02657 (python)

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

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

b = int(input())

print(a*b)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(str(a * b))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a * b)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(str(A*B))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A * B)

Buggy submission (verdict: Runtime Error):
A = input()
B = input()

print(A * B)

Buggy submission (verdict: Runtime Error):
A=int(input)
B=int(input)
print(A*B)

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

Fixed submission:
a = input().split()
ind = 1
for i in a:
    if i == '0':
        print(ind)
        break
    ind += 1

Buggy submission (verdict: Runtime Error):
ind = 1
for i in a:
    if i == '0':
        print(ind)
        break
    ind += 1
Problem p02641 (python)

Fixed submission:
X, Y = map(int, input().split())
if Y == 0:
    answer = X
else:
    list_1 = list(map(int, input().split()))

    mylist = list(range(-100, 200))

    list_2 = list(filter(lambda x: x not in list_1, mylist))
    
    list_3 = list(map(lambda x: x - X, list_2))

    import numpy as np

    abslist = np.abs(list_3)

    min_num = min(abslist)

    answer_lisbef = [X - min_num, X + min_num]
    
    answer_lisaf = list(filter(lambda x: x not in list_1, answer_lisbef))
    
    answer = min(answer_lisaf)
print(answer)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
if Y == 0:
    answer = X
else:
    list_1 = list(map(int, input().split()))

    mylist = list(range(1,101))

    list_2 = list(filter(lambda x: x not in list_1, mylist))

    import numpy as np

    abslist = np.abs(list_2)

    min_num = min(abslist)

    answer = X - min_num
    
print(answer)
Problem p02663 (python)

Fixed submission:
H1, M1, H2, M2, K = map(int, input().split())

wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
print(answer)

Buggy submission (verdict: Runtime Error):
wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Buggy submission (verdict: Runtime Error):
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math
 
wakeup = 60 * H
1
 + 
M
1


gotobed = 60 * H
2 + M
2


 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Buggy submission (verdict: Runtime Error):
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math
 
wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Buggy submission (verdict: Runtime Error):
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math

wakeup = 24 * H1 + M1
gotobed = 24 * H2 + M2

wake = gotobed - wakeup

answer = wake - K

answer
Problem p02639 (python)

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

num = 0

for i in range(5):
	num += 1
	if x[i] == 0:
		break
        
print(num)

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

num = 0

for i in range(5):
	num += 1
    if x[i] == 0:
      break

print(num)

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

num = 0

for i in range(len(x)):
	num += 1
    if x[i] == 0:
      print(num)
      break

Buggy submission (verdict: Runtime Error):
x = list(int(input()))

num = 0

for i in x:
	num += i
    if x[i]==0:
    	break
print(num)
Problem p02706 (python)

Fixed submission:
n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A[i]
  
if n < 0:
  print(-1)
else:
  print(n)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A(i)
  
if n < 0:
  print(-1)
else:
  print(n)

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

for i in range(m):
  n -= A(i)
  
if n < 0:
  print(-1)
else:
  print(n)

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

hw_days = 0

for i in len(A):
  hw_days += A(i)

vacation = n - hw_days

if vacation < 0:
  print(-1)
else:
  print(vacation)
Problem p02713 (python)

Fixed submission:
import math
k = int(input())
sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    ab = math.gcd(a,b)
    for c in range(1,k+1):
      sum += math.gcd(ab,c)
print(sum)

Buggy submission (verdict: Runtime Error):
import math
k = int(input())
sum = []
for a in range(1,k+1):
  for b in range(1,k+1):
    ab = math.gcd(a,b)
    for c in range(1,k+1):
      sum += math.gcd(ab,c)
print(sum)
Problem p02765 (python)

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

if n >= 10:
  print(r)
else:
  r += 100*(10-n)
  print(r)

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

if n >= 10:
	print(r)
else:
	r -= 100*(10-n)
    print(r)
Problem p02778 (python)

Fixed submission:
S = list(input())
print("x" * len(S))

Buggy submission (verdict: Runtime Error):
S = list(input())
print(x*len(S))
Problem p02909 (python)

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

Buggy submission (verdict: Runtime Error):
S = int(input())
if S = "Sunny":
  print("Cloudy")
elif S = "Cloudy":
  print("Rainy")
elif S ="Rainy":
  print("Sunny")
Problem p03029 (python)

Fixed submission:
A, P = map(int, input().split())
K = A * 3
X = (K + P) // 2
print(X)

Buggy submission (verdict: Runtime Error):
a,p = map(int,input().split())
p = 3a + p
print(p//2)
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
0<=A<=100
2<=B<=100
if 0<=A<=5 :
    B=0
elif 6<=A<=12 :
    B=B//2
else :
    B=B
print(B)

Buggy submission (verdict: Runtime Error):
r, D, x = map(int, input().split())
2<=r<=5
1<=D<=100
D<=x<=200
while x <= 200 :
    x = r*x - D
    print(x)

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

if 0 <= A <= 5 :
    B = 0
elif 6 <= A <= 13 :
    B = B//2
else :
    B = B
    if B & 1:
        print(B)
    else :
        break

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

if 0 <= A <= 5 :
    B = 0
elif 6 <= A <= 13 :
    B = B//2
else :
    B = B
    if B % 2 == 0 :
        print(B)
    else :
        break

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
0 <= A <= 100

if 6 <= A <= 13 :
     B = B//2
elif 0 <= A <= 5 :
     B = 0
else :
     B = B
print(B)
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
h = input()

area = (a + b)*h/2

print(area)
Problem p02640 (python)

Fixed submission:
anim, leg = [int(x) for x in input().split()]


y = (leg - 2*anim)  
x = (4*anim - leg)  

if y % 2 == 1 or x % 2 == 1 or y < 0 or x < 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
anim, leg = [int(x) for x in input().split()] 

y = (leg - 2anim) / 2
x = (4anim - leg) / 2

if isinstance(y, float) or isinstance(x, float) or y < 0 or x < 0:
  print("No")
else:
  print("Yes")
Problem p02640 (python)

Fixed submission:
s = input()
lst = s.split()

ex1 = int(lst[0])
ex2 = int(lst[1])
ret = "No"

for i in range(ex1+1):
    if 4 * (ex1 - i) + 2 * i == ex2:
        ret= "Yes"

print(ret)

Buggy submission (verdict: Runtime Error):
import sympy
x = sympy.Symbol('x')
y = sympy.Symbol('y')

s = input()
lst = s.split()

ex1 = x + y - int(lst[0])
ex2 = 2 * x + 4 * y - int(lst[1])

d = sympy.solve([ex1, ex2])

if d[x] >= 0 and d[y] >= 0:
    print("yes")
else:
    print("no")
Problem p02683 (python)

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

C=[]
A=[]
for n in range(N):
  AC=list(map(int,input().split()))
  C.append(AC[0])
  A.append(AC[1:])
ans=10**9

for n in range(2**N):
  total=0
  und=[0]*M
  for j in range(N):
    if n >> j & 1:
      total+=C[j]
      for m in range(M):
        und[m]+=A[j][m]
  if X <= min(und):
    ans=min(total,ans)
if ans==10**9:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
N,M,X=list(map(int,input().split()))
AC=[]
C=[]
A=[]
for n in range(N):
  AC.append(list(map(int,input().split())))
  C.append(AC[0])
  A.append(AC[1:])
ans=0
for n in range(2**N):
  total=0
  und=[0]*M
  for j in range(N):
    if n >> j & 1:
      total+=C[j]
      for m in range(M):
        und[m]+=A[j][m]
  if X <= min(und):
    ans=total
if ans==0:
  print(-1)
else:
  print(ans)
Problem p02702 (python)

Fixed submission:
S=input()
N=len(S)

a=0
t=1
d=[0]*2019
d[0]=1
for i in range(N):
  a+=int(S[N-1-i])*t
  a%=2019
  t*=10
  t%=2019
  d[a]+=1

ans=0
for n in d:
  ans += n*(n-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
src={}
ans=0
pre=0
for s in range(len(S)):
  a=(int(S[-(s+1)])*(10**s)+pre)%2019
  if a not in src.keys():
    src[a]=1
  else:
    ans+=src[a]
    src[a]+=1
  pre+=int(S[-(s+1)])*(10**s)
print(ans+src[0])
Problem p02639 (python)

Fixed submission:
xs = [int(e) for e in input().split()]
for i in range(5):
  if not xs[i] == i+1:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
nums = [int(e) for e in input().split()]
for i in range(5):
  if not xs[i] == i:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
nums = [int(e) for e in input().split()]
for i in range(5):
  if not xs[i] == i:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
xs[5] = []
for i in range(5):
  xs.append(int(input()))
  if not xs[i] = i:
    print i
    break

Buggy submission (verdict: Runtime Error):
xs[5] = []
for i in range(5):
  xs.append(int(input()))
  if not xs[i] == i:
    print i
    break

Buggy submission (verdict: Runtime Error):
xs[5] = []
for i in range(5):
  xs.append(int(input()))
  if not xs[i] = i:
    print i
    break
Problem p02660 (python)

Fixed submission:
N = int(input())
pf = {}
answer = 0

for i in range(2,int(N**0.5)+1):
    while N % i ==0:
        pf[i] = pf.get(i, 0) + 1
        N //= i
    
    if N < i:
        break
if N > 1:
    answer += 1
    
for j, k in pf.items():
    sq = 1
    for l in range(k):
        answer += 1
        k -= sq
        sq += 1
        if k == 0:
            break
        elif k < 0:
            answer -= 1
            break

print(answer)

Buggy submission (verdict: Runtime Error):
from sympy import divisors
input_line1 = input()
N = int(input_line1)
count = 0
D = len(divisors(N))

if D == 2:
    count = 1
else:
    for i in range (2,N):
        if N % i == 0:
            count += 1
            N = int(N / i)
            D = len(divisors(N))
            if D == 2:
                count += 1
                if N <= i:
                    count -= 1
                break
 
print(count)
Problem p03106 (python)

Fixed submission:
#import math

def gcd(m,n):
    x = max(m, n)
    y = min(m, n)
    if x%y == 0:
        return y
    else:
        while x%y!= 0:
            z = x%y
            x = y
            y =z
        else:
            return z


A, B, K = map(int, input().split())

Max = int(gcd(A, B) )


list = [0] * 1000

j =0

if A == 1 or B == 1:
    print("1")
    quit()

for i in range(Max):

    if i == 0:
        continue
    if Max % i == 0:
        list[j] = i
        j += 1

if K == 1:
    print(Max)
    exit()

print(list[j - K+1])

Buggy submission (verdict: Runtime Error):
import math

A, B, K = map(int, input().split())

Max = int(math.gcd(A, B) )


list = [0] * 100

j =0

if A == 1 or B == 1:
    print("1")
    quit()

for i in range(Max):

    if i == 0:
        continue
    if Max % i == 0:
        list[j] = i
        j += 1


print(list[j - K+1])
Problem p03109 (python)

Fixed submission:
#   AtCoder Beginner Contest 119
#   problem A: Still TBD

S = input() #-> yyyy/mm/dd

date = S.split('/')

year = int(date[0])
month = int(date[1])
day = int(date[2])

if month >= 5:
    print('TBD')
else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
#   AtCoder Beginner Contest 119
#   problem A: Still TBD

S = input() #-> yyyy/mm/dd

date = S.split('/')

year = int(date[0])
month = int(date[1])
day = int(date[2])

if month >= 5:
    print('TBD')
elif:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
#   AtCoder Beginner Contest 119
#   problem A: Still TBD

S = input() #-> yyyy/mm/dd

date = S.split('/')

year = int(date[0])
month = int(date[1])
day = int(date[2])

if month >= 5:
    print('TBD')
elif
    print('Heisei')
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
if T[0:-1] == S:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()

if b[0:-1] == a
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
if chokudai == chokudai:
  print('no')
elif:
  print('yes')
Problem p02705 (python)

Fixed submission:
from math import pi

r = input()
print(2 * int(r) * pi)

Buggy submission (verdict: Runtime Error):
from math import pi
def cicle(hankei):
    return 2 * hankei * pi

circle(1)
circle(73)
Problem p02681 (python)

Fixed submission:
import re

s=input()
t=input()

if len (t)>=len(s)+1 and re.match(s,t):
  print ("Yes")
else:
  print ("No")

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

if A>=K:
  print (K)
elif K>A and B>=K-A:
  print (A)
else:
  print (2*A-K+B)
Problem p02646 (python)

Fixed submission:
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
d = abs(a-b)
s = v - w
if s > 0 and d/s <= t:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
d = abs(a-b)
s = v - w
if s > 0 d/s <= t:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
d = abs(a-b)
s = v - w
if s > 0 and not d%s and d/ss <= t:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
d = abs(a-b)
ss = v+w
ms = abs(w-v)
if not d%ss and d/ss <= t:
  print("YES")
elif not d%ms and d/ms <= t:
  print("YES")
else:
  print("NO")
Problem p02639 (python)

Fixed submission:
print(input().index("0")//2+1)

Buggy submission (verdict: Runtime Error):
print(input().index()//2+1)
Problem p02681 (python)

Fixed submission:
s=input()
t=input()
if s==t[0:len(t)-1]: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
n,m,k=[int(x) for x in input().split()]
#TODO Mutiply wih m
if m==1:
  if k==n-1: print(1)
  else: print(0)
  exit()
sumi=0
mod=998244353
prodi=pow(m-1,n-1,mod)
invi=pow(m-1,mod-2,mod)
for j in range(n-1,n-1-k-1,-1):
  sumi+=prodi
  sumi%=mod
  prodi*=j
  prodi%=mod
  prodi*=pow(n-j,mod-2,mod)
  prodi%=mod
  prodi*=invi
  prodi%=mod 
sumi*=m
sumi%=mod
print(sumi)

Buggy submission (verdict: Runtime Error):
n,m,k=[int(x) for x in input().split()]
#TODO Mutiply wih m
sumi=0
mod=998244353
prodi=pow(m-1,n-1,mod)
invi=pow(m-1,mod-2,mod)
for j in range(n-1,n-1-k-1,-1):
  sumi+=prodi
  sumi%=mod
  prodi*=n-j
  prodi%=mod
  prodi*=pow(j+1,mod-2,mod)
  prodi%=mod
  prodi*=invi
  prodi%=mod
sumi*=m
sumi%=mod
print(sumi)
Problem p02743 (python)

Fixed submission:
a,b,c=[int(x) for x in input().split()]
if c<=a or c<=b: print("No")
elif 2*(a*b+b*c+c*a)<a**2+b**2+c**2: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=[int(x) for x in input().split()]
if c<=a or c<=b: print("No")
elif 2(a*b+b*c+c*a)<a**2+b**2+c**2: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=[int(x) for x in input().split()]
if c<=a or c<=b: print("No")
else if 2(a*b+b*c+c*a)<a**2+b**2+c**2: print("Yes")
else: print("No")
Problem p02639 (python)

Fixed submission:
arr = list(map(int, input().split()))
print(15-sum(arr))

Buggy submission (verdict: Runtime Error):
arr = input().spilt()
arr = int(arr)
print(15-sum(arr))
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
flag = 0
list = [int(x) for x in input().split()]
for i in range(1, n):
  if flag == n:
    break
  else:
    m = list[i-1:].count(i)
    flag += m
    print(m)
print(0)

Buggy submission (verdict: Runtime Error):
r =int(imput())
print(6.28*r)
Problem p03434 (python)

Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
a = 0
b = 0
for i in range(n):
  if i % 2 == 0:
    a += max(l)
    l.remove(max(l))
  elif i % 2 == 1:
    b += max(l)
    l.remove(max(l))
print(a-b)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(x) for x in input().split()]
a = 0
b = 0
for i in range(n):
  if i % 2 == 0:
    a += max(l)
    l = l.remove(max(l))
  elif i % 2 == 1:
    b += max(l)
    l = l.remove(max(l))
print(a-b)
Problem p02639 (python)

Fixed submission:
l=input().split()
for i in range(5):
  a = str(0)
  if l[i]==a:
    print(i+1)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())
for i in range(X+1):
  if Y==2*i+4*(X-i):
    print('YES')
    exit()
print('NO')
Problem p02645 (python)

Fixed submission:
a=input()
b=list(a)
c=b[0:3]
d="".join(c)
print(d)

Buggy submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if b-a>=0:
  if (v-w)*t >= b-a:
    print('YES')
  else:
    print('NO')
else:
  print('NO')
Problem p02639 (python)

Fixed submission:
A = [int(x) for x in input().split()]
N = int(len(A))

for i in range(N):
  if A[i]-0==0:
    print(i+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
 
for i in N:
  if A[i]==0:
    print int(i)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]

for i in N:
  if A[i]==0:
    return i
Problem p03029 (python)

Fixed submission:
x=input()
xx=x.split()
A=int(xx[0])
P=int(xx[1])
a=(A*3+P)/2
print(int(a))

Buggy submission (verdict: Runtime Error):
# 行数
N = int(input().strip())

# 2次元配列
grid = []
for i in range(N):
    array = list(input().strip().split())
    grid.append(array)
    grid[i][1]=int(grid[i][1])
print(grid)
agrid=sorted(grid)
for i in range(N-1):
  if agrid[i][0]==agrid[i+1][0] and agrid[i][1]<agrid[i+1][1]:
    b=agrid[i+1]
    c=agrid[i]
    agrid[i]=b
    agrid[i+1]=c
for i in range(N):
  print(agrid[i][1])

Buggy submission (verdict: Runtime Error):
x=input()
xx=x.split()
A=xx[0]
P=xx[1]
a=(A*3+P)/2
print(a)
Problem p03047 (python)

Fixed submission:
x=input()
xx=x.split()
b=int(xx[0])
c=int(xx[1])
a=b-c+1
print(a)

Buggy submission (verdict: Runtime Error):
x=input()
b=int(x[0])
c=int(x[2])
a=b-c+1
print(a)

Buggy submission (verdict: Runtime Error):
import math.factorial as mf

def select(N,K):
  a=mf(N)/(mf(K)*mf(N-K))
  return a
Problem p02675 (python)

Fixed submission:
N=input()
if N[-1] == '3':
  print('bon')
elif N[-1] in ['0','1','6','8']:
  print('pon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N=int(input())
if N[-1] == 3:
  print('bon')
elif N[-1] in [0,1,6,8]:
  print('pon')
else:
  print('hon')
Problem p02687 (python)

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

Buggy submission (verdict: Runtime Error):
S=input()
if S='ABC':
  print('ARC')
else:
  print('ABC')
Problem p02732 (python)

Fixed submission:
from scipy.misc import comb
N=int(input())
A=list(map(int,input().split()))
nset=set([])
ndict={}
for a in A:
  if a in nset:
    ndict[a]+=1
  else:
    nset.add(a)
    ndict[a]=1
#print(nset,ndict)
all=0
for n in nset:
  tmp=ndict[n]
  if tmp>=2:
    all+=comb(tmp,2,exact=True)
all=int(all)
for a in A:
  tmp=ndict[a]
  if tmp==1:
    print(all)
  elif tmp==2:
    print(all-1)
  else:
    print( all-comb(tmp,2,exact=True)+comb(tmp-1,2,exact=True) )

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
N=int(input())
A=list(map(int,input().split()))
nset=set([])
ndict={}
for a in A:
  if a in nset:
    ndict[a]+=1
  else:
    nset.add(a)
    ndict[a]=1
#print(nset,ndict)
all=0
for n in nset:
  tmp=ndict[n]
  if tmp>=2:
    all+=comb(tmp,2,exact=True)
all=int(all)
for a in A:
  tmp=ndict[a]
  if tmp==1:
    print(all)
  elif tmp==2:
    print(all-1)
  else:
    print( all-comb(tmp,2,exact=True)+comb(tmp-1,2,exact=True) )