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

Fixed submission:
import fractions
from functools import reduce

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

m1 = [0] * (N + 1)
m2 = [0] * (N + 1)
for i in range(1, N + 1):
  m1[i] = fractions.gcd(m1[i - 1], a_list[i - 1])
  m2[N - i] = fractions.gcd(m2[N - i + 1], a_list[N - i])

m = [0] * N
for i in range(N):
  m[i] = fractions.gcd(m1[i], m2[i + 1])

print(max(m))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce

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

m1 = [0] * (N + 1)
m2 = [0] * (N + 1)
for i in range(1, N + 1):
  m1[i] = fractions.gcd(m1[i - 1], a_list[i - 1])
  m2[n - i] = fractions.gcd(m2[n - i + 1], a_list[n - i])

m = [0] * N
for i in range(N):
  m[i] = fractions.gcd(m1[i], m2[i + 1])

print(max(m))

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
import copy
import math
from functools import reduce

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

gcd_list =[]

for i, a in enumerate(A):
    A_except_a = copy.deepcopy(A)
    A_except_a.pop(i)
    
    gcd = reduce(math.gcd, A_except_a)
    gcd_list.append(gcd)

print(max(gcd_list))

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N = int(input())
A = list(map(int, input().split()))

import copy
import math
from functools import reduce

gcd_list =[]

for i, a in enumerate(A):
    A_except_a = copy.deepcopy(A)
    A_except_a.pop(i)
    
    gcd = reduce(math.gcd, A_except_a)
    gcd_list.append(gcd)

print(max(gcd_list))
Problem p03076 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

result = 0

hasuu = [item % 10 for item in [A, B, C, D, E] if item % 10 != 0]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
if hasuu != []:
  result = int(result - 10 + min(hasuu))

print(result)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

result = 0

hasuu = [item % 10 for item in [A, B, C, D, E] if item % 10 != 0]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
result = int(result - 10 + min(hasuu))
print(result)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

hasuu = [item % 10 if item % 10 != 0 
         for item in [A, B, C, D, E]]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
result = int(result - 10 + min(hasuu))
print(result)
Problem p03078 (python)

Fixed submission:
X, Y, Z, K = map(int, input().split())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

A_list.sort(reverse=True)
B_list.sort(reverse=True)
C_list.sort(reverse=True)

F_list = []
for i in range(1, X+1):
  if i > K:
    break
  for j in range(1, Y+1):
    if i*j > K:
      break
    for k in range(1, Z+1):
      if i*j*k > K:
        break
      F_list.append(A_list[i-1]+B_list[j-1]+C_list[k-1])

F_list.sort(reverse=True)

for i in range(K):
  print(F_list[i])

Buggy submission (verdict: Runtime Error):
X, Y, Z, K = map(int, input().split())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

A_list.sort(reverse=True)
B_list.sort(reverse=True)
C_list.sort(reverse=True)

F_list = []
for i in range(1, X+1):
  if i > K:
    break
  for j in range(1, Y+1):
    if i*j > K:
      break
    for k in range(1, Z+1):
      if i*j*k > K:
        break
      F_list.append(A_list[i]+B_list[j]+C_list[k])

F_list.sort(reverse=True)

for i in range(K):
  print(F_list[i])
Problem p03086 (python)

Fixed submission:
S = input()

candidates = []

tmp = []

for char in S:
    if char in ["A", "T", "G", "C"]:
        tmp.append(char)
    else:
        candidates.append(tmp)
        tmp = []

if tmp != []:
    candidates.append(tmp)

sorted_candidates = sorted(candidates, reverse=True, key=lambda x: len(x))
print(len(sorted_candidates[0]))

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

candidates = []

tmp = []

for char in S:
    if char in ["A", "T", "G", "C"]:
        tmp.append(char)
    else:
        candidates.append(tmp)
        tmp = []
        
sorted_candidates = sorted(candidates, reverse=True, key=lambda x: len(x))
print(len(sorted_candidates[0]))
Problem p03111 (python)

