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

Fixed submission:
a = list(map(int,input().split()))
b = a.count(5)
c = a.count(7)
if b == 2 and c == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())

if l.count(5) == 2:
    if l.count(7) ==1:
        print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = int(input())
d = [a,b,c]
if d.count(5) == 2:
    if d.count(7) == 1:
        print('Yes')
else:
    print('No')
Problem p02574 (python)

Fixed submission:
from math import gcd
max_a = int(2e6)
factor = [0]*max_a
for p in range(2,max_a):
  if factor[p]:
    continue
  factor[p] = p
  for x in range(p+p,max_a,p):
    if factor[x]:
      continue
    factor[x] = p

def prime_fac(ai):
  while factor[ai]:
    yield factor[ai]
    x = factor[ai]
    while x == factor[ai]:
      ai = int(ai/factor[ai])

n = int(input())
a = list(map(int,input().split()))

cnt = [0]*max_a
loop_end = False
g = 0
pairwise_coprime = True
setwise_coprime = True

for ai in a:
  for p in prime_fac(ai):
    if cnt[p]:
      pairwise_coprime = False
      loop_end = True
    cnt[p] = 1
    if loop_end:
      break
  if loop_end:
    break

for ai in a:
  g = gcd(g,ai)
setwise_coprime = g==1

if pairwise_coprime:
  print('pairwise coprime')
elif setwise_coprime:
  print('setwise coprime')
else:
  print('not coprime')

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>

template<uint32_t N = 10'000'000>
struct Sieve_of_Eratosthenes{
  using u32 = uint32_t;
  std::vector<u32> factor;
  Sieve_of_Eratosthenes(){
    factor.resize(N+1);
    for(u32 p=2;p<=N;++p){
      if(factor[p])continue;
      factor[p] = p;
      for(u32 x=p+p;x<=N;x+=p){
        if(factor[x])continue;
        factor[x] = p;
      }
    }
  }
  std::vector<u32> prime_factor(u32 x){
    std::vector<u32> pf;
    while(factor[x]){
      pf.push_back(factor[x]);
      while(factor[x]==pf.back())x/=factor[x];
    }
    return pf;
  }
};

signed main(){
  using namespace std;
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin>>n;
  vector<int> a(n);
  for(auto& ai:a)cin>>ai;

  constexpr int a_max = 1e6;
  Sieve_of_Eratosthenes ushi;

  map<int,int> mp;
  bool pairwise_coprime = true;
  bool setwise_coprime = accumulate(begin(a),end(a),0,[](auto a,auto b){return gcd(a,b);}) == 1;

  for(auto const& ai:a){
    for(auto const& p:ushi.prime_factor(ai)){
      if(mp.count(p)){
        pairwise_coprime = false;
        goto loopend;
      }
      mp[p]++;
    }
  }
loopend:

  if(pairwise_coprime){
    cout<<"pairwise coprime"<<endl;
  }
  else if(setwise_coprime){
    cout<<"setwise coprime"<<endl;
  }
  else{
    cout<<"not coprime"<<endl;
  }


}
Problem p03486 (python)

Fixed submission:
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)

if S<T:print("Yes")
else :print("No")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)



i=0
a=False
for wer in range( len(S) ):
    if S[i]<T[i]:
        a=True
        break
    i+=1
   

if a:print("Yes")
else :print("No")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)


a=True

for i in range(10):
    if s[i]>t[i]:
        a=False


if a: print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)
for char in S:
    print(char,end="")
print()
for char in T:
    print(char,end="")
print()

a=True

for i in range(10):
    if s[i]>t[i]:
        a=False


if a: print("Yes")
Problem p03074 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,k = map(int, input().split())
s = input()

ans = 0
cnt = 0
right = 1
for left in range(0, n):
    if left == 0 and s[left] == '0':
        cnt += 1

    if left > 0 and s[left] == '1' and s[left-1] == '0':
        cnt -= 1

    while right <= n - 1:
        if s[right] == '0' and s[right-1] == '1':
            if cnt < k:
                cnt += 1
            else:
                break
        right += 1

    ans = max(ans, right - left)

print(ans)

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

n,k = map(int, input().split())
s = input().rstrip()

li = []
fi = int(s[0])
cnt = 1
for i in range(1, n):
    if s[i-1] == s[i]:
        cnt += 1
    else:
        li.append(cnt)
        cnt = 1
li.append(cnt)

sums = [0] * (len(li)+1)
for i in range(0,len(li)):
    sums[i+1] = li[i] + sums[i]

