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

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
y = 0
for i in range(2 ** n):
  v_total = 0
  c_total = 0
  for j in range(n):  # このループが一番のポイント
    if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
      v_total += v[j]
      c_total += c[j]
  if (v_total-c_total) > y:
    y = v_total-c_total
print(y)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
start = time.time()
y = 0
for i in range(2 ** n):
  v_total = 0
  c_total = 0
  for j in range(n):  # このループが一番のポイント
    if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
      v_total += v[j]
      c_total += c[j]
  if (v_total-c_total) > y:
    y = v_total-c_total
print(y)
Problem p03076 (python)

Fixed submission:
import math
a = input()
b = input()
c = input()
d = input()
e = input()
l = []
if a[-1] != '0': l.append(a[-1])
if b[-1] != '0': l.append(b[-1])
if c[-1] != '0': l.append(c[-1])
if d[-1] != '0': l.append(d[-1])
if e[-1] != '0': l.append(e[-1])
if l == []:
  print(int(a)+int(b)+int(c)+int(d)+int(e))
else:
  min_l = min(l)
  p = [ a,b,c,d,e ]
  o = []
  len_p = len(p)
  tmp_p = ''
  for i in range(0, len_p):
    if p[i][-1] == min_l:
      tmp_p = int(p.pop(i))
      break
  new_p = 0
  for i in p:
    new_p += math.ceil(int(i)/10)*10
  print(new_p+tmp_p)

Buggy submission (verdict: Runtime Error):
import math
a = input()
b = input()
c = input()
d = input()
e = input()
l = []
if a[-1] != '0': l.append(a[-1])
if b[-1] != '0': l.append(b[-1])
if c[-1] != '0': l.append(c[-1])
if d[-1] != '0': l.append(d[-1])
if e[-1] != '0': l.append(e[-1])
min_l = min(l)
p = [ a,b,c,d,e ]
o = []
len_p = len(p)
tmp_p = ''
for i in range(0, len_p):
  if p[i][-1] == min_l:
    tmp_p = int(p.pop(i))
    break
new_p = 0
for i in p:
  new_p += math.ceil(int(i)/10)*10
print(new_p+tmp_p)

Buggy submission (verdict: Runtime Error):
import math
a = input()
b = input()
c = input()
d = input()
e = input()
min_l = min(l)
p = [ a,b,c,d,e ]
o = []
len_p = len(p)
tmp_p = ''
for i in range(0, len_p):
  if p[i][-1] == min_l:
    tmp_p = int(p.pop(i))
    print(i)
    break
new_p = 0
for i in p:
  new_p += math.ceil(int(i)/10)*10
print(new_p+tmp_p)
Problem p03281 (python)

Fixed submission:
n = int(input())
cnt = 0
def sympy(num):
  l = []
  for i in range(1, num+1):
    for j in range(1, num+1):
      if (i % 2 != 0) and (i*j == num):
        l.append(i)
  return l
for i in range(1, n+1):
  l = sympy(i)
  if (i % 2 != 0) and (len(l) == 8):
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import sympy
n = int(input())
cnt = 0
for i in range(1, n+1):
  l = sympy.divisors(i)
  if (i % 2 != 0) and (len(l) == 8):
    cnt += 1
print(cnt)
Problem p03455 (python)

Fixed submission:
x = input().split()
a = x[0]
b = x[1]
c = int(a) * int(b)
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = int(a) * int(b)
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
c = a * b
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')
Problem p02706 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
d = n-sum(a)
if(d<0):
  d = -1
print(d)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
d = n-sum(a)
if(a<0):
  d = -1
pritn(d)
Problem p04044 (python)

Fixed submission:
n,l = map(int,input().split())
a = list()
for i in range(n):
     a.append(input())
a.sort()
print(*a,sep="")

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main()
{   int n,l;
    cin>>n>>l;
    string str[n], temp;
    getchar();
    for(int i = 0; i < n; ++i)
    {
      getline(cin, str[i]);
    }

    for(int i = 0; i < n-1; ++i)
       for( int j = i+1; j < n; ++j)
       {
          if(str[i] > str[j])
          {
            swap(str[i],str[j]);
          }
    }


    for(int i = 0; i < n; ++i)
    {
       cout << str[i];
    }
    return 0;
}
Problem p02719 (python)

