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

Fixed submission:
import math
Q = int(input())
AB = [sorted(list(map(int,input().split()))) for i in range(Q)]

for A,B in AB:
    x = math.sqrt(A*B)
    y = int(x)
    if x!=y:
        if y*(y+1)<A*B:
            print(y*2-1)
        else:
            print(y*2-2)
    else:
        if A==B:
            print(y*2-2)
        else:
            print(y*2-3)

Buggy submission (verdict: Runtime Error):
import sys
import os
import itertools
import math
f = open("C:/Users/kazuki/Documents/python/import.txt","r")
sys.stdin = f
# -*- coding: utf-8 -*-
Q = int(input())
AB = [sorted(list(map(int,input().split()))) for i in range(Q)]

for A,B in AB:
    x = math.sqrt(A*B)
    y = int(x)
    if x!=y:
        if y*(y+1)<A*B:
            print(y*2-1)
        else:
            print(y*2-2)
    else:
        if A==B:
            print(y*2-2)
        else:
            print(y*2-3)

Buggy submission (verdict: Runtime Error):
Q = int(input())
AB = [sorted(list(map(int,input().split()))) for i in range(Q)]

for A,B in AB:
    x = math.sqrt(A*B)
    y = int(x)
    if x!=y:
        if y*(y+1)<A*B:
            print(y*2-1)
        else:
            print(y*2-2)
    else:
        if A==B:
            print(y*2-2)
        else:
            print(y*2-3)

Buggy submission (verdict: Runtime Error):
Q = int(input())
AB = [sorted(list(map(int,input().split()))) for i in range(Q)]

for A,B in AB:
    x = math.sqrt(A*B)
    y = int(x)
    if x!=y:
        if y*(y+1)<A*B:
            print(y*2-1)
        else:
            print(y*2-2)
    else:
        if A==B:
            print(y*2-2)
        else:
            print(y*2-3)
Problem p03393 (python)

