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

Fixed submission:
S = "".join(sorted(input()))
T = "".join(sorted(input()))[::-1]

print("Yes" if (S < T) else "No")

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

print("Yes" if (S < t) else "No")
Problem p03697 (python)

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

sum = a + b
if sum >= 10:
    print("error")
else:
    print(sum)

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

sum = a+b
if(sum>=10):
  print("error")
else:
  print(sum)

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

sum = a+b
if(sum>=10):
  print("error")
 else:
  print(sum)

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

sum = a+b
if(sum>=10):
  print("error")
 else:
  print(sum)
Problem p03760 (python)

Fixed submission:
from itertools import zip_longest

O = input()
E = input()

for o, e in zip_longest(O, E, fillvalue=""):
    print(o + e, end="")

Buggy submission (verdict: Runtime Error):
atcoderbeginnercontest
atcoderregularcontest
Problem p02658 (python)

Fixed submission:
N = input()
A_str = input().split()
A_array = map(int, A_str)

if "0" in A_str:
    print(0)
    exit()

res = 1
for A in A_array:
    res *= A
    if res > 10 ** 18:
        res = -1
        break

print(res)

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


def mul(arr):
    if len(arr) == 1:
        return arr[0]
    return arr[0] * mul(arr[1:])


res = mul(A_s)

if res > 10 ** 18:
    res = -1

print(res)

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


def mul(arr):
    if len(arr) == 1:
        return arr[0]
    return arr[0] * mul(arr[1:])


res = mul(A_s)

if res > 10 ** 18:
    res = -1

print(res)
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
portals = [0] + list(map(int, input().split()))

visitTowns = list()
visitTimes = [0 for _ in range(N + 1)]

curTown = 1
timeBackTo = 0

curTime = 0
while True:
    if visitTimes[curTown] > 0:
        timeBackTo = visitTimes[curTown]
        break

    visitTowns.append(curTown)
    visitTimes[curTown] = curTime

    # teleport
    curTown = portals[curTown]

    curTime += 1

nonLoopCount = timeBackTo
loopSpan = len(visitTowns) - nonLoopCount

if K <= nonLoopCount:
    print(visitTowns[K])
    exit()

rem = (K - nonLoopCount) % loopSpan
print(visitTowns[nonLoopCount + rem])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
portals = [0] + list(map(int, input().split()))

visitTowns = list()
visitTimes = [0 for _ in range(N + 1)]

curTown = 1
timeBackTo = 0

curTime = 0
while True:
    if visitTimes[curTown] > 0:
        timeBackTo = visitTimes[curTown]
        break

    visitTowns.append(curTown)
    visitTimes[curTown] = curTime

    # teleport
    curTown = portals[curTown]

    curTime += 1
    print(visitTowns, visitTimes[1:])

nonLoopCount = timeBackTo
loopSpan = len(visitTowns) - nonLoopCount

if K <= nonLoopCount:
    print(visitTowns[K])
    exit()

rem = (K - nonLoopCount) % loopSpan
print(visitTowns[nonLoopCount + rem])

Buggy submission (verdict: Runtime Error):
from collections import deque

N, K = map(int, input().split())
portals = list(map(int, input().split()))


def teleport(now_index):
    next_machi_index = portals[now_index] - 1
    return next_machi_index


current = first_count = 0
keiro = list()
for _ in range(K):
    if current in keiro:
        loop_index = keiro.index(current)
        loop_keiro = keiro[loop_index:]
        break
    keiro.append(current)
    current = teleport(current)

print(keiro[(K - first_count) % len(loop_keiro)] + 1)
Problem p02720 (python)

Fixed submission:
from bisect import bisect

k = int(input())
A = list(range(10))

if k <= 9:
    print(A[k])
    exit()


def is_1_keta(i):
    return len(str(i)) == 1