Fixed submission:
n,k = map(int, input().split())
s1 = n//k
ans = min(abs(n - k*(s1+1)),abs(n - k*(s1)))
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
 
s1 = n//k
if s1 == 0:
    s1 = k//n
    ans = min(abs(k - n*(s1-1)),abs(k - n*(s1),))
    print(ans)
else:
    ans = min(abs(n - k*(s1+1)),abs(n - k*(s1),))
    print(ans)
Problem p02705 (python)

Fixed submission:
def main():
  import math
  x = 2 * int(input()) * math.pi
  print(x)
    
main()

Buggy submission (verdict: Runtime Error):
def main():
  import math
  x = int(input()) 6.283185307179586232
  print(x)
    
main()
Problem p02727 (python)

Fixed submission:
def main():
  X, Y, A, B, C  = map(int, input().split())
  aka_list = sorted([int(t) for t in input().split()],reverse=True)[:X]
  midori_list = sorted([int(t) for t in input().split()],reverse=True)[:Y]
  mu_list = sorted([int(t) for t in input().split()],reverse=True)
  
  sum_list = sorted(aka_list + midori_list + mu_list ,reverse=True)[:X+Y]
  print(sum(sum_list))

main()

Buggy submission (verdict: Runtime Error):
スコード 

Copy
Copy
def main():
  X, Y, A, B, C  = map(int, input().split())
  aka_list = sorted([int(t) for t in input().split()],reverse=True)[:X]
  midori_list = sorted([int(t) for t in input().split()],reverse=True)[:Y]
  mu_list = sorted([int(t) for t in input().split()],reverse=True)
  
  sum_list = sorted(aka_list + midori_list + mu_list)[:X+Y]
  print(sum(sum_list))

Buggy submission (verdict: Runtime Error):
def main():
  X, Y, A, B, C  = map(int, input().split())
  aka_list = sorted([int(t) for t in input().split()],reverse=True)[:X]
  midori_list = sorted([int(t) for t in input().split()],reverse=True)[:Y]
  mu_list = sorted([int(t) for t in input().split()],reverse=True)
  
  j = 0
  sum_list = sorted(aka_list + midori_list)
  for i in range(len(sum_list)):
    if sum_list[i] < mu_list[j]:
      sum_list[i] = mu_list[j]
      j += 1
  print(sum(sum_list))
  
main()
Problem p03162 (python)

Fixed submission:
n = int(input())
abc = [list(map(int, input().split())) for _ in range(n)]
dp = [[0, 0, 0] for _ in range(n)]
for i in range(n):
  for j in range(3):
    if i == 0:
      dp[i][j] = abc[i][j]
    else:
      for k in range(3):
        if k == j:
          continue
        dp[i][j] = max(dp[i][j], dp[i-1][k] + abc[i][j])
ans = max(dp[n-1])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
abc = [list(map(int, input().split())) for _ in range(n)]
dp = [[0, 0, 0] for _ in range(n)]
for i in range(n):
  for j in range(3):
  if i == 0:
    dp[i][j] = abc[i][j]
  else:
    for k in range(3):
      if k == j:
        continue
      dp[i][j] = max(dp[i][j], dp[i-1][k] + abc[i][j])
ans = max(dp[n-1])
print(ans)
Problem p02618 (python)

Fixed submission:

dd = int(input())
c = list(list(map(int, input().split())))
s = [[0]*26]*dd
v = [[0]*26]*dd
vs = [[0]*26]*dd
ans = [0]*dd
for i in range(dd):
    s[i] = list(list(map(int, input().split())))



for i in range(26):
    for j in range(dd):
        v[j][i]=s[j][i]+c[i]*(j+1)

for i in range(dd):
    maxv = -100000
    for j in range(26):
        if maxv < v[i][j]:
            maxv = v[i][j]
            ans[i]=j+1
for a in ans:
    print(a)

Buggy submission (verdict: Runtime Error):