Fixed submission:
a = set(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"])
s = input()
if len(s)<26:
    b = list(a-set(s))
    b.sort()
    print(s+b[0])
else:
    for i in range(2,27):
        if s[-i] < s[-i+1]:
            break
        if i == 26:
            print(-1)
            exit()
    for j in sorted(s[-i+1:]):
        if j > s[-i]:break
    print(s[:-i]+j)

Buggy submission (verdict: Runtime Error):
a = set(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"])
s = input()
for i in range(len(s)):
    a.remove(s[i])
b = list(a).sort()
if b:
    print(s[i]+b[0])
else:
    for i in range(2,27):
        if s[-i] < s[-i+1]:
            break
        if i == 26:
            print(-1)
            exit()
    for j in sorted(s[-i+1:]):
        if j > s[-i]:break
    print(s[:-i]+j)

Buggy submission (verdict: Runtime Error):
a = set(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"])
s = input()
for i in range(len(s)):
    a.remove(s[i])
b = list(a).sort()
if b:
    print(s[i]+s[0])
else:
    for i in range(2,27):
        if s[-i] < s[-i+1]:
            break
        if i == 26:
            print(-1)
            exit()
    for j in sorted(s[-i+1:]):
        if j > s[-i]:break
    print(s[:-i]+j)
Problem p03476 (python)

Fixed submission:
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
INF = float("inf")

Q = int(input())
l = [0]*Q
Sum = [0]*(10**5+1)
for i in range(Q):
    l[i] = list(map(int,input().split()))

def is_prime(n):
    for i in range(2,int(math.sqrt(n))+1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1
for i in range(3,10**5+1,2):
    if is_prime(i) and is_prime((i+1)//2):
        Sum[i] = Sum[i-2]+1
    else:
        Sum[i] = Sum[i-2]

for i in range(Q):
    if l[i][1] ==1:
        print(0)
    elif l[i][0] == 1:
        print(Sum[l[i][1]])
    else:
        print(Sum[l[i][1]]-Sum[l[i][0]-2])

Buggy submission (verdict: Runtime Error):
Q = int(input())
l = [0]*Q
for i in range(Q):
    l[i] = list(map(int,input().split()))

def is_prime(n):
    for i in range(2,int(math.sqrt(n))+1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1

for i in range(Q):
    sum = 0
    for j in range(l[i][0],l[i][1]+1):
        if is_prime(j) and is_prime((j+1)//2):
            sum +=1
        else:
            continue
    print(sum)
Problem p03487 (python)

Fixed submission:
from collections import Counter
inf = 10**10


N = int(input())
a = list(map(int,input().split()))
c = Counter(a)
ans = 0
for i,j in c.items():
    if j>=i:
        ans += j-i
    else:
        ans += j
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
c = Counter(a)
ans = 0
for i,j in c.items():
    if j>=i:
        ans += j-i
    else:
        ans += j
print(ans)
Problem p03503 (python)

Fixed submission:
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
INF = float("inf")

n = int(input())
F =[list(map(int,input().split())) for i in range(n)]
P =[list(map(int,input().split())) for i in range(n)]

ans = -INF
for i in range(1,1024):
    profit = 0
    for j in range(n):
        cnt = 0
        for x in range(10):
            if (i >> x) %2 == 1 and F[j][x] == 1:
                cnt += 1
        profit += P[j][cnt]
    ans = max(ans,profit)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
F =[list(map(int,input().split())) for i in range(n)]
P =[list(map(int,input().split())) for i in range(n)]

ans = -INF
for i in range(1,1024):
    profit = 0
    for j in range(n):
        cnt = 0
        for x in range(10):
            if (i >> x) %2 == 1 and F[j][x] == 1:
                cnt += 1
        profit += P[j][cnt]
    ans = max(ans,profit)
print(ans)
Problem p03524 (python)

Fixed submission:
s = input()
abc = [0]*(3)
for i in range(len(s)):
    if s[i] == "a":
        abc[0] += 1
    elif s[i] =="b":
        abc[1] += 1
    else:
        abc[2] += 1
if max(abc)-min(abc) >= 2:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
s = input()
c = Counter(s)
cnt = 0
a = list()
for v in c.values():
    a.append(v)
if max(a)-min(a)>=2:
    print("NO")
else:
    print("Yes")
Problem p03557 (python)

Fixed submission:
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
INF = float("inf")

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

ans = 0
for i in range(N):
    l = bisect.bisect_left(A,B[i])
    r = bisect.bisect_right(C,B[i])
    ans += l*(N-r)

print(ans)

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

ans = 0
for i in range(N):
    r1 = bisect.bisect_right(B,A[i])
    for j in range(r1,N):
        r2 = bisect.bisect_right(C,B[j])
        ans += N - r2
print(ans)
Problem p03578 (python)

Fixed submission:
from itertools import accumulate
from math import*
from collections import deque
from collections import defaultdict
from itertools import permutations
from heapq import*
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = 10**18
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)

input()
d = Counter(map(int,input().split()))
input()
t = Counter(map(int,input().split()))
d.subtract(t)
if -d:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
n = int(input())
d  =list(map(int,input().split()))
d.sort()
m = int(input())
t = list(map(int,input().split()))
t.sort()
for x in t:
    while d[i] < x:
        i += 1
    if d[i] == x:
        i += 1
    else:
        print("NO")
        exit()
print("YES")

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
from math import*
from collections import deque
from collections import defaultdict
from itertools import permutations
from heapq import*
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = 10**18
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)

input()
d = Counter(map(int,input().split()))
input()
t = Counter(map(int,input().split()))
d.subtract(t)
if -d:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
input()
d = Counter(map(int,input().split()))
input()
t = Counter(map(int,input().split()))
d.subtract(t)
if -d:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
d.sort()
m = int(input())
t = list(map(int,input().split()))
t.sort()
for x in d:
    if x == t[0]:
        t.pop(0)
if len(t)==0:
    print("YES")
else:
    print("NO")
Problem p03579 (python)

Fixed submission:
from itertools import*
from math import*
from collections import*
from heapq import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = 10**18
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)

#s,t間に奇数長のパスが存在したならば必ずs,t間には辺が張られる
#グラフが二部グラフでないならば奇数長のサイクルが存在して任意の(s,t)間に奇数長パスが作れる
#グラフが二部グラフであるならば異なるカラーグループ間の頂点には必ず辺が張られる
n,m = map(int,input().split())
G = defaultdict(set)
color = [0 for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    G[a-1].add(b-1)
    G[b-1].add(a-1)
#二部グラフ判定
color[0]=1
que = deque([0])
bipartite = True
while len(que):
    p = que.popleft()
    for q in list(G[p]):
        if color[q] == 0:
            color[q] = -color[p]
            que.append(q)
        elif color[q] == color[p]:
            bipartite = False
            break
if bipartite:
    print(color.count(1)*color.count(-1)-m)
else:
    print(n*(n-1)//2-m)

Buggy submission (verdict: Runtime Error):
#s,t間に奇数長のパスが存在したならば必ずs,t間には辺が張られる
#グラフが二部グラフでないならば奇数長のサイクルが存在して任意の(s,t)間に奇数長パスが作れる
#グラフが二部グラフであるならば異なるカラーグループ間の頂点には必ず辺が張られる
n,m = map(int,input().split())
G = defaultdict(set)
color = [0 for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    G[a-1].add(b-1)
    G[b-1].add(a-1)
#二部グラフ判定
color[0]=1
que = deque([0])
bipartite = True
while len(que):
    p = que.popleft()
    for q in list(G[p]):
        if color[q] == 0:
            color[q] = -color[p]
            que.append(q)
        elif color[q] == color[p]:
            bipartite = False
            break
if bipartite:
    print(color.count(1)*color.count(-1)-m)
else:
    print(n*(n-1)//2-m)
Problem p03612 (python)

Fixed submission:
N = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(N):
    if p[i] == i+1 and i<N-1:
        p[i+1]=p[i]
        ans += 1
    elif p[i] == N and i == N-1:
        ans +=1
    else:
        continue
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(N):
    if p[i] == i+1:
        p[i+1]=p[i]
        ans += 1
    else:
        continue
print(ans)
Problem p03633 (python)

Fixed submission:
N = int(input())
T = [int(input()) for i in range(N)]

from functools import reduce
from fractions import gcd

def lcm(a,b):
  return a*b //gcd(a,b)

print(reduce(lcm,T))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
 if a < b:
    a, b = b, a
 if b == 0:
    return a
 c = a % b
 return gcd(b, c)
def lcm(a,b):
  return int(a*b/gcd(a,b))

N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
for i in T[1:]:
    ans = lcm(ans,i)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
 if a < b:
    a, b = b, a
 if b == 0:
    return a
 c = a % b
 return gcd(b, c)
def lcm(a,b):
  return float(a*b/gcd(a,b))

N = int(input())
ans = 1
for i in range(N):
    t = float(input())
    ans = lcm(t,ans)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
 if a < b:
    a, b = b, a
 if b == 0:
    return a
 c = a % b
 return gcd(b, c)
def lcm(a,b):
  return int(a*b/gcd(a,b))

N = int(input())
ans = 1
for i in range(N):
    t = float(input())
    ans = lcm(t,ans)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
 if a < b:
    a, b = b, a
 if b == 0:
    return a
 c = a % b
 return gcd(b, c)
def lcm(a,b):
  return int(a*b/gcd(a,b))

N = int(input())
ans = 1
for i in range(N):
    t = int(input())
    ans = lcm(t,ans)

print(ans)
Problem p03645 (python)

Fixed submission:
INF = float("inf")


N,M = map(int,input().split())
ab =[list(map(int,input().split())) for i in range(M)]
dist = [INF]*(N)
for i in range(M):
    if ab[i][0] == 1:
        dist[ab[i][1]-1] = 1
for i in range(M):
    if ab[i][1] == N:
        if dist[ab[i][0]-1] <= 1:
            print("POSSIBLE")
            exit()
        else:
            continue
print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):

N,M = map(int,input().split())
ab =[list(map(int,input().split())) for i in range(M)]
dist = [INF]*(N)
for i in range(M):
    if ab[i][0] == 1:
        dist[ab[i][1]-1] = 1
for i in range(M):
    if ab[i][1] == N:
        if dist[ab[i][0]-1] <= 1:
            print("POSSIBLE")
            exit()
        else:
            continue
print("IMPOSSIBLE")
Problem p03657 (python)

Fixed submission:
A,B = map(int,input().split())
 
if (A%3==0) or(B%3==0) or((A+B)%3==0):
  print("Possible")
else:
  print("Impossible")

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

if (A % 3 == 0) or(B%3==0) or((A+B)%3==):
  print("Possible")
else:
  print("Impossible")
Problem p03671 (python)

Fixed submission:
l = list(map(int,input().split()))
l.sort()
print(l[0]+l[1])

Buggy submission (verdict: Runtime Error):
l =[map(int,input().split())]
print(l[0]+l[1])

Buggy submission (verdict: Runtime Error):
l =[map(int,input().split())]
print(l[0]+l[1])
Problem p03687 (python)

Fixed submission:
s = input()
ans = len(s)
for i in set(s):
    t = s.split(i)
    c = 0
    for j in t:
        c = max(c,len(j))
    ans = min(ans,c)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
from collections import Counter
inf = 10**10
from functools import reduce

s = input()
ans = len(s)
for i in set(s):
    t = s.split(i)
    c = 0
    for j in t:
        c = max(c,len(j))
    ans = min(ans,c)
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
A = set()
ans = inf
for i in range(len(s)):
    A.add(s[i])
for v in A:
    cur = 0
    vstep = 0
    for i in range(len(s)):
        if s[i] != v:
            cur += 1
        else:
            vstep = max(cur,vstep)
            cur = 0
    vstep = max(cur,vstep)
    ans = min(ans,vstep)
print(ans)
Problem p03693 (python)

Fixed submission:
s = ""
a = list(input().split())
for i in range(3):
  s += a[i]
if eval(s) % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s = ""
for i in range(3):
  a = input()
  s += a
if eval(s) % 4 == 0:
  print("YES")
else:
  print("NO")
Problem p03713 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
INF = float("inf")

H,W = map(int,input().split())
ans = INF

for i in range(1,H):
    SA = i * W
    h = (H-i)//2
    w = W//2
    SB2 = (H-i)*w
    SC2 = H*W-(SA+SB2)
    SB1 = h * W
    SC1 = H*W-(SA+SB1)
    S1 = max(SA,SB1,SC1)-min(SA,SB1,SC1)
    S2 = max(SA,SB2,SC2)-min(SA,SB2,SC2)
    ans = min(ans,S1,S2)

for i in range(1,W):
    SA = H * i
    #横半分に分割するケース
    h = H//2
    w = (W-i)//2
    SB1 = h * (W-i)
    SC1 = H*W-(SA+SB1)
    S1 = max(SA,SB1,SC1)-min(SA,SB1,SC1)
    #縦半分に分割するケース
    SB2 = H*w
    SC2 = H*W -(SA+SB2)
    S2 = max(SA,SB2,SC2)-min(SA,SB2,SC2)
    ans = min(ans,S1,S2)

print(ans)

Buggy submission (verdict: Runtime Error):
INF = float("inf")

H,W = map(int,input().split())
ans = INF
for i in range(1,H):
    SA = i * W
    #横半分に分割するケース
    h = math.ceil((H-i)/2)
    SB1 = h * W
    SC1 = (H-i-h)*W
    S1 = max(SA,SB1,SC1)-min(SA,SB1,SC1)
    #縦半分に分割するケース
    w = math.ceil(W/2)
    SB2 = (H-i)*w
    SC2 = (H-i)*(W-w)
    S2 = max(SA,SB2,SC2)-min(SA,SB2,SC2)
    ans = min(ans,S1,S2)
print(ans)
Problem p03722 (python)

Fixed submission:
from itertools import accumulate
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = float('inf')
from functools import reduce

n,m = map(int,input().split())
edge=[]
for i in range(m):
    a, b, c = map(int, input().split())
    edge.append([a,b,-c])

dist = [inf]*n
dist[0] = 0
for i in range(1,n):
    for j in range(m):
        if dist[edge[j][1]-1] > dist[edge[j][0]-1]+edge[j][2]:
            dist[edge[j][1]-1] = dist[edge[j][0]-1]+edge[j][2]

ans = dist[n-1]

for j in range(m):
    if dist[edge[j][1]-1] > dist[edge[j][0]-1]+edge[j][2]:
        dist[edge[j][1]-1] = dist[edge[j][0]-1]+edge[j][2]
if dist[n-1]<ans:
    print("inf")
else:
    print(-ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
edge=[]
for i in range(m):
    a, b, c = map(int, input().split())
    edge.append([a,b,-c])

def BellmanFord(edges,num_v,source):
  #グラフの初期化
  dist=[inf for i in range(num_v)]
  dist[source-1]=0
  #辺の緩和
  for i in range(num_v):
    for e in edges:
      if e[0] != inf and dist[e[1]-1] > dist[e[0]-1] + e[2]:
        dist[e[1]-1] = dist[e[0]-1] + e[2]
        if i == num_v-1:dist[e[1]-1] = inf

  return dist

d = BellmanFord(edge,n,1)

if d[n-1]==inf:
    print("inf")
else:
    print(-d[n-1])
Problem p03738 (python)

Fixed submission:
a = input()
b = input() 
if len(a) < len(b):
  print("LESS")
  exit()
elif len(a) > len(b):
  print("GREATER")
  exit()
else:
  for i in range(len(a)):
    if a[i] > b[i]:
      print("GREATER")
      exit()
    elif a[i] < b[i]:
      print("LESS")
      exit()
print("EQUAL")

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

if len(a) < len(b):
  print("LESS")
  exit()
elif len(a) > len(b):
  print("GREATER")
  exit()
else:
  for i in xrange(len(a)):
    if a[i] > b[i]:
      print("GREATER")
      exit()
    elif a[i] < b[i]:
      print("LESS")
      exit()
    else:
      continue
print("EQUAL")
Problem p03828 (python)

Fixed submission:
N = int(input())
prime = [0]*(N+1)
ans = 1
for i in range(2,N+1):
    d = 1
    while i > 1:
        d+=1
        while i % d == 0:
            i = i//d
            prime[d]+= 1
for j in range(N+1):
    ans = ans *(prime[j]+1)%(10**9+7)
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
 
N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
 
N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
import math
import sympy
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
from collections import Counter
inf = 10**10

N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)
Problem p03836 (python)

Fixed submission:
sx,sy,tx,ty = map(int,input().split())
print("U"*(ty-sy)+"R"*(tx-sx)+"D"*(ty-sy)+"L"*(tx-sx)+"L"+"U"*(ty-sy+1)+"R"*(tx-sx+1)+"D"+"R"+"D"*(ty-sy+1)+"L"*(tx-sx+1)+"U")

Buggy submission (verdict: Runtime Error):
sx,sy,tx,ty = map(int,input().split())
print("U"*(ty-sy)+"R"*(tx-sx)+"D"*(ty-sy)+"L"*(ty-sy)+"L"+"U"*(ty-sy+1)+"R"*(tx-sx+1)+"D"+"R"+"D"*(ty-sy+1)+"L"*(tx-sx+1)+"U"
Problem p03852 (python)

Fixed submission:
s = input()
if s == "a" or s=="i" or s=="u" or s=="e" or s=="o":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "a" or s=="i" or s=="u" or s=="e" or s=="o":
  print(vowel)
else:
  print(consonant)
Problem p03946 (python)

Fixed submission:
inf = 10**18
mod = 10**9+7

n,t = map(int,input().split())
a = list(map(int,input().split()))
ma = inf
benefit = 0
ans = 1
for i in range(n):
    if a[i] < ma:
        ma = a[i]
    else:
        b = a[i]-ma
        if b == benefit:
            ans += 1

        if b > benefit:
            benefit = b
            ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
a = list(map(int,input().split()))
ma = inf
benefit = 0
ans = 1
for i in range(n):
    if a[i] < ma:
        ma = a[i]
    else:
        b = a[i]-ma
        if b == benefit:
            ans += 1

        if b > benefit:
            benefit = b
            ans = 1
print(ans)
Problem p03994 (python)

Fixed submission:
s = list(input())
K = int(input())
for i in range(len(s)-1):
    if K == 0:
        break
    else:
        if s[i] == "a":
            continue
        else:
            if 123-ord(s[i]) <= K:
                K -= 123-ord(s[i])
                s[i] = "a"
K = K %26
if K > 0:
    if ord(s[-1])+K <= 122:
        s[-1] = chr(ord(s[-1])+K)
    else:
        s[-1] = chr(96+((ord(s[-1])+K-122)))

print(*s,sep="")

Buggy submission (verdict: Runtime Error):
s = list(input())
K = int(input())
for i in range(len(s)-1):
    if K == 0:
        break
    else:
        if s[i] == "a":
            continue
        else:
            if 123-ord(s[i]) <= K:
                K -= 123-ord(s[i])
                s[i] = "a"

K = K %26
if K > 0:
    if ord(s[-1])+K <= 122:
        s[-1] = chr(ord(s[-1])+K)
    else:
        s[-1] = chr(97+(ord(s[-1]+K-122)))

print(*s,sep="")
Problem p04043 (python)

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

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = input().split()
while len(set(str(n)) & set(d)) !=0:
    n +=1
print(n)
Problem p04045 (python)

Fixed submission:
n,k = map(int,input().split())
d = input().split()
while len(set(str(n)) & set(d)) !=0:
    n +=1
print(n)

Buggy submission (verdict: Runtime Error):
num =set([0,1,2,3,4,5,6,7,8,9])
n,k = input().split()
d = list(map(int,input().split()))
a = list(num - set(d))
a.sort()
ans =[]
for i in range(len(n)):
    for j in a:
        if int(n[i]) <= j:
            ans.append(a[i])
            break
    if a[-1] < int(n[i]):
        ans.append(a[0])
l = map(str,ans)
b = "".join(l)
if int(b) < int(n):
    if a[0] != 0:
        print(a[0]*(10**(len(n)))+int(b))
    else:
        print(a[1]*(10**(len(n))) + int(b))
else:
    print(int(b))