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

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

if s == t:
  print(0)
else:
  for i in range(len(s)):
    if s[i] != t[i]:
      u += 1
  print(u)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
u = 0

if s == t:
  print(0)
else:
  for i in range(len(s)):
    if s[i] != t[i]:
      u += 1
    else:
      path

print(u)
Problem p02595 (python)

Fixed submission:
N, D = map(int, input().split())
i = 0
count = 0
while (i < N):
    p, q = map(int, input().split())
    d = (p*p + q*q) ** 0.5
    if (d <= D):
        count+= 1
    i+= 1
print(count)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
i = 0
count = 0
while (i < N):
    p, q = map(int, input().split())
    d = math.sqrt(p*p + q*q)
    if (d <= D):
        count+= 1
    i+= 1
print(i)
Problem p02779 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
d={}
flag=0

for i in range(n):
  if l[i] in d:
    flag=1
    break
  else:
    d[l[i]]=1
    
if flag==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
d={}
flag=0

for i in range(n):
  if l[i] in d:
    flag=1
    break
    
if flag==0:
  print("YES")
else:
  print("NO")
Problem p02693 (python)

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

flag = 0
for i in range(1000):
    if (a <= k * (i+1)) and (b >= k * (i+1)):
        print("OK")
        flag = 1
        break
if flag != 1:
    print("NG")

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

