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

Fixed submission:
def main():
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 1
    max = 0

    #while True:
        #i = 0
        #max += l[i]
        #if max < x:
            #ans += 1
        #i += 1

    for i in range(len(l)):
        max += l[i]
        if max <= x:
            ans += 1
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 1
    max = 0

    while True:
        i = 0
        max += l[i]
        if max < x:
            ans += 1
        i += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
def main():
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 1
    
    while True:
        i = 0
        max += l[i]
        if max < x:
            ans += 1
            
        i += 1
        
    print(ans)

main()
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A, B =nap(int, input().split())
print(A*B)
Problem p02657 (python)

Fixed submission:
import sys

def main(lines):
    # このコードは標準入力と標準出力を用いたサンプルコードです。
    # このコードは好きなように編集・削除してもらって構いません。
    # ---
    # This is a sample code to use stdin and stdout.
    # Edit and remove this code as you like.

    for i, v in enumerate(lines):
        print("line[{0}]: {1}".format(i, v))
        
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append([int(s) for s in l.rstrip('\r\n').split()])
A=lines[0][0]
B=lines[0][1]
print(A*B)

Buggy submission (verdict: Runtime Error):
import sys

def main(lines):
    # このコードは標準入力と標準出力を用いたサンプルコードです。
    # このコードは好きなように編集・削除してもらって構いません。
    # ---
    # This is a sample code to use stdin and stdout.
    # Edit and remove this code as you like.

    for i, v in enumerate(lines):
        print("line[{0}]: {1}".format(i, v))
        
if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append([int(s) for s in l.rstrip('\r\n').split()])
A=lines[0]
B=lines[1]
print(A*B)
Problem p02657 (python)

Fixed submission:
a, b = (int(x)
        for x in input().split())
print(a*b)

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

Buggy submission (verdict: Runtime Error):
a, b = (int(x)
        for x in input().split)
print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print(a*b)
Problem p02657 (python)

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

print(int(a)*int(b))

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

print(int(a)*int(b))

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

print(a*b)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
i = 0
p = 1

if 0 in a:
    print("0")
else:
    while i < n:
        p *= a[i]
        if p > 10**18:
            break
        i += 1
    if p <= 10**18:
        print(p)
    else:
        print("-1")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().strip().split()))
p = 1
j = 10**18
for i in range(n):
	p = p * a[i]
    if p > j:
      print(-1)
      break
    elif i = n-1:
      ptint(p)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().strip().split()))
p = 1
j = 10^18
for i in range(n):
	p = p * a[i]
    if p > j:
      print(-1)
      break
    elif i = n-1:
      ptint(p)
Problem p03106 (python)

Fixed submission:
import numpy as np

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