ans = 0
ma = k*2+1 if fi == 1 else k*2
nn = max(1, len(sums) - ma)
for i in range(nn, len(sums)):
    sum = sums[i] - sums[i-ma]
    ans = max(ans, sum)

print(ans)
Problem p02555 (python)

Fixed submission:
s=int(input())

bun=[]
bun.append([0,0]+[1]*(s-2))
for j in range(1,s//3):
    bun.append([0]*(3*(j+1)-1)+[1])
    for i in range(3*(j+1),s):
        bun[j].append((bun[j][i-1]+bun[j-1][i-3])%(10**9+7))

ans=0
for i in range(s//3):
    ans = (ans+bun[i][s-1])%(10**9+7)

print(ans)

Buggy submission (verdict: Runtime Error):
bun=[]
bun.append([0,0]+[1]*(s-2))
for j in range(1,s//3):
    bun.append([0]*(3*(j+1)-1)+[1])
    for i in range(3*(j+1),s):
        bun[j].append((bun[j][i-1]+bun[j-1][i-3])%(10**9+7))

ans=0
for i in range(s//3):
    ans = (ans+bun[i][s-1])%(10**9+7)

print(ans)
Problem p02613 (python)

Fixed submission:
N = int(input())

a = [0]*N
for i in range(N):
    a[i]=input()

result=[0]*4
for i in range(len(a)):
    if a[i] == "AC":
        result[0]+=1

    if a[i] == "WA":
        result[1]+=1

    if a[i] == "TLE":
        result[2]+=1

    if a[i] == "RE":
        result[3]+=1

print("AC x ",result[0])
print("WA x ",result[1])
print("TLE x ",result[2])
print("RE x ",result[3])

Buggy submission (verdict: Runtime Error):
N = int(input())
2 s = [input() for i in range(N)]
3 for v in ['AC', 'WA', 'TLE', 'RE']:
4 print('{0} x {1}'.format(v, s.count(v)))
Problem p02681 (python)

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

Buggy submission (verdict: Runtime Error):
N,M,X = list(map(int,input().split()))
skill = [list(map(int,input().split())) for i in range(N)]
cost = []

for i in range(2**N):
    total_skill=[0,0,0,0]
    for j in range(N):
        if ((i>>j) & 1):
            total_skill = [x+y for (x,y) in zip(total_skill,skill[j])]
    count=0
    for k in total_skill[1:]:
        if k<X:
            count +=1
    if count==0:
        cost.append(total_skill[0])

cost.sort()
print(-1 if cost==[] else cost[0])
Problem p02700 (python)

Fixed submission:
import math
A,B,C,D = list(map(int,input().split()))

if (math.ceil(C/B)-math.ceil(A/D))<1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
print(C/B)
print(A/D)
if (math.ceil(C/B)-math.ceil(A/D))<1:
    print("Yes")
else:
    print("No")
Problem p02813 (python)

Fixed submission:
import itertools

n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
ls = list(itertools.permutations(range(1,n+1)))
print(abs(ls.index(p)-ls.index(q)))

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
ls = list(itertools.parmutations(range(1,n+1)))
print(abs(ls.index(p)-ls.index(q)))
Problem p02841 (python)

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

print(1 if md1[0]!=md2[0] else 0)

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

print(1 if md1[0]!=md2[0] else 0)
Problem p02946 (python)

Fixed submission:
K,X = map(int,input().split())

for i in range(X-K+1, X+K):
    if -1000000<=i<=1000000:
        print(i, end=' ')

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

for i in range(max(-1000000,X-K+1), min(X+K,1000000):
    print(i, end=' ')
Problem p02947 (python)

Fixed submission:
n = int(input())
s = ["".join(sorted(list(input()))) for _ in range(n)]
s.sort()
ans=0
pairs=1
for i in range(n-1):

    if s[i]==s[i+1]:
        pairs += 1
    else:      
        ans += pairs*(pairs-1)/2
        pairs =1
if pairs != 1:
    ans += pairs*(pairs-1)/2
    pairs =1
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = ["".join(sorted(list(input()))) for _ in range(n)]
s.sort()
cnt=0
for i in range(n-1):
    if s[i]==s[i+1]:
    cnt +=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = ["".join(sorted(list(input()))) for _ in range(n)]
s.sort()
print(s)
cnt=0
for i in range(n-1):
    if s[i]==s[i+1]
    cnt +=1
print(cnt-n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = ["".join(sorted(list(input()))) for _ in range(n)]

cnt=0
for i in range(n):
    if s.count(s[i])!=1
        cnt += s.count(s[i])/s.count(s[i])
print(cnt-n)
Problem p02952 (python)

Fixed submission:
N=int(input())

step = sum([90*100**i for i in range(len(str(N))//2)])
dance_floor = sum([9*100**i for i in range(len(str(N))//2)])

ans = len(str(N))%2 * (N-step)  +  -1*(len(str(N))%2-1) * dance_floor
print(ans)

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

sum=0
if len(str(N))%2==0:
    for i in range(int(len(str(N))/2)):
        sum += 9*10**(i*2)
else:
    for i in range(len(str(N))//2):
        sum += 9*10**i
    sum += N-int("9"*(len(str(N))-1))

print(sum)
Problem p02957 (python)

Fixed submission:
A,B = map(int,input().split())
print("IMPOSSIBLE" if (A+B)%2!=0 else int((A+B)/2))

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

step = sum([90*100**i for i in range(len(str(N))//2)])
dance_floor = sum([9*100**i for i in range(len(str(N))//2)])

ans = len(str(N))%2 * (N-step)  +  -1*(len(str(N))%2-1) * dance_floor
print(ans)
Problem p02993 (python)

Fixed submission:
s=input()

flag=True
for i in range(len(s)-1):
    if s[i+1]==s[i]:
        flag=False
print("Good" if flag else "Bad")

Buggy submission (verdict: Runtime Error):
s=input()
print("Good" if len(s)=len(set(s)) else "Bad")
Problem p02999 (python)

Fixed submission:
A,X=map(int,input().split())
print(10 if A>=X else 0)

Buggy submission (verdict: Runtime Error):
a,x=map(int,input().split())
print(10 if A>=X else 10)
Problem p03000 (python)

Fixed submission:
N,X = map(int,input().split())
l=[0]
l += list(map(int,input().split()))
sum=0
for i in range(N+1):
    sum += l[i]
    if sum>X:
        print(i)
        exit()
print(N+1)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
l=[0]
l.append(list(map(int,input().split())))

sum=0
for i in range(N+1):
    sum += l[i]
    if sum>X:
        print(i)
        exit()
print(N+1)

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

sum=0
for i in range(N-1):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)

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

sum=0
for i in range(N):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)

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

sum=0
for i in range(N+1):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)

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

sum=0
for i in range(N+1):
    if sum>X:
        print(i)
        exit()
    sum += l[i]
Problem p03035 (python)

Fixed submission:
A,B = map(int,input().split())
if 13<=A:
    ans=B
elif 6<=A:
    ans=B/2
else:
    ans = 0

print(int(ans))

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if 13<=A:
    ans=B
elif 6<=A:
    ans=B/2S
else:
    ans = 0

print(ans)
Problem p03059 (python)

Fixed submission:
A,B,T = map(int,input().split())
print(T//A*B)

Buggy submission (verdict: Runtime Error):
A,B,T = map(input().split())
print(T//A*B)
Problem p03085 (python)

Fixed submission:
dict={"A":"T","T":"A","G":"C","C":"G"}
print(dict[input()])

Buggy submission (verdict: Runtime Error):
dict={"A":"T","T":"A","G":"C","C":"G"}
print(dict(input()))

Buggy submission (verdict: Runtime Error):
dict={"A":"T","T":"A","G":"C","C":"G"}
print(dict(input))
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split())
ans_list=[0]
for i in range(1,min(A,B)+1):
    if A%i==B%i==0:
        ans_list.append(i)
print(ans_list[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
i=1
count=max(A,B)
while 1:
    if A%i+B%i==0:
        count +=1
    if count=K:
        print(i)
    i-=1
Problem p03110 (python)

Fixed submission:
N = int(input())
ans=0
for _ in range(N):
    xu=input().split()
    if xu[1]=="JPY":
        ans+=int(xu[0])
    else:
        ans+=float(xu[0])*380000
print(ans+0.000001)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans=0
for _ in range(N):
    xu=input().split()
    if xu[1]=="JPY":
        ans+=xu[0]
    else:
        ans+=xu[0]*380000
print(ans)
Problem p03160 (python)

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

cost = [0,abs(h[1]-h[0])]
for i in range(1,N-1):
    cost.append( min(cost[i]+abs(h[i+1]-h[i]), cost[i-1]+abs(h[i+1]-h[i-1])) )
print(cost[-1])

Buggy submission (verdict: Runtime Error):
def cmin(a,b):
    if a>b:
        return b
    else:
        return a

N = int(input())
h = list(map(int,input().split()))

dp[] = [0] + [float("inf")]*(N-1)
for i in range(N-2):
    dp[i] = cmin(dp[i],dp[i-1]+abs(h[i-1]-h[i]))
print(dp[-1])
Problem p03161 (python)

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

cost = [0]
for i in range(2,N+1):
    cost.append( min([cost[j] + abs(h[i-1]-h[j]) for j in range(max(0,i-K-1), i-1)]) )
print(cost[-1])

Buggy submission (verdict: Runtime Error):
def cmin(a,b):
    if a>b:
        return b
    else:
        return a

# N,K = map(int,input().split())
# h = list(map(int,input().split()))

dp = [0] + [float("inf")]*(N-1)
for i in range(1,N):
    for j in range(1, min(i+1,K+1)):
        dp[i] = cmin(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
print(dp)
Problem p03163 (python)

Fixed submission:
import numpy as np

N,W = map(int,input().split())
wv = np.array([list(map(int,input().split())) for _ in range(N)])
dp=np.zeros([N+1,W+1])

#　繰り返し回数節約
for i in range(1,N+1):
    dp[i][:wv[i-1][0]] = dp[i-1][:wv[i-1][0]]
    dp[i][wv[i-1][0]:] = np.maximum(dp[i-1][wv[i-1][0]:],dp[i-1][:W+1-wv[i-1][0]]+wv[i-1][1])
print(int(dp[-1,-1]))

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

N,W = map(int,input().split())
wv = np.array([list(map(int,input().split())) for _ in range(N)])
dp=np.zeros([N+1,W+1])

#　基本形
for i in range(1,N+1):
    dp[i][:wv[i-1][0]] = dp[i-1][:wv[i-1][0]]
    for j in range(wv[i-1][0],W+1):
        dp[i][j] = max(dp[i-1][j],dp[i-1][j-wv[i-1][0]]+wv[i-1][1])
print(int(dp[-1,-1]))

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

N,W = map(int,input().split())
wv = np.array([list(map(int,input().split())) for _ in range(N)])
dp=np.zeros([N+1,W+1])

# 改善案
for i in range(1,N+1):
    dp[i][:wv[i-1][0]-1] = dp[i-1][:wv[i-1][0]-1]
    for j in range(wv[i-1][0],W+1):
        if dp[i-1][j] <= dp[i-1][j-wv[i-1][0]]+wv[i-1][1]:
            dp[i][j:N] = dp[i-1][j-wv[i-1][0]:N-wv[i-1][0]]+wv[i-1][1]
            break
        dp[i][j] = dp[i-1][j]
print(int(dp[-1,-1]))

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

N,W = map(int,input().split())
wv = np.array([list(map(int,input().split())) for _ in range(N)])
dp=np.zeros([N+1,W+1])

for i in range(1,N+1):
    for j in range(W+1):
        if j-wv[i-1][0]<0:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j],dp[i-1][j-wv[i-1][0]]+wv[i-1][1])
print(int(dp[-1][-1]))

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

N,W = map(int,input().split())
wv = np.array([list(map(int,input().split())) for _ in range(N)])
dp=np.zeros([N+1,W+1])

for i in range(1,N+1):
    for j in range(W+1):
        if j-wv[i-1][0]<0:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j],dp[i-1][j-wv[i-1][0]]+wv[i-1][1])
print(int(dp[-1][-1])

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

N,W = map(int,input().split())
wv = np.array([list(map(int,input().split())) for _ in range(N)])
dp=np.zeros([N+1,W+1])

for i in range(1,N+1):
    for j in range(W+1):
        if j-wv[i-1][0]<0:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j],dp[i-1][j-wv[i-1][0]]+wv[i-1][1])
print(int(dp[-1][-1])
Problem p03211 (python)

Fixed submission:
s=input()
ans=999
for i in range(len(s)-2):
    ans = min(ans , abs(753-int(s[i:i+3])))
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans=[]
for i in range(len(s)-2):
    ans = min(ans , abs(753-int(s[i:i+3])))
print(min(ans))
Problem p03455 (python)

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

if (int(a)*int(b))%2==0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a)
print(b)
if a*b % 2 == 0:
  print("Couple")
else:
  print("Odd")

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

if (type(a) is int):
    a=int(a)
if (type(b) is int):
    b=int(b)
    if (a*b)%2==0:
        print("Couple num")
    else:
        print("Odd num")

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

if (a*b)%2==0:
    print("Couple num")
else:
    print("Odd num")

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

if (int(a)*int(b))%2==0:
    print("Couple num")
else:
    print("Odd num")

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

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

if (a*b)%2==0:
    print("Couple num")
else:
    print("Odd num")

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

if (a*b)%2==0:
    print("Couple num")
else:
    print("Odd num")

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

if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
Problem p03471 (python)

Fixed submission:
N,Y = input().split()
N = int(N)
Y_k=int(Y)/1000

answer = [-1,-1,-1]
for i in range(N+1):
    for j in range(N+1 - i):
        k = N-i-j
        if 10*i + 5*j + 1*k == Y_k:
            answer = [i,j,k]

print(answer[0],answer[1],answer[2])

Buggy submission (verdict: Runtime Error):
N,Y = input().split()
N = int(N)
Y_k=int(Y)/1000

answer - [-1,-1,-1]
for i in range(N+1):
    for j in range(N+1 - i):
        k = N-i-j
        if 10*i + 5*j + 1*k == Y_k:
            answer = [i,j,k]

print(answer[0],answer[1],answer[2])

Buggy submission (verdict: Runtime Error):
N,Y = input().split()
N = int(N)
Y_k=int(Y)/1000

answer - [-1,-1,-1]
for i in range(N+1):
    for j in range(N+1 - i):
        k = N-i-j
        if 10*i + 5*j + 1*k == Y_k:
            answer = [i,j,k]

print(answer[0],answer[1],answer[2])

Buggy submission (verdict: Runtime Error):
N,Y = input().split()
N = int(N)
Y_k=int(Y)/1000

for i in range(N+1):
    for j in range(N+1 - i):
        k = N-i-j
        if 10*i + 5*j + 1*k == Y_k:
            answer = [i,j,k]

print(answer[0],answer[1],answer[2])

Buggy submission (verdict: Runtime Error):
N,Y = input().split()
N = int(N)
Y_k=int(Y)/1000

for i in range(N+1):
    for j in range(N+1 - i):
        for k in range(N+1-i-j):
            if 10*i + 5*j + 1*k == Y_k:
                answer = [i,j,k]

print(answer)
Problem p03478 (python)

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

sum=0
for i in range(int(N)+1):
    nums = list(str(i))
    tmp = 0
    for j in nums:
        tmp = tmp + int(j)
    if int(A)<=tmp:
        if tmp<=int(B):
            sum = sum + i
print(sum)

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

sum=0
for i in range(N+1):
    nums = list(str(i))
    tmp = 0
    for j in nums:
        tmp = tmp + int(j)
    if A<=tmp:
        if tmp<=B:
            sum = sum + i
print(sum)
Problem p03493 (python)

Fixed submission:
count=0
str = list(input())

for x in str:
  if x=="1":
    count=count+1

print(count)

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

i=0
if a==1:
    i++
if b==1:
    i++
if c==1:
    i++
print(i)
Problem p03494 (python)

Fixed submission:
count= -1
flag = 1

num_list = [0]*int(input())
num_list = [int(x) for x in input().split()]

while 1:
    i=0
    for x in num_list:
        if x%2==1:
            flag = 0
            break
        else:
            num_list[i]=num_list[i]/2
        i=i+1
    count = count + 1
    if flag==0:
        break


print(count)

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

count = 0
while 1:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):

n = int(input())
a = np.array(list(map(int,input().split())))

count = 0
while 1:
    count+1

print(count)

Buggy submission (verdict: Runtime Error):

n = int(input())
a = np.array(list(map(int,input().split())))

count = 0
while 1:
    count+1
    a=a/2
print(count)
Problem p03773 (python)

Fixed submission:
a,b=map(int,input().split())
print((a+b)%24)

Buggy submission (verdict: Runtime Error):
import bisect

N=int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))

count=0
for i in range(N):
    a_cand = bisect.bisect_right(A,B[i]-1)
    c_cand = N-bisect.bisect_right(C,B[i])
    count += a_cand*c_cand
print(count)
Problem p03963 (python)

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

print(k * (k-1)**(n-1))

Buggy submission (verdict: Runtime Error):
N = int(input()) %10
hon=[2,4,5,7,9]
bon=[3]

if N in hon:
    print("hon")
elif N in bon:
    print("bon")
else:
    print("pon")
Problem p02548 (python)

Fixed submission:
def resolve():
    #n=int(input())
    #a,b=map(int,input().split())
    #x=list(map(int,input().split()))
    #a=[list(map(lambda x:int(x)%2,input().split())) for _ in range(h)]
    n=int(input())
    ans=0
    for a in range(1,n):
      if n-a*a<=0:
        break
      else:
        ans+=1
    for a in range(1,n-1):
      for b in range(a+1,n):
        if n-a*b<=0:
          break
        else:
          ans+=2
    print(ans)

if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
for a in range(1,n-1):
	for b in range(1,n-a):
		if n-a*b<=0:
			continue
		else:
			ans=+=1
print(ans)