Fixed submission:
N, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
  if cur == N:
    return abs(a-A) + abs(b-B) + abs(c-C) - 30 if min(a, b, c) > 0 else INF
  
  # 使わない場合
  ret0 = dfs(cur + 1, a, b, c)
  # A に使う場合
  ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
  # B に使う場合
  ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
  # C に使う場合
  ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
  
  return min(ret0, ret1, ret2, ret3)
  
print(dfs(0, 0, 0, 0))

Buggy submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
  if cur == N:
    return abs(a-A) + abs(b-B) + abs(c-C) - 30 if min(a, b, c) > 0 else INF
  
  # 使わない場合
  ret0 = dfs(cur + 1, A, B, C)
  # A に使う場合
  ret1 = dfs(cur + 1, A + l[cur], B, C) + 10
  # B に使う場合
  ret2 = dfs(cur + 1, A, B + l[cur], C) + 10
  # C に使う場合
  ret3 = dfs(cur + 1, A, B, C + l[cur]) + 10
  
  return min(ret0, ret1, ret2, ret3)
  
print(defs(0, 0, 0, 0))
Problem p03125 (python)

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

if B % A == 0:
  print(A+B)
else:
  print(B-A)

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

if B % A == 0:
  print(A+B)
else:
  print(B-A)
Problem p03289 (python)

Fixed submission:
S = list(input())

ans = "AC"
tmp = S[2:-1]

if S[0] != "A":
  ans = "WA"
else:
  S.remove("A")
  
count = 0
for item in tmp:
  if item == "C":
    count += 1
    
if count != 1:
  ans = "WA"
elif count == 1:
  S.remove("C")


if "".join(S).lower() != "".join(S):
  ans = "WA"

print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())

ans = "AC"

if S[0] != "A":
  ans = "WA"
  
count = 0
for item in S[2:-2]:
  if item == "C":
    count += 1
    
if count != 1:
  ans = "WA"
  
S.remove("A")
S.remove("C")

if "".join(S).lower() != "".join(S):
  ans = "WA"

print(ans)
Problem p03450 (python)

Fixed submission:
import sys
sys.setrecursionlimit(300000)

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

nl = [[] for _ in range(N + 1)]
for _ in range(M):
    L, R, D = map(int, input().split())
    nl[L].append((R, D))
    nl[R].append((L, -D))

# print(nl)
    
seen = [None for _ in range(N + 1)]

def dfs(v, d):
    # print("dfs ", v, d)
    seen[v] = d
    for next_v, D in nl[v]:
        next_d = d + D
        if seen[next_v] is None:
            dfs(next_v, next_d)
        else:
            if seen[next_v] != next_d:
                print('No')
                exit(0)
                
for v in range(1, N + 1):  # すべての連結成分に対してDFS
    if seen[v] is None:
        dfs(v, 0)

print('Yes')

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

nl = [[] for _ in range(N + 1)]
for _ in range(M):
    L, R, D = map(int, input().split())
    nl[L].append((R, D))
    nl[R].append((L, -D))

# print(nl)
    
seen = [None for _ in range(N + 1)]

def dfs(v, d):
    # print("dfs ", v, d)
    seen[v] = d
    for next_v, D in nl[v]:
        next_d = d + D
        if seen[next_v] is None:
            dfs(next_v, next_d)
        else:
            if seen[next_v] != next_d:
                print('No')
                exit(0)
                
for v in range(1, N + 1):  # すべての連結成分に対してDFS
    if seen[v] is None:
        dfs(v, 0)

print('Yes')

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

nl = [[] for _ in range(N + 1)]
for _ in range(M):
    L, R, D = map(int, input().split())
    nl[L].append((R, D))
    nl[R].append((L, -D))

# print(nl)
    
seen = [None for _ in range(N + 1)]

def dfs(v, d):
    # print("dfs ", v, d)
    seen[v] = d
    for next_v, D in nl[v]:
        next_d = d + D
        if seen[next_v] is None:
            dfs(next_v, next_d)
        else:
            if seen[next_v] != next_d:
                print('No')
                exit(0)
                
