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

Fixed submission:
n, k = map(int, input().split())
print(sum(sorted(list(map(int, input().split())))[:k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = sorted(list(map(int, ipupt().split())))
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
print(sum(sorted(list(map(int, ipupt().split())))[:k]))
Problem p02690 (python)

Fixed submission:
x = int(input())
for a in range(-118, 120):
    for b in range(-118, 120):
        if a**5 - b**5 == x:
            A = a
            B = b
print(A, B)

Buggy submission (verdict: Runtime Error):
def f(x):
    for a in range(-100, 101):
        for b in range(-100, 101):
            if a ** 5 - b ** 5 == x:
                A = [a, b]
                return A
B = f(int(input()))
print(B[0], B[1])

Buggy submission (verdict: Runtime Error):
def f(x):
    for a in range(-100, 101):
        for b in range(-100, 101):
            if a ** 5 - b ** 5 == x:
                A = [a, b]
                return A
A = f(int(input()))
print(A[0], A[1])
Problem p02717 (python)

Fixed submission:
x, y, z = map(int, input().split())
print(z, x, y)

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input())
print(z, x, y)
Problem p02732 (python)

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in set(a):
    s += c[i] * (c[i] - 1)
for i in a:
    print(int((s - (c[i] * (c[i] - 1)) + ((c[i] - 1) * (c[i] - 2))) / 2))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
s = 0
for i in set(a):
    s += c[i] * (c[i] - 1)
dp = [-1] * n
for i in a:
    if dp[i] == -1:
        dp[i] = (s - c[i] * (c[i] - 1) + (c[i] - 1) * (c[i] - 2)) // 2
        print(dp[i])
    else:
        print(dp[i])
Problem p02742 (python)

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

if h == 1 or w == 1:
    c = 1
elif h & 1:
    if w & 1:
        c = ((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2)
    else:
        c = (((h + 1) // 2) + (h // 2)) * (w // 2)
else:
    c = (h // 2) * w

print(c)

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

if h == 1 or w == 1:
    c == 1
elif h & 1:
    if w & 1:
        c = ((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2)
    else:
        c = (((h + 1) // 2) + (h // 2)) * (w // 2)
else:
    c = (h // 2) * w

print(c)
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split( )))
c = 1
m = p[0]
for a in p[1:]:
    m = min(m, a)
    if m == a:
        c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split( )))
c =0
m = p[0]
for i in range(n):
    if m => p[i]:
        c += 1
        m = p[i]
print(c)
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())
l = [False] * n
c = [0] * n
ans = [0, 0]
for i in range(m):
  p, r = map(str, input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[int(p) - 1] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      ans[0] += c[int(p) - 1]
      ans[1] += 1
print(ans[1], ans[0])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = [False] * n
c = [0, 0]
for i in range(k):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(k):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(n):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(n):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] == True
      c[1] += 1
print(c[1], c[0])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split( ))
wa = [0] * (n + 1)
acsum = 0
wasum = 0
for i in range(m):
    no_s, res = map(str, input().split( ))
    no = int(no_s)
    if wa[no] != -1 and res == "AC":
      	acsum += 1
        wasum += wa[no]
        wa[no] = -1
    elif wa[no] != -1 and res == "WA":
        wa[no] += 1
print(str(acsum) + " " + str(wasum))
Problem p02882 (python)

Fixed submission:
from math import pi, sin, cos, tan
EPS = 0.0000000001

def f(a, b, theta):
    if theta > pi * 0.5 - EPS:
        ret = 0.0
    elif a * tan(theta) <= b:
        ret = a**2 * b - a**3 * tan(theta) * 0.5
    else:
        ret = a * b**2 * 0.5 / tan(theta)

    return ret

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

ok = pi * 0.5
ng = 0.0
while ok - ng >= EPS:
    mid = (ok + ng) * 0.5
    if f(a, b, mid) < x:
        ok = mid
    else:
        ng = mid
print("{:.10f}".format(ok / pi * 180))

Buggy submission (verdict: Runtime Error):
from math import pi, tan
EPS = 0.0000000001

def f(a, b, theta):
    if theta >= pi * 0.5:
        return 0.0
    elif tan(theta) >= b / a:
        return a * b**2 * 0.5 / tan(theta)
    else:
        return a**2 * b - a**2 *b * 0.5 * tan(theta)

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

l = 0
r = pi * 0.5
while r - l >= EPS:
    mid = (l + r) * 0.5
    if f(a, b, theta) >= x:
        l = mid
    else:
        r = mid

print("{:.10f}".format(l / pi * 180))
Problem p02995 (python)

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

a, b, c, d = map(int, input().split())
ans = b - a + 1
ans -= b // c - (a - 1) // c
ans -= b // d - (a - 1) // d
ans += b // lcm(c, d) - (a - 1) // lcm(c, d)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
ans = b - a + 1
ans -= b // c - (a - 1) // c
ans -= b // d - (a - 1) // d
ans += b // (c * d) - (a - 1) // lcm(c, d)
print(ans)
Problem p03048 (python)

Fixed submission:
R, G, B, N = map(int, input().split())
ans = 0

for r in range(min(3000, 3000 // R) + 1):
    if R * r <= N:
        for g in range(min(3000, 3000 // G) + 1):
            v = R * r + G * g
            if N >= v and (N - v) % B == 0:
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
#include <stdio.h>

int main(){
  int R, G, B, N, ans = 0;
  scanf("%d %d %d %d", &R, &G, &B, &N);
  for(int i = 0; i <= 3000; i++){
    for(int j = 0; j <= 3000; j++){
      int v = R * i + G * j;
      if(N >= v && (N - v) % B == 0) ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
Problem p03260 (python)

Fixed submission:
a, b = map(int, input().split())
if a & 1 and b & 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())]
if a & 1 and b & 1:
    print("Yes")
else:
    print("No")
Problem p03455 (python)

Fixed submission:
ab = input().rstrip().split(" ")
a = int(ab[0])
b = int(ab[1])
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
ab = input().rstrip().split(" ")
a = ab[0]
b = ab[1]
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03574 (python)

Fixed submission:
h, w = map(int, input().split())
field = [["" for _ in range(w)] for _ in range(h)]
for i in range(h):
    s = input()
    for j in range(w):
        field[i][j] = s[j]

dx = [1, 1, 0, -1, -1, -1, 0, 1]
dy = [0, 1, 1, 1, 0, -1, -1, -1]

def numbering(x, y):
    if field[y][x] == ".":
        c = 0
        for i in range(8):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < w and 0 <= ny and ny < h:
                if field[ny][nx] == "#":
                    c += 1
        field[y][x] = str(c)

for X in range(w):
    for Y in range(h):
        numbering(X, Y)

for Y in range(h):
    for X in range(w):
        print(field[Y][X], end = "")
    print()

Buggy submission (verdict: Runtime Error):
3 5
#####
#####
#####h, w = map(int, input().split())
field = [["" for _ in range(w)] for _ in range(h)]
for i in range(h):
    s = input()
    for j in range(w):
        field[i][j] = s[j]

dx = [1, 1, 0, -1, -1, -1, 0, 1]
dy = [0, 1, 1, 1, 0, -1, -1, -1]

def numbering(x, y):
    if field[y][x] == ".":
        c = 0
        for i in range(8):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < w and 0 <= ny and ny < h:
                if field[ny][nx] == "#":
                    c += 1
        field[y][x] = str(c)

for X in range(w):
    for Y in range(h):
        numbering(X, Y)

for Y in range(h):
    for X in range(w):
        print(field[Y][X], end = "")
    print()
Problem p03624 (python)

Fixed submission:
s = input()
l = list({s[i] for i in range(len(s))})
a = [False] * 26
for c in l:
    a[ord(c) - ord("a")] = True
ans = "None"
for i in range(len(a)):
    if a[i] == False:
        ans = chr(ord("a") + i)
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
l = sorted(list({s[i] for i in range(len(s))}))
if len(l) == 26:
    ans = "None"
else:
    for i in range(len(l) - 1):
        if ord(l[i]) + 1 != ord(l[i + 1]):
            ans = chr(ord(l[i]) + 1)
            break
print(ans)
Problem p03633 (python)

Fixed submission:
import fractions

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

n = int(input())
i = 1
for _ in range(n):
    i = lcm(i, int(input()))
print(i)

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

n = int(input())
i = 1
for _ in range(n):
    i = int(lcm(i, int(input())))
print(i)
Problem p03796 (python)

Fixed submission:
p = 1
for i in range(int(input())):
    p = ((i + 1)*p) % (10**9 + 7)
print(p)

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

int main(){
  long int n, i = 1;
  cin >> n;
  for(long int j = 1; j <= n; j++){
    i *= j;
    i %= MOD;
  }
  cout << i << endl;
  return 0;
}
Problem p02618 (python)

Fixed submission:
# coding: utf-8
# Your code here!
import numpy as np
d= int(input())

C = list(map(int,input().split()))
CB = [0 for i in range(len(C))]

c = sum(C)

total = 0

#print(c,C,CB)
L = []

for i in range(d):
    L.append(list(map(int,input().split())))

#print(L)


#print(T)

def cnt(CB,t):
    for i in range(len(CB)):
        if i != t:
            CB[i] += 1
        else:
            CB[i] = 0
    
    return CB

def sumA(C,CB):
    a = 0
    for i in range(len(CB)):
        a += CB[i]*C[i]
    return a

for i in range(d):
    ind = np.argmax(L[i])
    CB = cnt(CB,ind)
    total += L[i][ind] - sumA(C,CB)
    print(ind+1)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

d= int(input())

C = list(map(int,input().split()))
CB = [0 for i in range(len(C))]

c = sum(C)

total = 0

#print(c,C,CB)
L = []

for i in range(d):
    L.append(list(map(int,input().split())))

#print(L)

T = []

for i in range(d):
    T.append(int(input()))

#print(T)

def cnt(CB,t):
    for i in range(len(CB)):
        if i != t-1:
            CB[i] += 1
        else:
            CB[i] = 0
    
    return CB

def sumA(C,CB):
    a = 0
    for i in range(len(CB)):
        a += CB[i]*C[i]
    return a

for i in range(len(T)):
    CB = cnt(CB,T[i])
    total += L[i][T[i]-1] - sumA(C,CB)
    print(total)
Problem p02641 (python)

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

L = list(range(0,102))
if y != 0:
    L2 = list(map(int,input().split()))
    
    #print(L)
    for i in range(len(L2)):
        L.remove(L2[i])
        
#print(L)
#L = sorted(L)

#print(L)

t = len(L)//2

for j in range(len(L)):
#    print(t,L[t])
    if L[t] >= x:
#        print("L[t] >= x")
        if t == 0:
            print(L[t])
            break
        elif L[t-1] <= x:
            if abs(L[t]-x) < abs(L[t-1]-x):
                print(L[t])
                break
            else:
                print(L[t-1])
                break
        
        t = t//2
    else:
        if t == y-1:
            print(L[t])
            break
        elif L[t+1] >= x:
            if abs(L[t]-x) > abs(L[t+1]-x):
                print(L[t+1])
                break
            else:
                print(L[t])
                break
        t = t + (len(L)-t)//2

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

L = list(range(1,101))
if y != 0:
    L2 = list(map(int,input().split()))
    
    #print(L)
    for i in range(len(L2)):
        L.remove(L2[i])
        
#print(L)
#L = sorted(L)

#print(L)

t = len(L)//2

for j in range(len(L)):
#    print(t,L[t])
    if L[t] >= x:
#        print("L[t] >= x")
        if t == 0:
            print(L[t])
            break
        elif L[t-1] <= x:
            if abs(L[t]-x) < abs(L[t-1]-x):
                print(L[t])
                break
            else:
                print(L[t-1])
                break
        
        t = t//2
    else:
        if t == y-1:
            print(L[t])
            break
        elif L[t+1] >= x:
            if abs(L[t]-x) > abs(L[t+1]-x):
                print(L[t+1])
                break
            else:
                print(L[t])
                break
        t = t + (len(L)-t)//2
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a-2b>0:
  print(a-2b)
else:
  print("0")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>2*b:
  print(a-2b)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>2*B:
  print(A-2B)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>2*B:
  print(A-2B)
else:
  print(0)
Problem p02576 (python)

Fixed submission:
n,x,t=map(int,input().split())
if n%x==0:
    print(int(n/x*t))
else:
    print(int(n//x+1)*t)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,inout().split())
ans=0
while 1:
    if b>0:
        a-=b
        ans+=1
    else:
        break
print(ans*c)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
r=int(n**0.5)+1
for i in range(2,r):
    if n%i==0:
        ans+=1
        n/=i
if ans==0 and not n==0:
    ans=1
print(ans)
Problem p02658 (python)

Fixed submission:
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
    ans=-1
    break
if 0 in lis:
    ans=0
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
    ans=-1
    break
else:
    print(ans)
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m=map(int,input().split())
H=((h%12)*30)+0.5*m
M=(m*6)
x=abs(H-M)
y=360-x
l=[x,y]
l.sort()
sita=l[0]
sita=math.radians(sita)
c=a**2+b**2-2*(a*b*math.cos(sita))
c=math.sqrt(c)
print(c)

Buggy submission (verdict: Runtime Error):
import math
a,b,h,m=map(float,input().split())
H=((h%12)*30)
M=(m*6)
x=abs(H-M)
y=360-x
l=[x,y]
l.sort()
sita=l[0]
sita=math.radians(sita)
c=a**2+b**2-2(*a*b*math.cos(sita))
c=math.sqrt(c)
print(c)
Problem p02706 (python)

Fixed submission:
N,M=map(int,input().split())
lis=list(map(int, input().split()))
s=0
for i in lis:
    s+=i
if N-s<0:
    print("-1")
else:
    print(N-s)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split)
lis=list(map(int, input().split()))
s=0
for i in lis:
    s+=i
if N-s<0:
    print("-1")
else:
    print(N-s)
Problem p02755 (python)

Fixed submission:
a,b=map(int,input().split())
i=1
while 1:
    if int(i*0.08)==a:
        if int(i*0.1)==b:
            print(i)
            break
    else:
        if int(i*0.08)>a:
            print(-1)
            break
    i+=1

Buggy submission (verdict: Runtime Error):
19 99
Problem p02761 (python)

Fixed submission:

n,m=map(int,input().split())
l=["0"]*n
l[0]="1"
l[-1]="0"
f=[0]*n
frag=0
for i in range(m):
    s,c=map(int,input().split())
    if f[s-1]==0 or l[s-1]==str(c):
        l[s-1]=str(c)
        f[s-1]=1
    else:
        frag=1
        break
if frag==1 or (l[0]=="0" and n!=1):
    print(-1)
else:
    for j in l:
        print(j,end="")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=["0"]*n
n,m=map(int,input().split())
l=["0"]*n
f=[0]*n
frag=0
for i in range(m):
    s,c=map(int,input().split())
    if f[s-1]==0 or l[s-1]==str(c):
        l[s-1]=str(c)
        f[s-1]=1
    else:
        frag=1
        break
if frag==1 or (l[0]=="0" and n!=1):
    print(-1)
else:
    for j in l:
        
        print(j,end="")
Problem p02783 (python)

Fixed submission:
import math
n,m=map(int,input().split())
print(math.ceil(n/m))

Buggy submission (verdict: Runtime Error):
n.m=map(int,input().split())
print(round(n/m))
Problem p02784 (python)

Fixed submission:
n,m=map(int,input().split())
l=list(map(int,input().split()))
d=sum(l)
if n>d:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))
d=sum(l)
if n>l:
    print("No")
else:
    print("Yes")
Problem p02811 (python)

Fixed submission:
n,m=map(int,input().split())
if 500*n >= m:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n.m=map(int,input().split())
if 500*n>=m:
    print("Yes")
else:
    print("No")
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
tako=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(1,n+1):
        ans+=tako[i]*tako[j]
print(ans)
Problem p02886 (python)

Fixed submission:
n=int(input())
tako=list(map(int,input().split()))
ans=0
for i in range(n-1):
    for j in range(1,n):
        if not j<=i:
            
          
            ans+=tako[i]*tako[j]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input)
tako=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(1,n+1):
        ans+=tako[i]*tako[j]
print(ans)
Problem p02887 (python)

Fixed submission:
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==t[i]:
        pass
    else:
        ans=ans+t[i]
print(len(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==i:
        pass
    else:
        ans=ans+i
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==i:
        pass
    else:
        ans=ans+i
print(len(ans))
Problem p02923 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
for i in range(n-1):
        if h[i+1]<=h[i]:
            kari+=1
        else:
            if ans<kari:
                ans=kari
            kari=0
        
       
print(max(ans,kari))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
inde=0
if n==1:
    print(0)
else:
    while 1:
        suuzi=h[inde]
        if h[inde+1]<=suuzi:
            kari+=1
        elif ans<kari:
            ans=kari
            kari=0
        inde+=1
        if inde==n-1:
            if ans<kari:
            ans=kari

            break
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
inde=0
while 1:
    suuzi=h[inde]
    if h[inde+1]<=suuzi:
        kari+=1
    elif ans<kari:
        ans=kari
        kari=0
    inde+=1
    if inde==n-1:
        if ans<kari:
          ans=kari

        break
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
inde=0
while 1:
    suuzi=h[inde]
    if h[inde+1]<=suuzi:
        kari+=1
    elif ans<kari:
        ans=-kari
        kari=0
    if inde==n-1:
        break
    inde+=1
print(ans)
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(max(c,d,e))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(sum(c,d,e))
Problem p02952 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
    if not len(str(i))%2==0:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(1,n+1):
    if not len(i)%2==0:
        ans+=1
print(ans)
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2==b%2:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
if a%2==b%2:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")
Problem p02958 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
lis=sorted(l)

ans=0
for i ,j in zip(l,lis):
   
    if i!=j:
        ans+=1
if ans<=2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input.split()))
lis=l.sorted()
lis.reverse()
ans=0
for i ,j in zip(l,lis):
    if i!=j:
        ans+=1
if ans==2:
    print("YES")
else:
    print("NO")
Problem p02971 (python)

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]
ma=sorted(l)[-2:]
for j in l:
    if j==ma[1]:
        print(ma[0])
    else:
        print(ma[1])

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
for j in range(n):
    l2=l
    l2[i]=0
    print(max(l2))
Problem p02982 (python)

Fixed submission:
import math
n,d=map(int,input().split())
za=[list(map(int,input().split())) for i in range(n)]
ans=0
lon=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            lon+=(za[i][k]-za[j][k])**2
        else:
            lon=math.sqrt(lon)
            if lon==int(lon):
                ans+=1
            lon=0
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,d=map(int,input().split())
za=[list(map(int,input().split())) for i in range(n)]
ans=0
lon=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            lon+=(za[i][d]-za[j][d])**2
            lon=math.sqrt(lon)
        else:
            if lon==int(lon):
                ans+=1
            lon=0
print(ans)
Problem p02988 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-1):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)
Problem p03219 (python)

Fixed submission:
x,y=map(int,input().split())
print(int(x+y/2))

Buggy submission (verdict: Runtime Error):
x,y=map(int,input.split())
print(x+y/2)
Problem p03264 (python)

Fixed submission:
n=int(input())
if n%2==1:
    print((n//2)*(n//2+1))
else:
    print((n//2)**2)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
    print((n//2)*(n//2+1)
else:
    print((n//2)**2)