dd = int(input())
c = list(list(map(int, input().split())))
s = [[0]*26]*dd
v = [[0]*26]*dd
vs = [[0]*26]*dd
ans = [0]*dd
fdate = [0]*26
for i in range(dd):
    s[i] = list(list(map(int, input().split())))



for i in range(dd):

    for j in range(26):
        v[i][j] = s[i][j] + c[i] *(i-fdate[j])
    maxv = -100000
    for j in range(26):
        if maxv < v[i][j]:
            maxv = v[i][j]
            ans[i]=j+1
            fdate[j]=i+1
for a in ans:
    print(a)

Buggy submission (verdict: Runtime Error):

dd = int(input())
c = list(list(map(int, input().split())))
s = [[0]*26]*dd
v = [[0]*26]*dd
vs = [[0]*26]*dd
ans = [0]*dd
lastdate = [0]*26
for i in range(dd):
    s[i] = list(list(map(int, input().split())))



for i in range(dd):

    for j in range(dd):
        v[i][j] = s[i][j] + c[i] *(i-lastdate[j])
    maxv = -100000
    for j in range(26):
        if maxv < v[i][j]:
            maxv = v[i][j]
            ans[i]=j+1
            lastdate[j]=i+1
for a in ans:
    print(a)
Problem p02630 (python)

Fixed submission:
n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
    b[i],c[i]=map(int, input().split())

at = [0]*(10**5+100)
sum = 0

for i in a:
    at[i]= at[i]+1
    sum = sum+i


for  i in range(q):
    m= at[b[i]]
    at[b[i]]=0
    at[c[i]]=at[c[i]]+m

    sum = sum + (c[i]-b[i])*m
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
    b[i],c[i]=map(int, input().split())

at = [0]*10**5+100
sum = 0

for i in a:
    at[i]= at[i]+1
    sum = sum+i


for  i in range(q):
    m= at[b[i]]
    at[b[i]]=0
    at[c[i]]=at[c[i]]+m

    sum = sum + (c[i]-b[i])*m
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
    b[i],c[i]=map(int, input().split())

at = [0]*10**5+2
sum = 0

for i in a:
    at[i]= at[i]+1
    sum = sum+i


for  i in range(q):
    m= at[b[i]]
    at[b[i]]=0
    at[c[i]]=at[c[i]]+m

    sum = sum + (c[i]-b[i])*m
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
    b[i],c[i]=map(int, input().split())

at = [0]*10**5
sum = 0

for i in a:
    at[i]= at[i]+1
    sum = sum+i


for  i in range(q):
    m= at[b[i]]
    at[b[i]]=0
    at[c[i]]=at[c[i]]+m

    sum = sum + (c[i]-b[i])*m
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
    b[i],c[i]=map(int, input().split())

at = [0]*10**5
sum = 0

for i in a:
    at[i]= at[i]+1
    sum = sum+i


for  i in range(q):
    m= at[b[i]]
    at[b[i]]=0
    at[c[i]]=at[c[i]]+m

    sum = sum + (c[i]-b[i])*m
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
    b[i],c[i]=map(int, input().split())

at = [0]*10**5
sum = 0

for i in a:
    at[i]= at[i]+1
    sum = sum+i


for  i in range(q):
    m= at[b[i]]
    at[b[i]]=0
    at[c[i]]=at[c[i]]+m

    sum = sum + (c[i]-b[i])*m
    print(sum)
Problem p02639 (python)

Fixed submission:

x = list(map(int, input().split()))

c=0
for i in x:
    c =c+1
    if i == 0:
        ans = c


print(ans)

Buggy submission (verdict: Runtime Error):

x = list(map(int, input().split()))

c=0
for i in x:
    c =c+1
    if i == 0:
        ans = c
    else:
        ans -0

print(ans)
Problem p02641 (python)

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

d=150
pa = 0
px =range(102)
py = list(set(px) - set(p))

for i in py:

    if d> abs(i-x):
        pa = i
        d = abs(i-x)
    elif d == abs(i-x):
        if i < pa:
            pa =i



print(pa)

Buggy submission (verdict: Runtime Error):

x, n = map(int, input().split())
p = map(int, input().split())

d=150
pa = 0
px =range(1,101,1)
py = list(set(px) - set(p))