for v in range(1, N + 1):  # すべての連結成分に対してDFS
    if seen[v] is None:
        dfs(v, 0)

print('Yes')
Problem p03469 (python)

Fixed submission:
S = input()
S = "2018/01/" + S.split("2017/01/")[-1]
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
S[3] = 8
print(S)
Problem p03472 (python)

Fixed submission:
N, H = map(int, input().split())
a_list = []
b_list = []
for _ in range(N):
  a, b = map(int, input().split())
  a_list.append(a)
  b_list.append(b)
  
b_list = sorted(b_list)

count = 0
a_max = max(a_list)

while H > 0 and b_list:
  b = b_list.pop()
  if b > a_max:
    H -= b
    count += 1
  else:
    break
    
if H > 0:
  if H % a_max == 0:
    count += H // a_max
  else:
    count += H // a_max + 1
    
print(count)

Buggy submission (verdict: Runtime Error):
N, H = map(int, input().split())
a_list = []
b_list = []
for _ in range(N):
  a, b = map(int, input().split())
  a_list.append(a)
  b_list.append(b)
  
b_list = sorted(b_list)

count = 0
a_max = max(a_list)

while H > 0:
  b = b_list.pop()
  if b > a_max:
    H -= b
    count += 1
  else:
    break
    
if H > 0:
  if H % a_max == 0:
    count += H // a_max
  else:
    count += H // a_max + 1
    
print(count)
Problem p03477 (python)

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

l = A + B
r = C + D

if l > r:
  print("Left")
elif l == r:
  print("Balanced")
elif l < r:
  print("Right")

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().aplit())

l = A + B
r = C + D

if l > r:
  print("Left")
elif l == r:
  print("Balanced")
elif l < r:
  print("Right")
Problem p03478 (python)

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

count = 0

for i in range(1, N+1):
  str_i = str(i)
  tmp = 0
  for j in range(len(str_i)):
    tmp += int(str_i[j])
  if A <= tmp <= B:
    count += i
    
print(count)

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

count = 0

for i in range(1, N+1):
  tmp = sum(list(str(i)))
  if A <= tmp <= B:
    count += 1
    
print(count)
Problem p03487 (python)

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

ans = 0
count = [0] * (10 ** 5 + 1)

for i in range(N):
  if a[i] <= 10 ** 5:
    count[a[i]] += 1
    ans += 1
    if count[a[i]] == a[i]:
      ans -= a[i]
  else:
    ans += 1

print(ans)

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

ans = 0
count = [0] * (10 ** 5)

for i in range(N):
  count[a[i]] += 1
  ans += 1
  if count[a[i]] == a[i]:
    ans -= a[i]

print(ans)
Problem p03565 (python)

Fixed submission:
S_dash = input()
T = input()

len_S = len(S_dash)
len_T = len(T)

candidate = []

# まず T と一致させられる位置があるかを調べる
for i in range(len_S - len_T + 1):
  # print(S_dash[i:i+len_T])
  tmp = S_dash[i:i+len_T]
  
  count = 0
  for s, t in zip(tmp, T):
    if s == t or s == '?':
      count += 1
  if count == len_T:
    candidate.append(S_dash[:i] + T + S_dash[i+len_T:])
    
if candidate != []:       
  replaced_candidate = [item.replace("?", "a") for item in candidate]
  replaced_candidate.sort()
  print(replaced_candidate[0])
else:
  print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
S_dash = input()
T = input()

len_S = len(S_dash)
len_T = len(T)

answer = "UNRESTORABLE"
candidate = []

# まず T と一致させられる位置があるかを調べる
for i in range(len_S - len_T + 1):
  # print(S_dash[i:i+len_T])
  tmp = S_dash[i:i+len_T]
  
  count = 0
  for s, t in zip(tmp, T):
    if s == t or s == '?':
      count += 1
  if count == len_T:
    candidate.append(S_dash[:i] + T + S_dash[i+len_T:])
    