kouho = list(map(str, range(1, 10)))
kouho2 = list(map(str, range(1, 10)))
while True:
    ll = []
    for i in kouho:
        su = list(filter(is_1_keta, [int(i[-1]) - 1, int(i[-1]), int(i[-1]) + 1]))
        l = [str(i) + str(x) for x in su]
        A.extend(l)
        ll.extend(l)
    kouho = ll
    kouho2.extend(ll)
    if len(kouho2) > k:
        break

print(sorted(list(map(int, kouho2)))[k - 1])

Buggy submission (verdict: Runtime Error):
k = int(input())
A = list(range(10))

if k <= 9:
    print(A[k])
    exit()


def is_1_keta(i):
    return len(str(i)) == 1


kouho = list(map(str, range(1, 10)))
kouho2 = list(map(str, range(1, 10)))
while True:
    ll = []
    for i in kouho:
        su = list(filter(is_1_keta, [int(i[-1]) - 1, int(i[-1]), int(i[-1]) + 1]))
        l = [f"{i}{x}" for x in su]
        A.extend(l)
        ll.extend(l)
    kouho = ll
    kouho2.extend(ll)
    if len(kouho2) > k:
        break

print(sorted(list(map(int, kouho2)))[k - 1])
Problem p02584 (python)

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

cur = abs(x)  # 座標を正にしてしまいます
rem = k  # 残りの移動回数です