if __name__ == '__main__':
    A, B, K = map(int, input().split())
    N = make_divisors(np.gcd(A, B))
    N.sort(reverse=True)
    print(N[K-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
import sympy
A, B, K = map(int, input().split())
N = sympy.divisors(np.gcd(A, B))
N.sort(reverse=True)
print(N[K-1])
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N == 1:
  print("Hello World")
else:
  A,B=list(map(int,input().split()))
  print(A+B)
Problem p02818 (python)

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

if A>=K:
    i =A-K 
    j =B
elif (A+B) >= K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print('{} {}'.format(i,j))

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

if A>K:
    i =A-K 
elif (A+B) > K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print('{} {}'.format(i,j))

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

if A>K:
    i =A-K 
elif (A+B) > K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print(i,j)
Problem p02910 (python)

Fixed submission:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']
count =0

for i in range(n):
    if i % 2 ==0:
        if s[i] in k:
            count +=1
    else:
        if s[i] in g:
            count += 1
       
if count == n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
        if s[i] in k:
            count +=1
    else:
        if s[i] in g:
            count += 1
       
if count == n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
        new =[s[i] in k]
    else:
        new1 =[s[i] in g]
       
if new == [True] and new1 == [True]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
        new2 = True if s[i] in k else False
    else:
        new1 =True if s[i] in g else False
       
if new2 == True and new1 == True:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new2 = True if s[i] in k else False
    else:
        new1 =True if s[i] in g else False
       
if new2 == True and new1 == True:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new2 =[s[i] in k]
    else:
        new1 =[s[i] in g]
       
if new2 == [True] and new1 == [True]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new =[s[i] in k]
    else:
        new1 =[s[i] in g]
       
if new == [True] and new1 == [True]:
    print("Yes")
else:
    print("No")
Problem p03060 (python)

Fixed submission:
n =int(input())
v =list(map(int ,input().split()))
c =list(map(int ,input().split()))
ans =0
for i,j in zip(v,c):
    ans += max(0 ,i-j)
print(ans)

Buggy submission (verdict: Runtime Error):
n =int(input())
v =list(map(int ,input().split()))
c =list(map(int ,input().split()))
a =[]
if n ==1:
    print(0)
    
else:
    for i in range(n):
        for j in range(n):
            x =v[i] +v[j]
            y =c[i] +c[j]
            if not v[i] == v[j]:
                if not c[i] == c[j]:
                    a.append(x-y)
    print(max(a))
Problem p03061 (python)

Fixed submission:
from fractions import gcd
n =int(input())
a =list(map(int ,input().split()))

b =[a[0]]
for i in range(1,n-1):
    b.append(gcd(b[-1],a[i]))

c =[a[-1]]
for i in range(n-2,0,-1):
    c.append(gcd(c[-1], a[i]))

MAX =0
for i in range(n):
    if i == 0:
        MAX =max(MAX, c[-1])
    elif i ==n-1:
        MAX =max(MAX, b[-1])
    else:
        MAX =max(MAX, gcd(b[i-1], c[n-i-2]))
print(MAX)

Buggy submission (verdict: Runtime Error):
from math import gcd
n =int(input())
a =list(map(int ,input().split()))

b =[a[0]]
for i in range(1,n-1):
    b.append(gcd(b[-1],a[i]))

c =[a[-1]]
for i in range(n-2,0,-1):
    c.append(gcd(c[-1], a[i]))

MAX =0
for i in range(n):
    if i == 0:
        MAX =max(MAX, c[-1])
    elif i ==n-1:
        MAX =max(MAX, b[-1])
    else:
        MAX =max(MAX, gcd(b[i-1], c[n-i-2]))
print(MAX)

Buggy submission (verdict: Runtime Error):
from math import gcd
n =int(input())
a =list(map(int ,input().split()))

b =[a[0]]
for i in range(1,n-1):
    b.append(gcd(b[-1],a[i]))

c =[a[-1]]
for i in range(n-2,0,-1):
    c.append(gcd(c[-1], a[i]))

MAX =0
for i in range(n):
    if i == 0:
        MAX =max(MAX, c[-1])
    elif i ==n-1:
        MAX =max(MAX, b[-1])
    else:
        MAX =max(MAX, gcd(b[i-1], c[n-i-2]))

print(MAX)
Problem p02696 (python)

Fixed submission:
import sys
def main():
    A,B,N=tuple(map(int,sys.stdin.readline().split()))
    L=max([1,min([B-1,N])])
    print((A*L)//B) if B!=1 else print(0)
if __name__=='__main__':main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    A,B,N=tuple(map(int,sys.stdin.readline().split()))
    L=min([B-1,N])
    print(max(list(map(lambda c:(A*c)//B,list(range(1,L+1))))))
if __name__=='__main__':main()
Problem p03161 (python)

Fixed submission:
import sys
def main():
    INF=sys.maxsize
    N,K=tuple(map(int,sys.stdin.readline().split()))
    h=tuple(map(int,sys.stdin.readline().split()))
    dp=[INF for _ in range(N)]
    dp[0]=0
    for i in range(N-1):
        for j in range(1,K+1):
            if i+j<N:dp[i+j]=min([dp[i+j],dp[i]+abs(h[i+j]-h[i])])
    print(dp[N-1])
if __name__=='__main__':main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    INF=sys.maxsize
    N,K=tuple(map(int,sys.stdin.readline().split()))
    h=tuple(map(int,sys.stdin.readline().split()))
    dp=[INF for _ in range(N)]
    dp[0]=0
    for i in range(N-1):h
        for j in range(1,K+1):
            if i+j<N:dp[i+j]=min([dp[i+j],dp[i]+abs(h[i+j]-h[i])])
    print(dp[N-1])
if __name__=='__main__':main()
Problem p03163 (python)

Fixed submission:
import sys
def main():
    N,W=tuple(map(int,sys.stdin.readline().split()))
    w,v=[0],[0]
    for _ in [0]*N:
        wi,vi=tuple(map(int,sys.stdin.readline().split()))
        w.append(wi)
        v.append(vi)
    dp=[[0 for _ in [0]*(W+1)] for _ in [0]*(N+1)]
    for i in range(1,N+1):
        for j in range(1,W+1):
            dp[i][j]=max(dp[i-1][j], dp[i][j-1])
            if w[i]<=j:dp[i][j]=max(dp[i][j],dp[i-1][j-w[i]]+v[i])
    print(dp[N][W])
if __name__=='__main__':main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    N,W=tuple(map(int,sys.stdin.readline().split()))
    w,v=[0],[0]
    for _ in [0]*N:
        wi,vi=tuple(map(int,sys.stdin.readline().split()))
        w.append(wi)
        v.append(vi)
    dp=[[0 for _ in [0]*(W+1)] for _ in [0]*(N+1)]
    print(dp)
    for i in range(1,N+1):
        for j in range(1,W+1):
            print(f'i,j = {i}, {j}')
            dp[i][j]=max(dp[i-1][j], dp[i][j-1])
            if w[i]<=j:dp[i][j]=max(dp[i][j],dp[i-1][j-w[i]]+v[i])
        print(dp[i])
    print(dp[N][W])
if __name__=='__main__':main()
Problem p03169 (python)

Fixed submission:
import sys
def rec(N,dp,i,j,k):
    if dp[i][j][k]>=0.0:return dp[i][j][k]
    if all([i==0,j==0,k==0]):return 0.0
    res=0.0
    if i>0:res+=rec(N,dp,i-1,j,k)*i
    if j>0:res+=rec(N,dp,i+1,j-1,k)*j
    if k>0:res+=rec(N,dp,i,j+1,k-1)*k
    res=(res+N)*1.0/(i+j+k)
    dp[i][j][k]=res
    return dp[i][j][k]
def main():
    N=int(sys.stdin.readline())
    a=tuple(map(int,sys.stdin.readline().split()))
    n1,n2,n3=a.count(1),a.count(2),a.count(3)
    dp=[[[-1.0 for _ in range(n3+1)] for _ in range(n2+n3+1)] for _ in range(n1+n2+n3+1)]
    print(rec(N,dp,n1,n2,n3))
if __name__=='__main__':main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
from numba import njit

@njit
def rec(N,dp,i,j,k):
    if dp[i][j][k]>=0:return dp[i][j][k]
    if all([i==0,j==0,k==0]):return 0.0
    res=0.0
    if i>0:res+=rec(N,dp,i-1,j,k)*i
    if j>0:res+=rec(N,dp,i+1,j-1,k)*j
    if k>0:res+=rec(N,dp,i,j+1,k-1)*k
    res+=N
    res*=1.0/(i+j+k)
    dp[i][j][k]=res
    return dp[i][j][k]
def main():
    N=int(sys.stdin.readline())
    a=tuple(map(int,sys.stdin.readline().split()))
    n1,n2,n3=a.count(1),a.count(2),a.count(3)
    dp=np.full((310,310,310),-1,dtype='float')
    print(rec(N,dp,n1,n2,n3))
if __name__=='__main__':main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
def rec(N,dp,i,j,k):
    if dp[i][j][k]>=0:return dp[i][j][k]
    if all([i==0,j==0,k==0]):return 0.0
    res=0.0
    if i>0:res+=rec(N,dp,i-1,j,k)*i
    if j>0:res+=rec(N,dp,i+1,j-1,k)*j
    if k>0:res+=rec(N,dp,i,j+1,k-1)*k
    res+=N
    res*=1.0/(i+j+k)
    dp[i][j][k]=res
    return dp[i][j][k]
def main():
    N=int(sys.stdin.readline())
    a=tuple(map(int,sys.stdin.readline().split()))
    n1,n2,n3=a.count(1),a.count(2),a.count(3)
    dp=np.full((310,310,310),-1,dtype='float')
    print(rec(N,dp,n1,n2,n3))
if __name__=='__main__':main()
Problem p03863 (python)

Fixed submission:
import sys
def main():
    s=list(sys.stdin.readline().strip())
    t=0
    while len(s)>2:
        ps,cs,i,f=s[0],s[1],1,False
        for ns in s[2:]:
            if ps!=ns:
                cs,f,t=ns,True,t^1
                s.pop(i)
            else:ps,cs,i=cs,ns,i+1
        if f is False:break
    print('First') if t==1 else print('Second')
if __name__=='__main__':main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    s=list(sys.stdin.readline().strip())
    n,t=len(s),0
    while len(s)>2:
        f=False
        for i in range(1,n-1):
            if s[i-1]!=s[i+1]:
                s.pop(i)
                f,t=True,t^1
                break
        if f is False:
            break
    print('First') if t==1 else print('Second')
if __name__=='__main__':main()
Problem p04013 (python)

Fixed submission:
import numpy as np
n,avea=tuple(map(lambda x:int(x),input().split()))
x=list(map(lambda x:int(x), input().split()))
x=np.array(x)
x=x-avea
w=max(abs(min(x)),abs(max(x)))*n
dp=np.zeros((n+1,2*w+1),dtype=int)
dp[0,w]=1
for i in range(n):
    for j in range(2*w+1):
        if 0<=j-x[i]<=2*w:
            dp[i+1,j]=dp[i,j]+dp[i,j-x[i]]
        else:
            dp[i+1,j]=dp[i,j]
print(dp[n,w]-1)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,avea=tuple(map(lambda x:int(x),input().split()))
x=np.array(list(map(lambda x:int(x),input().split())))
dp=np.zeros((n+1,n+1,max(x)*n+1), dtype=int)
dp[:,0,0]=1
c=0
for i in range(n):
    for j in range(i):
        for k in range(max(x)*(i+1)):
            if k-x[i]>=0:
                dp[i+1,j,k]=dp[i,j,k]+dp[i,j-1,k-x[i]]
            else:
                dp[i+1,j,k]=dp[i,j,k]
        c+=dp[i+1,j,j*avea]
print(c)
Problem p04046 (python)

Fixed submission:
def combmod(n, r, p):
    if r < 0 or n < r:
        return 0
    return fact[n] * finv[r] * finv[n-r] % p


p = 10**9+7
N = 10**6
fact = [1, 1]
finv = [1, 1]
inv = [0, 1]

for i in range(2, N+1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    finv.append((finv[-1] * inv[-1]) % p)

h, w, a, b = (int(x) for x in input().split())
ans = 0
for j in range(b, w):
    ans += combmod(h-a-1 + j, j, p) * combmod(a+w-2 - j, w-1 - j, p)
print(ans % p)

Buggy submission (verdict: Runtime Error):
def func(i, j, h, w, a, b):
    if j == 0:
        return 1
    elif i == 0:
        if j < h - a:
            return 1
        else:
            return 0
    else:
        if 0 < i < b and h - a <= j < h:
            return 0
        else:
            return func(i-1, j, h, w, a, b) + func(i, j-1, h, w, a, b)


h, w, a, b = (int(x) for x in input().split())
y = func(w-1, h-1, h, w, a, b)
y = y % (1000000007)
print(y)
Problem p02657 (python)

Fixed submission:
vals = [int(v) for v in input().split()]
print(vals[0] * vals[1])

Buggy submission (verdict: Runtime Error):
vals = input.split()

a = int(vals[0])
b = int(vals[1])

print (a * b)
Problem p02658 (python)

Fixed submission:
N = int(input())
vals = [int(v) for v in input().split()]

rslt = 1

if 0 in vals:
  rslt = 0

for v in vals:
  rslt = rslt * v
  
  if rslt > 10 ** 18:
    rslt = -1
    break

print(rslt)

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

rslt = 1

for v in vals:
  rslt = rslt * v
  
  if rslt > 10 ** 18:
    rslt = '-1'

print(rslt)

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

rslt = 1

for v in vals:
  rslt = rslt * v
  
  if rslt > 10 ** 18:
    print(-1)
	import sys
    sys.exit()
    
print(rslt)
Problem p03861 (python)

Fixed submission:
s = input()
s = s.split(" ")
a = int(s[0])
b = int(s[1])
x = int(s[2])
res = b // x
res -= ((a - 1) // x)
print(res)

Buggy submission (verdict: Runtime Error):
s = input()
s = s.split(" ")
a = int(s[0])
b = int(s[1])
c = int(s[2])
res = b // x
res -= ((a - 1) // x)
print(res)
Problem p02658 (python)

Fixed submission:
from math import *
n = int(input())
a = [int(x) for x in input().split()]
ans = 1
ok = False
fail = False
for x in a:
  if (x == 0):
    ok = True
    break
for x in a:
  if (ans * x > 1000000000000000000):
    fail = True
    break
  ans *= x
if (ok):
  print(0)
else:
  if (fail):
    print("-1")
  else:
    print(ans)

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

using namespace std;

const double eps = 1e-9;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long long ans = 1;
  vector<long long> a(n);
  bool ok = false;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) ok = true;
  }
  if (ok) {
    cout << "0\n";
    return 0;
  }
  double foo = (double)1e18;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      cout << "0\n";
      return 0;
    }
    double bar = foo / a[i];
    if (bar < 1.0 * ans) {
      cout << "-1\n";
      return 0;
    }
    ans *= a[i];
  }
  cout << ans << '\n';
  return 0;
}
Problem p02657 (python)

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

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

print(a*b)
Problem p02717 (python)

Fixed submission:
def calc():
    x, y, z = c, a, b

    print(x, y, z)

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

Buggy submission (verdict: Runtime Error):
def calc():
    d = a
    a = b
    b = d

    d = a
    a = c
    c = d

    print(a,b,c)

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

Buggy submission (verdict: Runtime Error):
def calc():
    d = a
    a = b
    b = d

    d = a
    a = c
    c = d

    mytuple = (a,b,c)
    return mytuple

a, b, c = map(int, input().split())
ans = calc()
print(*ans)

Buggy submission (verdict: Runtime Error):
def calc():
    d = a
    a = b
    b = d

    d = a
    a = c
    c = d

    list = [a,b,c]
    return list

a, b, c = map(int, input().split())
print(calc())

Buggy submission (verdict: Runtime Error):
def calc():
    d = a
    a = b
    b = d

    d = a
    a = c
    c = d
    return a, b, c

a, b, c = map(int, input().split())
print(calc())
Problem p03693 (python)

Fixed submission:
def calc():
    ans = (r*100 + g*10 + b)
    
    if ans%4 == 0:
        return "YES"
    
    else:
        return "NO"
 
r, g, b = map(int, input().split())
print(calc())

Buggy submission (verdict: Runtime Error):
def calc():
    ans = r + g + b
    
    if ans%4 == 0:
        return "YES"
    
    else:
        return "NO"
 
r, g, b = list(map(int, input()))
print(calc)

Buggy submission (verdict: Runtime Error):
def calc():
    ans = r + g + b
    
    if ans%4 == 0:
        return "YES"
    
    else:
        return "NO"

r, g, b = input list(map(int, input()))
print(calc)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
2*5=10
100*100=10000
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 = input()

if s == "Sunny":
  return "Cloudy"
elif s == "Cloudy":
  return "Rainy"
elif s == "Rainy":
  return "Sunny"
Problem p02911 (python)

Fixed submission:
import collections
N,K,Q = map(int,input().split())

A=[]
for i in range(Q):
    A.append(int(input()))
    
jud = Q - K

ans_list = [0] * N

c = collections.Counter(A)
key = list(c.keys())
val = list(c.values())
for i in range(len(c)):
  ans_list[key[i]-1] = val[i]

for i in range(len(c)):
    if val[i] > jud:
        ans_list[key[i]-1] +=1
for i in range(N):
    if ans_list[i] > jud:
        print("Yes")
    else:
        print("No")

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

A=[]
for i in range(Q):
    A.append(int(input()))
    
jud = Q - K

ans_list = [0] * N

c = collections.Counter(A)
key = list(c.keys())
val = list(c.values())
for i in range(len(c)):
    ans_list[key[i]] = val[i]
#print(ans_list)

for i in range(N):
    if ans_list[i] > jud:
        print("Yes")
    else:
        print("No")

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

A=[]
for i in range(Q):
    A.append(int(input()))

ans_list = [K] * N

for i in range(Q):
    ans_list[A[i-1]] +=1

for i in range(N):
    if ans_list[i] > K+1:
        print("Yes")
    else:print("No")
Problem p02917 (python)

Fixed submission:
n=int(input())
b=[int(i) for i in input().split()]
ans=b[-1]+b[0]
for i,j in zip(b[:-1],b[1:]):
  ans+=min(i,j)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
ans=[0] * n
ans[0] = b[0]
ans[1] = b[0]
ans1 = 0

for i in range(1,n-1):
  if i == n-2:
    ans1 += b[i]
    break
  if b[i] >= max([ans[i],ans[i+1]]):
    ans += min([b[i],b[i+1]])

print(sum(ans) + ans1)
Problem p02921 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
aaa = 0
c = 1
while c < b:
    c += a
    aaa += 1
        
print(aaa)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
res = 0
c = 1
while c < b:
  c += a
  res += 1
        
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = (n * (n + 1) // 2) - n
#ans = int(a)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = (n * (n + 1) / 2) - n
ans = int(a)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = (n * (n + 1) / 2) - n
print(int(ans))
Problem p02923 (python)

Fixed submission:
n = int(input())
h = [list(map(int,input().split()))]
ans = 0
h = h[0]
max_ans = 0

for i in range(n-1):
    if h[i] >= h[i+1]:
        ans += 1
        if max_ans < ans:
            max_ans = ans
    elif h[i] < h[i+1]:
        if ans != 0:
          if max_ans < ans:
            max_ans = ans
        ans = 0
print(max_ans)

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

for i in range(n-1):
    if h[i] >= h[i+1]:
        ans += 1
        max_ans = ans
    elif h[i] <h[i+1]:
        if ans != 0:
            max_ans = ans
        ans = 0
print(max_ans)
Problem p02924 (python)

Fixed submission:
n = int(input())
print(n*(n-1)//2)

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

n = int(input())

n_list =np.arange(1,n+1)
# print(n_list)
ans = np.sum(n_list)- n_list[-1]
print(ans)