replaced_candidate = [item.replace("?", "a") for item in candidate]
replaced_candidate.sort()
print(replaced_candidate[0])
Problem p03569 (python)

Fixed submission:
S = input()
cnt = 0
l = 0
r = len(S)-1
while(l<r):
    if(S[l]==S[r]):
        l+=1
        r-=1
    elif(S[l]=='x'):
        cnt += 1
        l+=1
    elif(S[r]=='x'):
        cnt += 1
        r-=1
    else:
        print(-1)
        break
else:
    print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
num_x = s.count('x')
s_remove_x = s.replace('x', '', num_x)

if len(s) % 2 == 1:
  if s[(len(s) + 1) // 2] == 'x':
    ans = num_x - 1
else:
  ans = num_x

# s から x を除いたものが回文になっているか判定
half_len = len(s_remove_x) // 2
for i in range(half_len):
  if s_remove_x[i] != s_remove_x[len(s_remove_x)-1-i]:
    ans = -1

print(ans)
Problem p03645 (python)

Fixed submission:
n, m = map(int, input().split())
sa = set()
sb = set()
for _ in range(m):
    a, b = map(int, input().split())
    if a == 1:
        sb.add(b)
    if b == n:
        sa.add(a)

print('POSSIBLE' if len(sa&sb) != 0 else 'IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ab_list = sorted([list(map(int, input().split())) for _ in range(M)])

ans = "IMPOSSIBLE"
second_island = []

for a, b in ab_list:
  if a == 1:
    second_island.append(b)

  if b == N:
	if a in second_island:
      ans = "POSSIBLE"
      break

print(ans)
Problem p03721 (python)

Fixed submission:
N, K = map(int, input().split())
ab_list = sorted([list(map(int, input().split())) for _ in range(N)])

for a, b in ab_list:
  if b >= K:
    print(a)
    exit()
  else:
    K -= b

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
ab_list = sorted([map(int, input().split()) for _ in range(N)])

for a, b in ab_list:
  if b >= K:
    print(a)
    exit()
  else:
    K -= b
Problem p02898 (python)

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    ans += (i >= K)
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    ans += (h>=K)
print(ans)
Problem p02947 (python)

Fixed submission:
import collections

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


N = int(input())
s = [" ".join(sorted(list(input()))) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for i in c.values():
    if i > 1:
        ans += cmb(i, 2)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections

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


N = int(input())
s = [" ".join(sorted(list(input()))) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for i in c.values():
    ans += cmb(i, 2)
print(ans)
Problem p02981 (python)

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

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

def mod(n):
    return n % 2019


L, R = map(int, input().split())

a = list(range(L,R+1))
p = list(itertools.combinations(a, 2))
a1, a2 = map(list, zip(*p))
ans = np.array(a1)*np.array(a2)
ans = map(mod,ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
def mod(n):
    return n % 2019

import itertools
import numpy as np
import operator as op
L, R = map(int, input().split())

a = list(range(L,R+1))
p = list(itertools.combinations(a, 2))
a1, a2 = map(list, zip(*p))
ans = np.array(a1)*np.array(a2)
ans = map(mod,ans)
print(min(ans))
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
if R-L>=2019:
    print(0)
else:
    print(min([((i*j)%2019) for i in range(L,R) for j in range(i+1,R+1)]))

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

def mod(n):
    return n % 2019


L, R = map(int, input().split())

a = list(range(L,R+1))
p = list(itertools.combinations(a, 2))
a1, a2 = map(list, zip(*p))
ans = np.array(a1)*np.array(a2)
ans = map(mod,ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
def mod(n):
    return n % 2019

import itertools
import numpy as np
import operator as op
L, R = map(int, input().split())

a = list(range(L,R+1))
p = list(itertools.combinations(a, 2))
a1, a2 = map(list, zip(*p))
ans = np.array(a1)*np.array(a2)
ans = map(mod,ans)
print(min(ans))
Problem p02934 (python)

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

ans=0
for i in range(n):
  ans+= 1/a[i]

print(1/ans)

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

ans=0
for i in range(n):
  ans+= 1/a[i]

print(1/ans)
Problem p02939 (python)

Fixed submission:
S=input()

i=1
K=1
lastword=[]
lastword.append(S[0])
while i<= (len(S)-1):
  if i==len(S)-1:
    if len(lastword[-1])==1 and S[i]!=S[i-1] or len(lastword[-1])==2:
      K+=1
      break
    elif len(lastword[-1])==1 and S[i]==S[i-1]:
      if lastword[-3]==lastword[-1] or lastword[-1]!=lastword[-2]:
        break
      else:
        K+=1
        break
  
  if len(lastword[-1])==1:
    if S[i]!=S[i-1]:
      lastword.append(S[i])
      i+=1
      K+=1
    else:
      lastword.append(S[i:i+2])  
      i+=2
      K+=1
  else:     # len(lastword)==2:
    lastword.append(S[i])
    i+=1
    K+=1
#  print(i,K,lastword)

print(K)

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

i=1
K=1
lastword=[]
lastword.append(S[0])
while i<= (len(S)-1):
  if i==len(S)-1:
    if len(lastword[-1])==1 and S[i]!=S[i-1] or len(lastword[-1])==2:
      K+=1
      break
    elif len(lastword[-1])==1 and S[i]==S[i-1]:
      if lastword[-3]==lastword[-1]:
        break
      else:
        K+=1
        break
  
  if len(lastword[-1])==1:
    if S[i]!=S[i-1]:
      lastword.append(S[i])
      i+=1
      K+=1
    else:
      lastword.append(S[i:i+2])  
      i+=2
      K+=1
  else:     # len(lastword)==2:
    lastword.append(S[i])
    i+=1
    K+=1
  print(i,K,lastword)

print(K)
Problem p02952 (python)

Fixed submission:
import sys
n=int(input())

oddn=0
if n<10:
  oddn+=n
  print(oddn)
  sys.exit()
else:
  oddn+=9
if n<100:
  print(oddn)
  sys.exit()
  
if n<1000:
  oddn+= n-99
  print(oddn)
  sys.exit()
else:
  oddn+=900

if n>=10000:
  oddn+=n-9999
if n==100000:
  oddn-=1

print(oddn)

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

cnt=0
for i in range(1,n+1):
  if len(str(i))%2=1:
    cnt+=1
print (cnt)
Problem p02953 (python)

Fixed submission:
import sys
n=int(input())
a=list(map(int,input().split()))
if len(a)==1:
  print("Yes")
  sys.exit()
if len(a)==2 and a[0]<=a[1]:
  print("Yes")
  sys.exit()
elif len(a)==2:
  print("No")
  sys.exit()
  
for i in range(1,n-1):
  if a[i+1]>=a[i]-1 and a[i]-1>=a[i-1]:
    a[i]=a[i]-1
    continue

  if a[i+1] >= a[i] and a[i] >=a [i-1]:
    continue
  else:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
a=list(map(int,input().split()))
if len(a)==1:
  print("Yes")
  sys.exit()

for i in range(1,n)[::-1]:
  if a[i]>=a[i-1]:
    a[i-1]-=1
  elif a[i]a[i-1]:
    continue
  else:
    print("No")
    sys.exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
a=list(map(int,input().split()))
if n==1:
  print(Yes)
  sys.exit()
for i in range(1,n-1):
  if a[i+1] >= a[i] and a[i] >=a [i-1]:
    continue
  if a[i+1]>=a[i]-1 and a[i]-1>=a[i-1]:
    a[i]=a[i]-1
    continue
  elif i==1 and a[0]-1==a[1]:
    a[0]-=1
    continue
  else:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
a=list(map(int,input().split()))
if n==0:
  print(Yes)
  sys.exit()
for i in range(1,n-1):
  if a[i+1] >= a[i] and a[i] >=a [i-1]:
    continue
  if a[i+1]>=a[i]-1 and a[i]-1>=a[i-1]:
    a[i]=a[i]-1
    continue
  else if i==1 and a[0]-1==a[1]:
    a[0]-=1
    continue
  else:
    print("No")
    sys.exit()
print("Yes")

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

if n==0:
  print(Yes)
  sys.exit()
for i in range(1,n-1):
  if a[i+1]>=a[i] and a[i]>=a[i-1]:
    continue
  if a[i+1]>=a[i]-1 and a[i]-1>=a[i-1]:
    a[i]=a[i]-1
      continue
    else:
      print("No")
      sys.exit()
  else:
    print("No")
    sys.exit()
print("Yes")
Problem p02983 (python)

Fixed submission:
import sys
L,R = map(int, input().split())

#if R-L > 2019:
#  print (0)
#else:
#  mod1 = L%2019
#  mod2 = R%2019
#  if mod2 < mod1:
#    print (0)
#    sys.exit()
#  else:
modmin =2019 -1
for i in range(L,R):
  for j in range(i+1,R+1):
    mod3 = (i*j)%2019
    if mod3 == 0:
      print(0)
      sys.exit()
    elif modmin > mod3:
      modmin = mod3

print(modmin)

Buggy submission (verdict: Runtime Error):
L,R = map(int, input().split())

#if R-L > 2019:
#  print (0)
#else:
#  mod1 = L%2019
#  mod2 = R%2019
#  if mod2 < mod1:
#    print (0)
#    sys.exit()
#  else:
  modmin =2019 -1
  for i in range(L,R):
    for j in range(i+1,R+1):
      mod3 = (i*j)%2019
      if mod3 =0:
        print(0)
        sys.exit()
      elif modmin > mod3:
        modmin = mod3

  print(modmin)
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
L=list(map(int,input().split()))
 
cnt =0
pos =0
jp=[]
for i in range(len(L)+1):
  if pos<=x:
    cnt +=1
    jp.append(pos)
    if i<(len(L)):
      pos +=L[i]
    else:
      break
  else:
    break

print(cnt)

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

cnt =0
pos =0
jp=[]
for i in range(n+1):
  if pos<=x:
    cnt +=1
    jp.append(pos)
    pos +=L[i]
  else:
    break

print(cnt)
Problem p03844 (python)

Fixed submission:
instr = list(map(str, input().split()))
a = int(instr[0])
b = int(instr[2])
op = instr[1] 
if op == "+":
  print (a+b)
else:
  print(a-b)

Buggy submission (verdict: Runtime Error):
instr = map(int, input())
a = int(instr[0])
b = int(instr[2])
op = instr[1]

if op == "+":
  print (a+b)
else:
  print(a-b)

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

if op == "+":
  print (a+b)
else:
  print(a-b)
Problem p02909 (python)

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s=input()
i=0
for tmp in s:
  i+=1
  if i%2==0:
    if tmp in ['L','U','D']:
      continue
    else:
      print('No')
      break
  break
  else:
    if tmp in ['R','U','D']:
      continue
    else:
      print('No')
      break
  break
print('Yes')
Problem p02910 (python)

Fixed submission:
s=input()
i=0
for tmp in list(s):
  i+=1
  if i%2==0:
    if tmp in ['L','U','D']:
      x='Y'  
      continue
    else:
      x='N'
      break
  else:
    if tmp in ['R','U','D']:
      x='Y'  
      continue
    else:
      x='N'
      break
  break
if x=='N':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
i=0
for tmp in list(s):
  i+=1
  if i%2==0:
    if tmp in ['L','U','D']:
      continue
    else:
      x='N'
      break
  else:
    if tmp in ['R','U','D']:
      continue
    else:
      x='N'
      break
  break
if x=='N':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
i=0
for tmp in s:
  i+=1
  if i%2==0:
    if tmp in ['L','U','D']:
    else:
      print('No')
      break
  break
  else:
    if tmp in ['R','U','D']:
    else:
      print('No')
      break
  break
print('Yes')