cnt = min(cur // d, k)  # 0に向かって移動する回数です
cur -= d * cnt
rem -= cnt

# 0 % 2 = 0なので、残り回数の場合分けをする必要はないのですが、一応
if rem > 0:
    if rem % 2 == 1:
        cur = cur - d

ans = abs(cur)  # 絶対値を出力することに気をつけてください
print(ans)

Buggy submission (verdict: Runtime Error):
    x,k,d=map(int,input().split())
     
    if (x//d)<=k:
      k-=x//d
      x-=(x//d)*d
    else:
      x-=d*k
      print(abs(x))
      exit()
     
    for i in range(k):
      tmp=x
      x-=d
      if abs(x) >= abs(tmp):
        if (k-i)%2==0:
          print(abs(tmp))
          exit()
        else:
          print(abs(x))
          exit()
    else:
      print(abs(x))
Problem p02677 (python)

Fixed submission:
import math

a,b,h,m=map(int,input().split())

rad=math.radians(abs(30*h+0.5*m-6*m))

print(math.sqrt(a**2+b**2-2*a*b*math.cos(rad)))

Buggy submission (verdict: Runtime Error):
import math

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

a = x[0]
b = x[1]
h = x[2]
m = x[3]

deg = abs(h * math.pi/6 + math.pi/360 * m - m * math.pi/30)

if deg <= math.pi:
  deg = deg
else:
  deg = deg - math.pi
  
if deg <= math.pi/2:
  ans = math.sqrt(math.pow(a * math.sin(deg),2) + math.pow(b - a * math.cos(deg),2))
else:
  ans = math.sqrt(math.pow(b * math.sin(deg),2) + math.pow(a - b * math.cos(deg),2))

if h==11:
  break
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

a = x[0]
b = x[1]
h = x[2]
m = x[3]

deg = abs(h * math.pi/6 - m * math.pi/30)

if deg <= math.pi:
  deg = deg
else:
  deg = deg - math.pi
  
if deg <= math.pi/2:
  ans = math.sqrt(math.pow(b * math.sin(deg),2) + math.pow(b * math.cos(deg) - a, 2))
else:
  ans = math.sqrt(math.pow(b * math.sin(deg),2) + math.pow(a - (b * math.cos(deg),2)))

print(ans)
Problem p02713 (python)

Fixed submission:
import numpy as np
 
K=int(input())
 
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)
print(nums.sum())

Buggy submission (verdict: Runtime Error):
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)
Problem p03401 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

A.insert(0,0)
A.append(0)

S = 0

for i in range(1,N+2):
    S += abs(A[i]-A[i-1])

for i in range(1,N+1):
    print(S + abs(A[i-1]-A[i+1]) - abs(A[i-1]-A[i]) - abs(A[i]-A[i+1]))

Buggy submission (verdict: Runtime Error):
import copy

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

a = [0] + a + [0]

for i in range(n):
  my_sum = 0
  l = copy.copy(a)
  del l[i+1]
  for j in range(n):
    my_sum += abs(l[j] - l[j+1])
   print(my_sum)
Problem p02760 (python)

Fixed submission:

# n,m=map(int,input().split())
# a,b,c=map(int,input().split())
# s=input()
# s,t=map(str,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
L=[]
L.append(A)
L.append(B)
L.append(C)
n=int(input())

for i in range(n):
  x=int(input())
  for a in range(3):
    for b in range(3):
      if L[a][b] == x:
        L[a][b]=0

if L[0][0]==0 and L[0][1]==0 and L[0][2]==0:
  print("Yes")
  exit()

if L[1][0]==0 and L[1][1]==0 and L[1][2]==0:
  print("Yes")
  exit()

if L[2][0]==0 and L[2][1]==0 and L[2][2]==0:
  print("Yes")
  exit()

if L[0][0]==0 and L[1][0]==0 and L[2][0]==0:
  print("Yes")
  exit()
if L[0][1]==0 and L[1][1]==0 and L[2][1]==0:
  print("Yes")
  exit()
if L[0][2]==0 and L[1][2]==0 and L[2][2]==0:
  print("Yes")
  exit() 
if L[0][0]==0 and L[1][1]==0 and L[2][2]==0:
  print("Yes")
  exit()
if L[0][2]==0 and L[1][1]==0 and L[2][0]==0:
  print("Yes")
  exit()


print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
# a,b,c=map(int,input().split())
# s=input()
# s,t=map(str,input().split())
ans=[0]*n
anss=""
l=[]
L=[]
for i in range(m):
  s,c=map(int,input().split())
  l.append(str(s)+str(c))
  if s==1 and c==0:
    print(-1)
    exit()

l=list(set(l))
for x in l:
  L.append([x[0],x[1]])
X=[]

for i in range(len(L)):

  ans[int(L[i][0])-1] = int(L[i][1])
  if L[i][0] in X:
    print(-1)
    exit()
  else:
      X.append(L[i][0])
print(ans)
if ans[0]==0:
  if n!=1:
    ans[0]="1"
    for x in ans:
      anss+=str(x)
      print(anss)
  else:
    print(0)
else:
  for x in ans:
    anss+=str(x)
  print(anss)
Problem p02909 (python)

Fixed submission:
s = input()

if s == "Rainy":
  print("Sunny")
elif s == "Sunny":
  print("Cloudy")
else:
  print("Rainy")

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

if s = "Rainy":
  print("Sunny")
elif s = "Sunny":
  print("Cloudy")
else:
  print("Rainy")
Problem p02947 (python)

Fixed submission:
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())
L = []
for i in range(n):
  a = input()
  a = sorted(a)
  L.append(a)
L = sorted(L)


k=1
sum=0
for i in range(n-1):
  if L[i]==L[i+1]:
    k += 1
  else:
    if k!=1:
      sum += cmb(k,2)
    k=1
if k!=1:
  sum += cmb(k,2)
print(sum)

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

L=list(map(int,sorted(input().split())))

L=sorted(L)
from scipy.speial import comb
k=1
sum=0
for i in range(n-1):
  if L[i]==L[i+1]:
    k += 1
  else:
    if k==1:
      sum +=1
    else:
      sum += comb(k,2,exact=True)
    k=1
if k==1:
  sum += 1
else:
  sum += comb(k,2,exact=True)
print(sum)
Problem p02957 (python)

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

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

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
count = 0
for i in range(n):
  if(li[i] != i+1):
    count += 1