for i in py:

    if d> abs(i-x):
        pa = i
        d = abs(i-x)
    elif d == abs(i-x):
        if i < pa:
            pa =i

if n == 100
    if x<=50:
        print(0)
    else:
        print(101)

print(pa)
Problem p02645 (python)

Fixed submission:
n = str(input())
m = n[0]+n[1]+n[2]
print(m)

Buggy submission (verdict: Runtime Error):
n = str(input())
m = n[1]+n[2]+n[3]
print(m)
Problem p02658 (python)

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

x =1

if min(a) ==0:
    ans =0
else:
    order =0
    for i in a:
        order = order+len(str(i))-1

    if order >18:
        ans = -1
    else:
        ans =1
        for i in a:
                ans = ans*i
        if ans >10**18:
            ans=-1
print (ans)

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

if min(a) ==0:
    ans =0
else:
    order =0
    for i in a:
        order = order+len(str(i))-1

    if order >18:
        ans = -1
    else:
        ans =1
        a = a.sort()
        for i in a:
                ans = ans*i
        if ans >10**18:
            ans=-1
print (ans)
Problem p02813 (python)

Fixed submission:
import math
import itertools
#k,x = list(list(map(int, input().split())))
n = int(input())
a = list(list(map(int, input().split())))
b = list(list(map(int, input().split())))
ans = 0

for i in itertools.permutations(range(1,n+1,1),n):

    ans +=1
    if list(i) == a:
        ansa = ans
    if list(i) == b:
        ansb = ans


print(abs(ansa-ansb))

Buggy submission (verdict: Runtime Error):
import math
import itertools
#k,x = list(list(map(int, input().split())))
n = int(input())
a = list(list(map(int, input().split())))
b = list(list(map(int, input().split())))
ans = 0

for i in itertools.permutations(range(1,n+1,1),n):

    ans +=1
    if list(i) == a:
        ansa = ans
    elif list(i) == b:
        ansb = ans


print(abs(ansa-ansb))
Problem p03161 (python)

Fixed submission:
import sys


def input():
    return sys.stdin.readline().strip()


def main():
    size, jumps = map(int, input().split())
    array = list(map(int, input().split()))
    dp = [999999999] * size
    dp[0]= 0
    dp[1] = abs(array[0]- array[1])
    for i in range(2,size):
        dp[i] = min(abs(array[i] - array[j]) + dp[j] for j in range(max(0, i - jumps), i))
    print(dp[size-1])

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# @oj:atcoder
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-04-20 10:31
# @url:https://atcoder.jp/contests/dp/tasks/dp_b
import sys
from numba import jit
def input():
    return sys.stdin.readline().strip()

def main():
    nk=list(map(int,input().split()))
    h=list(map(int,input().split()))
    n=nk[0]
    k=nk[1]
    dp=[10**9]*n
    dp[0]=0
    dp[1]=abs(h[1]-h[0])
    for i in range(2,n):
    #     dp[i]=min(dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-k),i))
        for j in range(max(0,i-k),i):
            dp[i]=min(dp[j]+abs(h[i]-h[j]),dp[i])

    print (dp[-1])

if __name__ == "__main__":
    main()
Problem p03035 (python)

Fixed submission:
age,fee=map(int,input().split())

if age>=13:
    print(fee)
elif age<13 and age>=6:
    print(int(fee/2))
else:
    print(0)

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

if age>=13:
    print(fee)
elif age<13 and age>=6:
    print(int(fee/2))
else:
    prrint(0)
Problem p02642 (python)