flag = 0
for i in range(1000):
    if (a <= k * (i+1) and (b >= k * (i+1):
        print("OK")
        flag=1
        break
if flag != 1:
    print("NO")
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
s,w = map(int,input().split())
 
if s > w:
  print(safe)
else:
  print(unsafe)

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

if s >= w:
  print(safe)
else:
  print(unsafe)
Problem p02594 (python)

Fixed submission:
X = float(input())
if X>=30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X = float(input())
if X=>30:
  print("Yes")
else
  print("No")
Problem p02595 (python)

Fixed submission:
import math
N, D = map(int, input().split())
sum=0
for i in range(0,N):
    X, Y = map(int, input().split())
    if pow(X,2)+pow(Y,2)<=pow(D,2):
        sum=sum+1
print(sum)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
sum=0
for i in range(0,N):
    X, Y = map(int, input().split())
    if sqrt(X^2+Y^2)<=D:
        sum=sum+1
print(sum)
Problem p02859 (python)

Fixed submission:
r=int(input())
print(pow(r,2))

Buggy submission (verdict: Runtime Error):
r=int(input())
print(powr,2)
Problem p02881 (python)

Fixed submission:
import math
N=int(input())
x=N+1
for i in range(1,int(math.sqrt(N))+1):
    if N%i==0:
        x=min(x,i+N//i)
print(x-2)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
A=[2*N]*N
for i in range(1,int(math.sqrt(N))):
    if N%i==0:
        A[i]=i+N//i-2
print(min(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[2*N]*N
for i in range(1,N//2):
    if N%i==0:
        A[i]=i+N//i-2
print(min(A))
Problem p02912 (python)

Fixed submission:
import heapq
N, M = map(int, input().split())
A = list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(A)
for i in range(0,M):
    a=heapq.heappop(A)
    heapq.heappush(A,(-1)*(-a//2))
print(-sum(A))

#　優先度付きキューが難しい

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(0,M):
    A[A.index(max)]=int(A[A.index(max)])

print(sum(A))
Problem p02546 (python)

Fixed submission:
a=input()
if(a[len(a)-1]=="s"):
	a+="e"
print(a+"s")

Buggy submission (verdict: Runtime Error):
a=input()
if(a[len(a)-1]=="s"):
	a.append("e")
print(a+"s")
Problem p02629 (python)

Fixed submission:
N=int(input())
n=0
for i in range(1,15):
   if N<=(n+26**i):
       break
   else:
       n+=26**i
#print(i)

N-=n
N-=1
#print(N)
A=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ans=""
for j in range(i):
    ans+=A[N//(26**(i-1-j))]
    N%=(26**(i-1-j))
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
n=0
for i in range(1,10):
   if N<=(n+26**i):
       break
   else:
       n+=26**i
#print(i)

N-=n
N-=1
#print(N)
A=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ans=""
for j in range(i):
    ans+=A[N//(26**(i-1-j))]
    N%=(26**(i-1-j))
print(ans)
Problem p02659 (python)

Fixed submission:
A,B=input().split()
A=int(A)
B=B.replace(".","")
print(A*int(B)//100)

Buggy submission (verdict: Runtime Error):
A,B=input().split()
A=int(A)
B=B.replace(".","")
print(A*B//100)
Problem p02757 (python)

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

if 10%P==0:
    ans=0
    for i in range(N):
        if int(S[i])%P==0:
            ans+=(i+1)
    print(ans)
else:
    S=S[::-1]
    D={}
    D[0]=1
    Amari=0
    for i in range(N):
        I=((Amari)+(pow(10,i,P)*int(S[i])))%P
        Amari=I
        if I not in D:
            D[I]=1
        else:
            D[I]+=1
    ans=0
    for k,v in D.items():
        ans+=v*(v-1)//2
    print(ans)
    #print(D)

Buggy submission (verdict: Runtime Error):
N,P=map(int,input().split())
S=input()
L=[]
M=0
for i in range(len(S)):
    L.append((M*10+int(S[i]))%P)
    M=L[-1]
#print(L)
if P==5:
    n=0
    ans=0
    for i in range(len(S)):
        if L[i]==0 or L[i]==5:
            ans+=n
            n+=1
    if n>0:
        ans+=n
elif P==2:
    n=0
    ans=0
    for i in range(len(S)):
        if L[i]%2==0:
            ans+=n
            n+=1
    if n>0:
        ans+=n
else:    
    D={}
    ans=0
    for i in range(len(L)):
        if L[i] not in D:
            D[L[i]]=1
        else:
            ans+=D[L[i]]
            D[L[i]]+=1
    if D[0]>0:
        ans+=D[0]
print(ans)
Problem p02984 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=[A[0]]
n=0
for i in range(1,N):
    B.append(A[i]-B[-1])
B.append(A[0]-B[-1])
#print(B)
X=(B[0]-B[-1])//2
Y=[X]
Z=[X*2]
for i in range(N-1):
    Y.append(A[i]-Y[i])
    Z.append(Y[-1]*2)
print(*Z)

Buggy submission (verdict: Runtime Error):
import copy
import numpy as np
N=int(input())
A=list(map(int,input().split()))
A=np.array(A)

MAX=A[0]
MIN=0
MID=(MAX+MIN+1)//2
#print(MID)
for i in range(100):
    B=copy.deepcopy(A)
    B[0]-=MID
    B[N-1]-=MID
    #print(B)
    for j in range(N):
        B[(j+1)%N]-=B[j]
        B[j]=0
    #print(B)
    if B[0]==0:
        C=copy.deepcopy(A)
        ANS=[0 for i in range(N)]
        C[0]-=MID
        C[N-1]-=MID
        ANS[0]+=MID*2
        #ANS[N-1]+=MID
        for j in range(N):
            C[(j+1)%N]-=C[j]
            ANS[(j+1)%N]+=C[j]*2
            #ANS[j]+=C[j]
            C[j]=0
            #print(C)
            #print(ANS)
        ans=str(ANS[0])
        for i in range(1,len(ANS)):
            ans+=" "+str(ANS[i])
        print(ans)
        exit()
    elif B[0]<0:
        MIN=MID
        if i%2==0:
            MID=(MIN+MAX)//2
        else:
            MID=(MIN+MAX+1)//2
    elif B[0]>0:
        MAX=MID
        if i%2==0:
            MID=(MIN+MAX)//2
        else:
            MID=(MIN+MAX+1)//2
Problem p03018 (python)

Fixed submission:
s=input()

S=[s[0]]

for i in range(1,len(s)):
    if S[len(S)-1]=="B" and s[i]=="C":
        S[len(S)-1]="D"
    else:
        S.append(s[i])
#print(S)

L=[]
if S[len(S)-1]=="D":
    L.append(1)
else:
    L.append(0)
    
for i in range(1,len(S)):
    if S[len(S)-1-i]=="D":
        L.append(L[len(L)-1]+1)
    elif S[len(S)-1-i]=="A":
        L.append(L[len(L)-1])
    else:
        L.append(0)
L=L[::-1]
#print(L)
ANS=0
for i in range(len(S)):
    if S[i]=="A":
        ANS+=L[i]
print(ANS)

Buggy submission (verdict: Runtime Error):
s=input()
s+="Z"
S=""
F=0
for i in range(len(s)):
    if F==0:
        if s[i]=="B":
            F=1
        else:
            S+=s[i]
    else:
        if s[i]=="C":
            S+="D"
            F=0
        elif s[i]=="B":
            S+="B"
        else:
            S+=s[i]
            F=0
if S[len(S)-1]=="Z":
    S=S[:len(S)-1]
#print(S)
S=S[::-1]
L=[]
if S[0]=="D":
    L.append(1)
else:
    L.append(0)
for i in range(1,len(S)):
    if S[i]=="D":
        L.append(L[i-1]+1)
    elif S[i]=="A":
        L.append(L[i-1])
    else:
        L.append(0)
L=L[::-1]
S=S[::-1]
#print(S)
#print(L)
ANS=0
for i in range(len(S)):
    if S[i]=="A":
        ANS+=L[i]
print(ANS)

Buggy submission (verdict: Runtime Error):
s=input()
s+="Z"
S=""
F=0
for i in range(len(s)):
    if F==0:
        if s[i]=="B":
            F=1
        else:
            S+=s[i]
    else:
        if s[i]=="C":
            S+="D"
            F=0
        elif s[i]=="B":
            S+="B"
        else:
            S+=s[i]
            F=0
if S[len(S)-1]=="Z":
    S=S[:len(S)-1]
#print(S)
S=S[::-1]
L=[]
if S[0]=="D":
    L.append(1)
else:
    L.append(0)
for i in range(1,len(S)):
    if S[i]=="D":
        L.append(L[i-1]+1)
    elif S[i]=="A":
        L.append(L[i-1])
    else:
        L.append(0)
L=L[::-1]
S=S[::-1]
#print(S)
#print(L)
ANS=0
for i in range(len(S)):
    if S[i]=="A":
        ANS+=L[i]
print(ANS)

Buggy submission (verdict: Runtime Error):
s=input()
s+="Z"
S=""
F=0
for i in range(len(s)):
    if F==0:
        if s[i]=="B":
            F=1
        else:
            S+=s[i]
    else:
        if s[i]=="C":
            S+="D"
            F=0
        elif s[i]=="B":
            S+="B"
        else:
            S+=s[i]
            F=0
S=S[:len(S)-1]
#print(S)
S=S[::-1]
L=[]
if S[0]=="D":
    L.append(1)
else:
    L.append(0)
for i in range(1,len(S)):
    if S[i]=="D":
        L.append(L[i-1]+1)
    elif S[i]=="A":
        L.append(L[i-1])
    else:
        L.append(0)
L=L[::-1]
S=S[::-1]
#print(S)
#print(L)
ANS=0
for i in range(len(S)):
    if S[i]=="A":
        ANS+=L[i]
print(ANS)
Problem p03108 (python)

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

par=[i for i in range(N)]
size=[1 for i in range(N)]

def find(X):
    if par[X]==X:
        return X
    else:
        return find(par[X])

def union(X,Y):
    if size[X]>=size[Y]:
        par[Y]=par[X]
        size[X]+=size[Y]
    elif size[Y]>size[X]:
        par[X]=par[Y]
        size[Y]+=size[X]
    
L=[0 for i in range(M)]
for i in range(M):
    a,b=map(int,input().split())
    L[i]=[a-1,b-1]

L=L[::-1]

A=[]
for i in range(M):
    if find(L[i][0])==find(L[i][1]):
        A.append(0)
    else:
        A.append(size[find(L[i][0])]*size[find(L[i][1])])
        union(par[find(L[i][0])],par[find(L[i][1])])
        
A=A[::-1]
ans=0
for i in range(len(A)):
    ans+=A[i]
    print(ans)

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

par=[i for i in range(M)]
size=[1 for i in range(M)]

def find(X):
    if par[X]==X:
        return X
    else:
        return find(par[X])

def union(X,Y):
    if size[X]>=size[Y]:
        par[Y]=par[X]
        size[X]+=size[Y]
    elif size[Y]>size[X]:
        par[X]=par[Y]
        size[Y]+=size[X]
    
L=[]
for i in range(M):
    a,b=map(int,input().split())
    L.append([a-1,b-1])
    
L=L[::-1]

A=[]
for i in range(M):
    if find(L[i][0])==find(L[i][1]):
        A.append(0)
    else:
        A.append(size[find(L[i][0])]*size[find(L[i][1])])
        union(par[find(L[i][0])],par[find(L[i][1])])
        
A=A[::-1]
ans=0
for i in range(len(A)):
    ans+=A[i]
    print(ans)
Problem p03209 (python)

Fixed submission:
Pat=[1]
All=[1]
for i in range(51):
    Pat.append(Pat[i]*2+1)
    All.append(All[i]*2+3)

N,X=map(int,input().split())

def saiki(N,X):
    if N==0:
        if X<=0:
            return 0
        else:
            return 1
    elif X<=All[N-1]+1:
        return saiki(N-1,X-1)
    elif X<=All[N]-1:
        return Pat[N-1]+1+saiki(N-1,X-2-All[N-1])
    else:
        return Pat[N]
        
print(saiki(N,X))

Buggy submission (verdict: Runtime Error):
Pat=[1]
for p in range(51):
    Pat.append(Pat[p]*2+1)
    
All=[1]
for a in range(51):
    All.append(All[a]*2+3)
    
N,X=map(int,input().split())
    
def saiki(n,x):
    if n==0:
        if x<=0:
            return 0
        else:
            return 1
    elif x<n:
        return 0
    elif x<(All[n]+1)//2-1:
        return saiki(n-1,x-1)
    elif x==(All[n-1]+2):
        return Pat[n-1]+1
    elif x<=All[n]:
        return Pat[n-1]+1+saiki(n-1,x-2-All[n-1])
    
print(saiki(N,X))

Buggy submission (verdict: Runtime Error):
Pat=[1]
for p in range(51):
    Pat.append(Pat[p]*2+1)
    
All=[1]
for a in range(51):
    All.append(All[a]*2+3)
    
N,X=map(int,input().split())
    
def saiki(n,x):
    if n==0:
        if x<=0:
            return 0
        else:
            return 1
    elif x<n:
        return 0
    elif x<(All[n]+1)//2-1:
        return saiki(n-1,x-1)
    elif x==(All[n-1]+2):
        return Pat[n-1]+1
    elif x<All[n]:
        return Pat[n-1]+1+saiki(n-1,x-2-All[n-1])
    
print(saiki(N,X))
Problem p03242 (python)

Fixed submission:
n=input()
N=[]
for i in range(3):
    N.append(n[i])
for j in range(3):
    if N[j]=="1":
        N[j]="9"
    else:
        N[j]="1"
print("".join(N))

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

A1=[]
A2=[]
for i in range(len(A)):
    if i%2==0:
        A1.append(A[i])
    else:
        A2.append(A[i])
        
B1=collections.Counter(A1)
B2=collections.Counter(A2)


if B1.most_common(2)[0][1]==B2.most_common(2)[0][1] and B1.most_common(2)[0][1]==int(N/2):
    print(int(N/2))
else:
    
    if B1.most_common(1)==B2.most_common(1):
        if B1.most_common(2)[1][1]>=B2.most_common(2)[1][1]:
            ans=N-B1.most_common(2)[1][1]-B2.most_common(2)[0][1]
        else:
            ans=N-B2.most_common(2)[1][1]-B1.most_common(2)[0][1]
    elif B1.most_common(2)[0][0]==B2.most_common(2)[0][0]:
        if B1.most_common(2)[0][1]>=B1.most_common(2)[0][1]:
            ans=N-B1.most_common(2)[0][1]-B2.most_common(2)[1][1]
        else:
            ans=N-B2.most_common(2)[0][1]-B1.most_common(2)[1][1]
    else:
        ans=N-B1.most_common(2)[0][1]-B2.most_common(2)[0][1]
    print(ans)
Problem p03634 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

N=int(input())
n=[[]for i in range(N+1)]

for i in range(N-1):
    a,b,c=map(int,input().split())
    n[a].append([b,c])
    n[b].append([a,c])
    
L=[-1 for i in range(N+1)]

Q,K=map(int,input().split())

L[K]=0

def dfs(x):
    for i in n[x]:
        if L[i[0]]==-1:
            L[i[0]]=L[x]+i[1]
            dfs(i[0])
dfs(K)
#print(n)
#print(L)

for i in range(Q):
    x,y=map(int,input().split())
    print(L[x]+L[y])

Buggy submission (verdict: Runtime Error):
N=int(input())
n=[[]for i in range(N+1)]

for i in range(N-1):
    a,b,c=map(int,input().split())
    n[a].append([b,c])
    n[b].append([a,c])
    
L=[-1 for i in range(N+1)]

Q,K=map(int,input().split())

L[K]=0

def dfs(x):
    for i in n[x]:
        if L[i[0]]==-1:
            L[i[0]]=L[x]+i[1]
            dfs(i[0])
dfs(K)
#print(n)
#print(L)

for i in range(Q):
    x,y=map(int,input().split())
    print(L[x]+L[y])
Problem p03652 (python)

Fixed submission:
from collections import Counter

N,M=map(int,input().split())

L=[]
for i in range(N):
    A=list(map(int,input().split()))
    L.append(A)
    
OUTD=dict()
S=[0 for i in range(N)]

ANS=1000
for i in range(M):
    B=[0 for _ in range(N)]
    for j in range(N):
        for k in range(S[j],M):
            if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break
    X=Counter(B).most_common()[0]
    if X[1]<ANS:
        ANS=X[1]
    OUTD[X[0]]=1
    #print(ANS,B,OUTD)
print(ANS)

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

N,M=map(int,input().split())

L=[]
for i in range(N):
    A=list(map(int,input().split()))
    L.append(A)
    
OUTD=dict()
S=[0 for i in range(M)]

ANS=1000
for i in range(M):
    B=[0 for _ in range(N)]
    for j in range(N):
        for k in range(S[j],M):
            '''if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break'''
            if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break
    X=Counter(B).most_common()[0]
    if X[1]<ANS:
        ANS=X[1]
    OUTD[X[0]]=1
    #print(ANS,B,OUTD)
print(ANS)

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

N,M=map(int,input().split())

L=[]
for i in range(N):
    A=list(map(int,input().split()))
    L.append(A)
    
OUTD=dict()
S=[0 for i in range(M)]

ANS=1000
for i in range(M):
    B=[0 for _ in range(N)]
    for j in range(N):
        for k in range(S[j],M):
            if L[j][k] in OUTD:
                S[j]+=1
            else:
                B[j]=L[j][k]
                break
    X=Counter(B).most_common()[0]
    if X[1]<ANS:
        ANS=X[1]
    OUTD[X[0]]=1
    #print(ANS,B,OUTD)
print(ANS)
Problem p02693 (python)

Fixed submission:
K=int(input())
N,M=map(int,input().split())
FLAG=0
for i in range(1000):
    if K*i>=N and K*i<=M:
        print("OK")
        FLAG=1
        break
if FLAG==0:
    print("NG")

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int A[101],B[101],C[101],D[101];
int ans;
int N,M,Q;
void dfs(vector<int> v)
{
    // cout<<" hi"<<"";
    if(v.size()==N)
    {
        int sum=0;
        for(int i=0;i<Q;i++)
        {
            if (v[B[i]-1]-v[A[i]-1]==C[i])
            {
                sum+=D[i];
            }
        }
        ans=max(ans,sum);
    }
    else
    {
        for(int i=v[v.size()-1];i<=M;i++)
        {
            vector<int> n=v;
            n.push_back(i);
            dfs(n);
        }
    }
}
int main() 
{  
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ans=INT_MIN;
    cin>>N>>M>>Q;
    for(int i=0;i<Q;i++)
    {
        cin>>A[i]>>B[i]>>C[i]>>D[i];
    }
    for(int i=1;i<=M;i++)
    {
        vector<int> v;
        v.push_back(i);
        dfs(v);
    }
    cout<<ans<<" ";
}
Problem p02546 (python)

Fixed submission:
n = input()
if n[-1] == 's':
    n+='es'
else:
    n+='s'
print(n)

Buggy submission (verdict: Runtime Error):
n = input()
if n[-1] == 's':
    n+='es'
else:
    n+='s'
return n
Problem p02546 (python)

Fixed submission:
s = input()

if s[-1] != 's':

  s += 's'

else:

  s += 'es'

print(s)

Buggy submission (verdict: Runtime Error):
s = int(input())
if s[-1] != 's':
  s += 's'
else:
  s += 'es'
print(s)
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 0:
  x = 1
elif x == 1:
  x = 0
print(x)

Buggy submission (verdict: Runtime Error):
if x == 0:
  x = 1
else:
  x = 0
print(x)

Buggy submission (verdict: Runtime Error):
if x = 0:
  x = 1
else
  x = 0
return x
Problem p02701 (python)

Fixed submission:
N = int(input())
S = set()
count = 0
for _ in range(N):
    s = input()
    S.add(s)
print(len(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
for _ in range(N):
    s = input()
    if not s in lst:
        count += 1
print(count)
Problem p02754 (python)

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

if A == 0:
    print(0)
else:
    i = N // (A + B)
    j = N % (A + B)
    if j >= A:
        count = A * (i + 1)
        print(count)
    else:
        count = A * i + j
        print(count)

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

if A == 0:
    print(0)
else:
    s = 'b' * A + 'r' * B
    i = N // (A + B)
    j = N % (A + B)
    a = s[:j].count('b')
    count = A * i + a
    print(count)

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

s = 'b' * A + 'r' * B
while N > len(s):
    s += s
a = s[:N].count('b')
print(a)
Problem p02707 (python)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
d=[0]*(N+1)
for i in range(N-1):
    d[A[i]]+=1
for i in range(1,len(d)):
    print(d[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
l = [A.index(i+1) for i in range(max(A))]
l.append(N-1)
# print(l)

for i in range(N):
    if i >= len(l)-1:
        print(0)
    else:
        ans = l[i+1]-l[i]
        print(ans)
Problem p02659 (python)

Fixed submission:
a,b=input().split()
print(int(a)*round(float(b)*100)//100)

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

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

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print(a*round(b*100)//100)
Problem p03345 (python)

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

if k%2 == 0 and abs(a-b)<=10**18:print(a-b)
elif k%2 != 0 and abs(b-a)<=10**18:print(b-a)
else:print("Unfair")

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

if k%2 == 0 and abs(a-b)<=10**8:print(a-b)
elif k%2 != 0 abs(b-a)<=10**8:print(b-a)
else:print("Unfair")

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

if k%2 == 0 and abs(a-b)<=10**18:print(a-b)
elif k%2 != 0 and ans(b-a)<=10**18:print(b-a)
else:print("Unfair")

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

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
elif ans(b-a)<=10**18:print(b-a)
else:print("Unfair")

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

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
elif ans(b-a)<=10*18:print(b-a)
else:print("Unfair")

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

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
  else:print("Unfair")
else:
    if ans(b-a)<=10*18:print(b-a)
    else:print("Unfair")

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

if k%2 == 0:
  if abs(a-b)<=10**18:print(a-b)
  else:print("Unfair")
   
else:
    if ans(b-a)<=10*18:print(b-a)
    else:print("Unfair")
Problem p03835 (python)

Fixed submission:
K,S=map(int, input().split())
ans=0

for i in range(K+1):
  for j in range(K+1):
    if 0<=S-i-j<=K :
      ans+=1
print(ans)

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

asn=o

for i in range(k+1):
  for j in range(k+1):
    if 0<=s-i-j<=k: ans+=1

print(ans)
Problem p02623 (python)

Fixed submission:
n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
aa = [0]
bb = [0]

for s in range(n):
    aa.append(aa[s] + a[s])
for s in range(m):
    bb.append(bb[s] + b[s])      
ans = 0
j = m

for i in range(n+1):
    if aa[i] > k:
        break
    while bb[j] > k - aa[i]:
        j -= 1
    ans = max(ans, i+j)
        
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
aa = a.copy()
bb = b.copy()

aa = [sum(a[:s+1]) for s in range(n)]
bb = [sum(b[:s+1]) for s in range(m)]
      
temp, ans = 0, 0
j = m - 1

for i in range(n):
    if aa[i] > k:
        break
    while bb[j] > k - aa[i]:
        j -= 1
    temp = i+1 + j+1
    if temp > ans:
        ans = temp
        
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
aa = a.copy()
bb = b.copy()

aa = [sum(a[:s+1]) for s in range(n)]
bb = [sum(b[:s+1]) for s in range(m)]
      
temp, ans = 0, 0
j = m - 1

for i in range(n):
    if aa[i] > k:
        break
    while bb[j] > k - a[i]:
        j -= 1
    temp = i+1 + j+1
    if temp > ans:
        ans = temp
        
print(ans)