if(count == 0 or count == 2):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int count= 0;
  
  vector<int> p(N);
  for (int i=1 ;i < N ;i++) {
    cin >> p[i];
    if (p[i-1]+1 != p[i]) {
      count++;
      }
    }
  
  if (count == 0 || count ==2){
    cout << "YES" << endl;
  }
  else cout << "NO" << endl;
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int count= 0;
  
  vector<int> p(N);
  for (int i=1 ;i < N ;i++) {
    cin >> p[i];
    if (p[i-1]+1 != p[i+1]) {
      count++;
      }
    }
  
  if (count == 0 || count ==2){
    cout << "YES" << endl;
  }
  else cout << "NO" << endl;
}

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input()))
count = 0
for i in range(n):
  if(li[i] != i+1):
    count += 1
if(count == 0 or count == 2):
  print("YES")
else:
  print("NO")
Problem p03146 (python)

Fixed submission:
s = int(input())
ptn = []
count = 1
while True:
  ptn.append(s)
  if s%2 == 0:
    s /=2
  else:
    s = 3*s+1
  if s in ptn:
    print(count+1)
    exit()
  count +=1

Buggy submission (verdict: Runtime Error):
s = int(input())
ptn = []
count = 0
while True:
  ptn.append(s)
  if s%2 == 0:
    s /=2
  else:
    s = 3*x+1
  if s in ptn:
    print(count+1)
    break
  count +=1

Buggy submission (verdict: Runtime Error):
s = int(input())
count = 0
for i in range(1000000):
  if s%2 == 0:
    s /=2
  else:
    s = 3*x+1
  
  if s==4:
    print(count+4)
  count +=1

Buggy submission (verdict: Runtime Error):
s = int(input())
count = 0
for i in range(1000000):
  if x%2 == 0:
    x /=2
  else:
    x = 3*x+1
  
  if x==4:
    print(count+4)
  count +=1
Problem p03206 (python)

Fixed submission:
d = int(input())
if d == 25:
  print('Christmas')
elif d == 24:
  print('Christmas Eve')
elif d == 23:
  print('Christmas Eve Eve')
else:
  print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for _ in [0]*n]

print(sum(l)-max(l)//2)
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
n=input()
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)
Problem p03239 (python)

Fixed submission:
n,T = map(int,input().split())
minimum=10000
for i in range(n):
  c,t = map(int,input().split())
  if t <= T :
    minimum = min(minimum,c)
if minimum == 10000:
  print('TLE')
else:
  print(minimum)

Buggy submission (verdict: Runtime Error):
n=int(input())
T=int(input())
minimum=10000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minimum = min(minimum,c)
if minimum == 10000:
  print('TLE')
else:
  print(minimum)

Buggy submission (verdict: Runtime Error):
n=int(input())
T=int(input())
minimum=10000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minimum = min(minimum,c)
if minimum = 10000:
  print('TLE')
else:
  print(minimum)

Buggy submission (verdict: Runtime Error):
n=int(input())
T=int(input())
minimum=1000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minimum = min(minimum,c)
print(minimum)

Buggy submission (verdict: Runtime Error):
n=int(input())
T=int(input())
minimum=1000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minnimum = min(minimum,c)
print(minimum)
Problem p03244 (python)

Fixed submission:
from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
  print(n-(a[0][1]+b[0][1]))
else:
  print(min(n-(a[0][1]+b[1][1]),n-(a[1][1]+b[0][1])))