Fixed submission:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a = sorted(a)

    max_a = max(a) + 1
    dp = [True] * max_a

    for idx in range(len(a)):
        if idx + 1 != len(a) and a[idx] == a[idx + 1]:
            dp[a[idx]] = False
        i = a[idx]
        x = 2
        while i * x < max_a:
            dp[i * x] = False
            x += 1

    ans = 0
    for i in a:
        if dp[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a = sorted(a)

    max_a = a[-1]
    dp = [True] * max_a

    for i in a:
        x = 1
        while i * x <= max_a:
            dp[i * x] = False
            x += 1

    ans = 0
    for i in a:
        if dp[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()
Problem p02664 (python)

Fixed submission:
s = input()

for idx in range(len(s)):
    if s[idx] == '?':
        print('D', end='')
    else:
        print(s[idx], end='')

print()

Buggy submission (verdict: Runtime Error):
s = input()

for idx in range(len(s)):
    if s[idx] == '?':
        s[idx] = 'D'

print(s)
Problem p02657 (python)

Fixed submission:
from subprocess import run

with open("./tmp215378912379.cpp", mode='w') as f:
  f.write("""
#include <bits/stdc++.h>
template <class T>
concept Integral = std::is_integral_v<T>;

int main() {
  auto f = []<Integral T>(T a, T b) { return a * b; };
  int a, b;
  std::cin >> a >> b;
  std::cout << f(a, b) << std::endl;
}
""")

run("g++ -o ./tmp215378912379 -std=gnu++2a -fconcepts ./tmp215378912379.cpp && ./tmp215378912379", shell=True)

Buggy submission (verdict: Runtime Error):
from subprocess import run
from os import path

if not path.exists("./tmp215378912379"):
  with open("./tmp215378912379.cpp", mode='w') as f:
    f.write("""
  #include <bits/stdc++.h>
  template <class T>
  concept Integral = std::is_integral_v<T>;

  int main() {
    auto f = []<Integral T>(T a, T b) { return a * b; };
    int a, b;
    std::cin >> a >> b;
    std::cout << f(a, b) << std::endl;
  }
  """)

  run("g++ -o ./tmp215378912379 -std=gnu++2a fconcepts ./tmp215378912379.cpp")

run("./tmp215378912379")
Problem p02971 (python)

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]
maxA = max(A)
secA = sorted(A)[-2]
num=A.count(maxA)
#print(N,A,maxA,secA,num)
 
for i in range(N):
  if num>1:print(maxA)
  elif A[i]==maxA:print(secA)
  else:print(maxA)

Buggy submission (verdict: Runtime Error):
A = [input() for i in range(N)]
maxA = max(A)
secA = sorted(A)[-2]
num=A.count(maxA)
#print(N,A,maxA,secA,num)

for i in range(N):
  if num>1:
    print(maxA)
  elif A[i]==maxA:
    print(secA)
  else:
    print(maxA)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
maxA = max(A)
secA = sorted(set(A))[-2]
num=A.count(maxA)
#print(N,A,maxA,secA,num)

for i in range(N):
  if num>1:
    print(maxA)
  elif A[i]==maxA:
    print(secA)
  else:
    print(maxA)
Problem p03050 (python)

Fixed submission:
N = int(input())
num = 0
for i in range(1,int(N**0.5)+1):
  m = N//i-1
  if m!=0 :
#  print(i,m)
    if (N//m) == (N % m):num += m
print(num)

Buggy submission (verdict: Runtime Error):
N = int(input())
num = 0
for i in range(1,int(N**0.5)+1):
  m = N//i-1
#  print(i,m)
  if (N//m) == (N % m):num += m
print(num)
Problem p02555 (python)

Fixed submission:
S = int(input())
from math import factorial
ans = 0


m = S // 3 #最大桁数

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under



for p in range(1,m+1):
    x = S - 3*(p) #p桁 自由度x
    """
    a = factorial(x+p-1) 
    b = factorial(p-1) 
    c = factorial(x)
    ans += ( a / b / c )%(10**9+7)
    """
    ans += cmb(x+p-1,p-1)


print(int((ans)%(10**9+7)))

Buggy submission (verdict: Runtime Error):
S = int(input())
from math import factorial
ans = 0


m = S // 3 #最大桁数

print(m)

for p in range(1,m+1):
    x = S - 3*(p) #p桁 自由度x
    a = factorial(x+p-1) 
    b = factorial(p-1) 
    c = factorial(x)
    ans += ( a / b / c )%(10**9+7)


print(int((ans)%(10**9+7)))
Problem p02641 (python)

Fixed submission:
x, n = map(int,input().split())
p = [int(s) for s in input().split()]
k= 100

for r in range (0,102):
    if (r not in p):
        if (abs(x - int(r)) < k):
            A = int(r)
            k = abs(x - int(r))
if (A > x):
    if (2*x-A not in p):
        A = 2*x-A

print (A)

Buggy submission (verdict: Runtime Error):
x, n = map(int,input().split())
p = [int(s) for s in input().split()]
k= 100

for r in range (1,101):
    if (r not in p):
        if (abs(x - int(r)) < k):
            A = int(r)
            k = abs(x - int(r))
if (A > x):
    if (2*x-A not in p):
        A = 2*x-A

print (A)
Problem p02646 (python)

Fixed submission:
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if (V <= W):
    print("NO")
elif(T < abs(A - B)/(V-W)):
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
A, V = map(int,input(),split())
B, W = map(int,input(),split())
T = input()
if (V <= W):
    print("NO")
elif(T < abs(A - B)/(V-W)):
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
time = 0
timeyosou = abs(B-A)/(V-W)

if (V <= W):
    if (A < B):
        time = (10**9-A)/V
    else:
        time = (10**9+A)/V
else:
    if (A < B):
        if ((10**9 - B)/W > timeyosou):
           time = timeyosou
        else:
            time = (10**9 - A)/V
    if (A > B):
        if ((10**9 + B)/W > timeyosou):
           time = timeyosou
        else:
            time = (10**9 + A)/V
if (T > time):
    print ("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = input()
time = 0
timeyosou = abs(B-A)/(V-W)

if (V <= W):
    if (A < B):
        time = (10**9-A)/V
    else:
        time = (10**9+A)/V
else:
   if (A < B):
       if ((10**9 - B)/W > timeyosou):
           time = timeyosou
        else:
            time = (10**9 - A)/V
    if (A > B):
        if ((10**9 + B)/W > timeyosou):
           time = timeyosou
        else:
            time = (10**9 + A)/V
Problem p02600 (python)

Fixed submission:
x=int(input())

if 400<=x and x<=599:
    print(8)
elif 600<=x and x<=799:
    print(7)
elif 800<=x and x<=999:
    print(6)
elif 1000<=x and x<=1199:
    print(5)
elif 1200<=x and x<=1399:
    print(4)
elif 1400<=x and x<=1599:
    print(3)
elif 1600<=x and x<=1799:
    print(2)
elif 1800<=x and x<=1999:
    print(1)

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

for i in range(n):
    if a[0]<a[i]:
        up=True
        nin=a[0]
        break
    elif a[0]>a[i]:
        up=False
        break
    if i==n-1:
        print(1000)
        exit()

total=1000

for i in range(1,n-1):
    if up:
        if a[i-1]<=a[i] and a[i]>a[i+1]:
            total+=(total//nin)*(a[i]-nin)
            up=False
    else:
        if a[i-1]>=a[i] and a[i]<a[i+1]:
            nin=a[i]
            up=True
if nin<a[n-1]:
    total+=(total//nin)*(a[n-1]-nin)
print(total)

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

if 400<=x and x<=599:
    print(8)
elif:
    600<=x and x<=799:
    print(7)
elif:
    800<=x and x<=999:
    print(6)
elif:
    1000<=x and x<=1199:
    print(5)
elif:
    1200<=x and x<=1399:
    print(4)
elif:
    1400<=x and x<=1599:
    print(3)
elif:
    1600<=x and x<=1799:
    print(2)
elif:
    1800<=x and x<=1999:
    print(1)
Problem p02602 (python)

Fixed submission:
n,k=map(int,input().split())
A=list(map(int,input().split()))
ave=[0 for i in range(n-k+1)]


for i in range(n-k):
    if A[i+k]>A[i]:
        print('Yes')
    else:
        print('No')

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

for i in range(n):
    if a[0]<a[i]:
        up=True
        nin=a[0]
        break
    elif a[0]>a[i]:
        up=False
        break
    if i==n-1:
        print(1000)
        exit()

total=1000

for i in range(1,n-1):
    if up:
        if a[i-1]<=a[i] and a[i]>a[i+1]:
            total+=(total//nin)*(a[i]-nin)
            up=False
    else:
        if a[i-1]>=a[i] and a[i]<a[i+1]:
            nin=a[i]
            up=True
if nin<a[n-1]:
    total+=(total//nin)*(a[n-1]-nin)
print(total)