Buggy submission (verdict: Runtime Error):
from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
print(a)
print(b)
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
  print(n-(a[0][1]+b[0][1])
else:
  print(min(n-(a[0][1]+b[1][1]),n-(a[1][1]+b[0][1])))

Buggy submission (verdict: Runtime Error):
from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
print(a)
print(b)
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
  print(n-(a[0][0]+b[0][0])
else:
  print(min(n-(a[0][0]+b[1][0]),n-(a[1][0]+b[0][0])))
Problem p03261 (python)

Fixed submission:
n = int(input())
s  = input()
L = [s]
for i in range(n-1):
  t = input()
  if t[0] != s[len(s)-1] or t in L:
    print("No")
    exit()
  L.append(t)
  s = t
print("Yes")

Buggy submission (verdict: Runtime Error):
n=input()
x=[]
for i in range(n):
  w = input()
  if i !=0 and (w in x or x[i-1][-1] != w[0]):
    print ("No")
    exit()
  x.append(w)
print("Yes")
Problem p03262 (python)

Fixed submission:
import fractions

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

L = list(map(int,input().split()))
y = []
for i in range(n):
  y.append(abs(L[i]-x))
tmp = y[0]

for i in range(n-1):
  tmp = fractions.gcd(tmp,y[i+1])
print(tmp)

Buggy submission (verdict: Runtime Error):
import fractions

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

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


if n == 1:
  print(abs(L[0]-x))
else:
  L.append(x)
  L = sorted(L)
  a = L[1]-L[0]
  for i in range(n-2):
    b = L[i+2]-L[i+1]
    a = fractions.gcd(a,b)
print(a)
Problem p03264 (python)

Fixed submission:
n = int(input())

e = n//2
o = n-e

print(e*o)

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

if n%2==0:
  print((n/2)*(n/2))
else:
  print((n+1)/2)*((n+1)/2-1)

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

if n%2==0:
  print((n/2)**2)
else:
  print((n+1)/2)*((n+1)/2-1)

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

if n%2==0:
  print((n%2)**2)
else:
  print((n+1)%2)*((n+1)%2-1)
Problem p03316 (python)

Fixed submission:
n = input()
li = list(n)
li = [int(i) for i in li]

if int(n)%sum(li)==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(n)
if sum(li)%n==0:
  print('Yes')
else:
  print('No')
Problem p03328 (python)

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

n=b-a

print(n*(n+1)//2-b)

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

n=b-a

print(n(n+1)//2-b)
Problem p03337 (python)

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

print(max(a+b,a-b,a*b))

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

print(max(a+b,a-b,a*b))
Problem p03359 (python)

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

if a <= b:
  print(a)
  
else:
  print(a-1)

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

if b => a:
  print(a)
else:
  print(a-1)
Problem p03369 (python)

Fixed submission:
s = input()
ans = 0
if s[0]=="o":
  ans += 1

if s[1]=="o":
  ans += 1

if s[2]=="o":
  ans += 1

print(700+100*ans)

Buggy submission (verdict: Runtime Error):
s=int(input())
ans = 0
if s[0]=="o":
  ans += 1

if s[1]=="o":
  ans += 1

if s[2]=="o":
  ans += 1

print(700+100*ans)

Buggy submission (verdict: Runtime Error):
s=int(input())
ans = 0
if s[0]==o:
  ans += 1

if s[1]==o:
  ans += 1

if s[2]==o:
  ans += 1

print(700+100*ans)
Problem p03399 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())


print(min(a,b)+min(c,d))

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

print(min(a,b)+min(c,d))
Problem p03433 (python)

Fixed submission:
a = int(input())
b = int(input())

if (a%500) <= b:
  print("Yes")
else:
  print("No")

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

if (a%500) <= b:
  print("Yes")
else:
  print("No")

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

if (a%500) <= b:
  print("Yes")
else:
  print("No")

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

if (a%500) <= b:
  print("Yes")
else:
  print("No")
Problem p03447 (python)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        cnt +=1
print(cnt)
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        cnt +=1
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b,c,x=map(int,input().split())
cnt = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*a+100*b+50*c == x:
        cnt +=1
print(cnt)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2!=0 and b%2!=0:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2!=0 && b%2!=0:
  print('Odd')
else:
  print('Even')
Problem p03469 (python)

Fixed submission:
s = input()
print(s.replace('2017','2018'))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.replace('2017','2018')

Buggy submission (verdict: Runtime Error):
y,m,d = int(input().split("/"))

print(2018+"/"+m+"/"+d)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
s=input()
ans = 0
for i in range(slen()):
  if s[i] == 1:
    ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans = 0
for i in range(s.len()):
  if s[i] == 1:
    ans +=1
print(ans)
Problem p03495 (python)

Fixed submission:
import sys
import collections
input = sys.stdin.readline
n,k = map(int,input().split())

A = list(map(int,input().split()))
sum = 0
c = collections.Counter(A)
c = c.most_common()
if len(c) > k:
  a = len(c)-k
  c = c[-a:]
  for i in range(a):
    sum += c[i][1]
  print(sum)
else:
  print(0)

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

A = list(map(int,input().split()))
sum = 0
import collections

c = collections.Counter(A)
c = c.most_common()
for i in range(n):
  if len(c) > k:
    sum += c[-1][1]
    c = c[:-1]
  else:
    break
print(sum)
Problem p03547 (python)

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

if a<b:
  print("<")
elif a>b:
  print(">")
else:
  print("=")

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

if a<b:
  print("<")
elif a>b:
  print(">")
else:
  print("=")
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
score = 0
L = []
for i in range(len(s)-len(t)+1):
  k = s
  cut = k[i:i+len(t)]
  for j in range(len(t)):
    if cut[j] == t[j] or cut[j] =="?":
      score += 1
  if score == len(t):
    
    k = k[:i] + t + k[i+len(t):]
    L.append(k.replace("?","a"))
  score = 0
if L == []:
  print("UNRESTORABLE")
else:
  L = sorted(L)
  print(L[0])

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
score = 0
L = []
for i in range(len(s)-len(t)+1):
  cut = s[i:i+len(t)]
  for j in range(len(t)):
    if cut[j] == t[j] or cut[j] =="?":
      score += 1
  if score == len(t):
    s = s[:i] + t + s[i+len(t):]
    L.append(s.replace("?","a"))
  score = 0
if L = []:
  print("UNRESTORABLE")
else:
  L = sorted(L)
  print(L[0])
Problem p03679 (python)

Fixed submission:
x,a,b=(int(i) for i in input().split())
c = b-a
if c <= 0:
  print('delicious')
elif c <= x:
  print('safe')
else:
  print('dangerous')

Buggy submission (verdict: Runtime Error):
x,a,b=(int(i) for i in input().split())
c = b-c
if c <= 0:
  print('delicious')
elif c <= x:
  print('safe')
else:
  print('dangerous')

Buggy submission (verdict: Runtime Error):
x,a,b=(int(i) for i in input().split())
c = b-c
if c <= 0:
  print('delicious')
elif c < x:
  print('safe')
else:
  print('dangerous')
Problem p03680 (python)

Fixed submission:
n=int(input())
li = []
for i in range(n):
  li += [int(input())]
x = li[0]
if x == 2:
    print(1)
    exit()
ans = -1
count=0
for i in range(n):
  x = li[x-1]
  count +=1
  if x == 2:
    print(count+1)
    exit()
print(-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
li=[int(i) for i in input().split()]
x = li[0]
ans = -1
count=0
for i in range(n):
  x = li[x-1]
  if x == 2:
    ans = count+1
    break
  count +=1
print(ans)
Problem p03697 (python)

Fixed submission:
a,b = (int(i) for i in input().split())
if a+b >= 10:
  print('error')
else:
  print(a+b)

Buggy submission (verdict: Runtime Error):
n=int(input())
li = []
for i in range(n):
  li += [int(input())]
x = li[0]
ans = -1
count=0
for i in range(n):
  x = li[x-1]
  count +=1
  if x == 2:
    print(count+1)
    exit()
print(-1)
Problem p03698 (python)

Fixed submission:
s = input()
if len(s) == len(set(s)):
  print('yes')
else :
  print('no')

Buggy submission (verdict: Runtime Error):
s = input()
ns = sorted(s)
ans = 'yes'
for i in range(len(s)):
  if s[i] == s[i+1]:
    ans = 'no'
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ns = sorted(s)
ans = yes
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    ans = no
print(ans)