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

Fixed submission:
lst = [input() for i in range(2)]

n = int(lst[0])
s = lst[1]
t = ''

for i in range(n//2):
    t += s[i]

if n % 2 == 1:
    print('No')
elif t + t == s:
    print('Yes')
else:
    print('No')

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

lst[0] = int(lst[0])
n = lst[0]
s = lst[1]

if n % 2 == 1:
    print('NO')

t = ''

for i in range(0, n//2):
    t += s[i]

if t + t == s:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
lst = input().split()

lst[0] = int(lst[0])
n = lst[0]
s = lst[1]

if n % 2 == 1:
    print('NO')

t = ''

for i in range(0, n//2):
    t += s[i]

if t + t == s:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
lst = input().split()

lst[0] = int(lst[0])
n = lst[0]
s = lst[1]

if n % 2 == 1:
    print('NO')

t = ''

for i in range(0, n/2):
    t += s[i]

if t + t == s:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
lst = input().split()

n = lst[0]
n = int(n)
s = lst[1]

if n % 2 == 1:
    print('NO')

t = s[0, n/2 + 1]

if t + t == s:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
lst = (input().split())

n = lst[0]
n = int(n)
s = lst[1]

if n % 2 == 1:
    print('NO')

t = s[0, n/2 + 1]

if t + t == s:
    print('YES')
else:
    print('NO')
Problem p02557 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
d={}
for i in a:
  if i in d:
    d[i][0]+=1
  else:
    d[i]=[1,0]
for i in b:
  if i in d:
    d[i][0]+=1
    d[i][1]+=1
  else:
    d[i]=[1,1]
l=[]
for i in d:
  l.append([d[i][0],i,d[i][1]])
l.sort()
l.reverse()


if l[0][0]>n:
  print("No")
else:
  print("Yes")
  l.append(l[0])
  cc=0
  ansa=[]
  i=1
  while l[i][2]==0:
    i+=1
  j=i+1
  while j!=len(l) and l[j][2]==0:
    j+=1
  ic,jc=0,0
  for t in a:
    if t==l[0][1]:
      continue
    cc+=1
    if cc>n-l[0][0]:
      ansa.append(l[0][1])
    elif l[i][1]==t:
      ansa.append(l[j][1])
      jc+=1
      if jc==l[j][2]:
        j+=1
        while j!=len(l) and l[j][2]==0:
          j+=1
        jc=0
    else:
      ansa.append(l[i][1])
      ic+=1
      if ic==l[i][2]:
        i=j
        j+=1
        while j!=len(l) and l[j][2]==0:
          j+=1
        ic=jc
        jc=0
  ans=[]
  ii=0
  for t in a:
    if t==l[0][1]:
      ans.append(l[i][1])
      ic+=1
      if ic==l[i][2]:
        i=j
        j+=1
        while j!=len(l) and l[j][2]==0:
          j+=1
        ic=jc
        jc=0
    else:
      ans.append(ansa[ii])
      ii+=1
  print(" ".join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
d={}
for i in a:
  if i in d:
    d[i][0]+=1
  else:
    d[i]=[1,0]
for i in b:
  if i in d:
    d[i][0]+=1
    d[i][1]+=1
  else:
    d[i]=[1,1]
l=[]
for i in d:
  l.append([d[i][0],i,d[i][1]])
l.sort()
l.reverse()


if l[0][0]>n:
  print("No")
else:
  print("Yes")
  l.append(l[0])
  cc=0
  ansa=[]
  i=1
  while l[i][2]==0:
    i+=1
  j=i+1
  while l[j][2]==0:
    j+=1
  ic,jc=0,0
  for t in a:
    if t==l[0][1]:
      continue
    cc+=1
    if cc>n-l[0][0]:
      ansa.append(l[0][1])
    elif l[i][1]==t:
      ansa.append(l[j][1])
      jc+=1
      if jc==l[j][2]:
        j+=1
        while l[j][2]==0:
          j+=1
        jc=0
    else:
      ansa.append(l[i][1])
      ic+=1
      if ic==l[i][2]:
        i=j
        j+=1
        while l[j][2]==0:
          j+=1
        ic=jc
        jc=0
  ans=[]
  ii=0
  for t in a:
    if t==l[0][1]:
      ans.append(l[i][1])
      ic+=1
      if ic==l[i][2]:
        i=j
        j+=1
        while j!=len(l) and l[j][2]==0:
          j+=1
        ic=jc
        jc=0
    else:
      ans.append(ansa[ii])
      ii+=1
  print(" ".join(map(str,ans)))
Problem p02793 (python)

Fixed submission:
from copy import copy
def prime_table(n):
  n+=1
  table=[i if i%2 else 2 for i in range(n)]
  for i in range(3,n,2):
    if table[i]==i:
      for j in range(i*i,n,2*i):
        if table[j]==j:
          table[j]=i
  return table


def prime_fact(n,table):
  p=[]
  while n!=1:
    pp=table[n]
    p.append(pp)
    n//=pp
  r={}
  for i in p:
    if i in r:
      r[i]+=1
    else:
      r[i]=1
  return r



n=int(input())
t=prime_table(10**6)
a=list(map(lambda x:prime_fact(int(x),t),input().split()))

mx=copy(a[0])
for i in a[1:]:
  for j in i:
    if j in mx:
      mx[j]=max(mx[j],i[j])
    else:
      mx[j]=i[j]


sm=0
mod=10**9+7
for i in a:
  r=1
  for j in i:
    r=(r*pow(j,i[j],mod))%mod
  sm=(sm+pow(r,mod-2,mod))%mod

  
p=1
for i in mx:
  p=(p*pow(i,mx[i],mod))%mod

print((sm*p)%mod)

Buggy submission (verdict: Runtime Error):
inv=[0,1]
mod=10**9+7
for i in range(2,1000001):
  inv.append((m-inv[mod%i]*(m//i))%m)
Problem p03307 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if(n%2==1)n*=2
print(n)
Problem p02793 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)

Buggy submission (verdict: Runtime Error):
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;

inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main(){
    ll MOD = 1000000007;
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    vector<ll> A(N,0);
    REP(i,N){
        cin >> A[i];}
    ll c = A[0];
    for (auto e: A){
        c = lcm(e,c);
    }
    ll ans = 0;
    for (auto e: A){
        ans += c/e;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}
Problem p02948 (python)

Fixed submission:
import heapq

N, M = map(int,input().split())
J = [[] for k in range(M+1)]
for k in range(N):
    A, B = map(int,input().split())
    if A <= M:
        J[A].append(B)

Q = []
ans = 0
for d in range(1,M+1):
    for e in J[d]:
        heapq.heappush(Q,-e)
    if len(Q) > 0:
        ans += -heapq.heappop(Q)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
L = [list(map(int,input().split())) for k in range(N)]
L = sorted(L,key = lambda x: (-x[1],-x[0]))

ans = 0
c = 0
D = [1 for k in range(M+2)]
D[M+1] = 0
for k in range(N):
    if D[L[k][0]] == 1:
        D[M-c] = 0
        c += 1
        ans += L[k][1]
    if c == M:
        break
print(ans)
Problem p02990 (python)

Fixed submission:
import math
N, K = map(int,input().split())
MOD = 10**9 + 7

def nCr(n,r):
    if n <= 0 or r <= 0:
        return 1
    elif n-r < 0:
        return 0
    else:
        return (math.factorial(n)//(math.factorial(r)*math.factorial(n-r)))%MOD

for i in range(1,K+1):
    ans = 1
    b = K-i
    ans *= nCr(K-1,i-1)
    ans *= nCr(N-K+1,i)
    print(ans%MOD)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())
MOD = 10**9 + 7

def nCr(n,r):
    if n == 0 or r == 0:
        return 1
    else:
        return (math.factorial(n)//(math.factorial(r)*math.factorial(n-r)))%MOD

for i in range(1,K+1):
    ans = 1
    b = K-i
    ans *= nCr(K-1,i-1)
    ans *= nCr(N-K+1,i)
    print(ans%MOD)
Problem p03013 (python)

Fixed submission:
N, M = map(int,input().split())
dp = [0 for k in range(N+1)]
MOD = 10**9+7

if M == 0:
    if N == 1:
        print(1)
        exit(0)
    dp[0] = 1
    dp[1] = 1
    dp[2] = 1
    for k in range(2,N+1):
        dp[k] = dp[k-1] + dp[k-2]
        dp[k] %= MOD
    print(dp[N])
else:
    A = [int(input()) for k in range(M)]
    dp[0] = 1
    dp[1] = 1
    dp[2] = 1
    if N == 1:
        if M == 1:
            print(0)
        exit(0)
    else:
        t = 0
        if A[0] == 1:
            t += 1
            dp[1] = 0
        for k in range(2,N+1):
            if t < len(A) and A[t] == k:
                dp[k] = 0
                t += 1
            else:
                dp[k] = dp[k-1] + dp[k-2]
                dp[k] %= MOD
        print(dp[N])

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = [int(input()) for k in range(M)]
dp = [0 for k in range(N+1)]
MOD = 10**9+7

dp[0] = 1
dp[1] = 1
dp[2] = 1

t = 0
if A[0] == 1:
    t += 1
    dp[1] = 0

for k in range(2,N+1):
    if t < len(A):
        if A[t] == k:
            dp[k] = 0
            t += 1
        else:
            dp[k] = dp[k-1] + dp[k-2]
            dp[k] %= MOD
    else:
        dp[k] = dp[k-1] + dp[k-2]
        dp[k] %= MOD
print(dp[N])

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = [int(input()) for k in range(M)]
dp = [0 for k in range(N+1)]
MOD = 10**9+7

dp[0] = 1
dp[1] = 1
dp[2] = 1

t = 0
if A[0] == 1:
    t += 1
    dp[1] = 0

for k in range(2,N+1):
    if t < len(A) and A[t] == k:
        dp[k] = 0
        t += 1
    else:
        dp[k] = dp[k-1] + dp[k-2]
        dp[k] %= MOD
print(dp[N])
Problem p03038 (python)

Fixed submission:
N, M = map(int,input().split())
A = sorted(list(map(int,input().split())))
D = [list(map(int,input().split())) for k in range(M)]
D = sorted(D, key = lambda x: -x[1])

now = 0
for d in D:
    for k in range(now,now+d[0]):
        if now == N:
            break
        if A[k] < d[1]:
            A[k] = d[1]
            now += 1
        else:
            now = k
            break

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = sorted(list(map(int,input().split())))
D = [list(map(int,input().split())) for k in range(M)]
D = sorted(D, key = lambda x: -x[1])

now = 0
for d in D:
    for k in range(now,now+d[0]):
        if A[k] < d[1]:
            A[k] = d[1]
            now += 1
        else:
            now = k
            break
    if now == N:
        break
print(sum(A))
Problem p03045 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100010)

N, M = map(int,input().split())
E = [[] for k in range(N)]

for k in range(M):
    X, Y, Z = map(int,input().split())
    E[X-1].append(Y-1)
    E[Y-1].append(X-1)
G = [-1]*N

def dfs(now,group):
    if G[now] == -1:
        G[now] = group
        for tsugi in E[now]:
            dfs(tsugi,group)

ans = 0
for k in range(N):
    if G[k] == -1:
        dfs(k,ans)
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
E = [[] for k in range(N)]

for k in range(M):
    X, Y, Z = map(int,input().split())
    E[X-1].append(Y-1)
    E[Y-1].append(X-1)
G = [-1]*N

def dfs(now,group):
    if G[now] == -1:
        G[now] = group
        for tsugi in E[now]:
            dfs(tsugi,group)

ans = 0
for k in range(N):
    if G[k] == -1:
        dfs(k,ans)
        ans += 1
print(ans)
Problem p03209 (python)

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

def keisan(n,x):
    if n == 1:
        if x <= 1:
            return 0
        elif 2 <= x <= 4:
            return x-1
        else:
            return 3
    if x <= 1:
        return 0
    elif 1 < x <= 2**(n+1) - 2:
        return keisan(n-1,x-1)
    elif x == 2**(n+1) - 1:
        return 2**n
    else:
        return 2**n + keisan(n-1,x-(2**(n+1)-1))

print(keisan(N,X))

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

def keisan(n,x):
    if x <= 1:
        return 0
    elif 1 < x <= 2**(n+1) - 2:
        return keisan(n-1,x-1)
    elif x == 2**(n+1) - 1:
        return 2**n
    else:
        return 2**n + keisan(n-1,x-(2**(n+1)-1))

print(keisan(N,X))
Problem p02557 (python)

Fixed submission:
from collections import Counter
import heapq

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

cur = n-1
bit = 1
for i in range(n):
    if a[i] == b[i]:
        while a[i]==b[cur] or a[cur]==b[i]:
            if cur == 0:
                bit = -1
            if bit == -1 and cur == n-1:
                print('No')
                exit(0)
            cur-=bit
        b[i], b[cur] = b[cur], b[i]
print('Yes')
print(' '.join(list(map(str, b))))

Buggy submission (verdict: Runtime Error):
from collections import Counter
import heapq

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

cur = n-1
bit = 1
for i in range(n):
    if a[i] == b[i]:
        while a[i]==b[cur]:
            cur-=bit
            if cur == 0:
                bit = -1
            if bit == -1 and cur == n-1:
                print('No')
                exit(0)
        b[i], b[cur] = b[cur], b[i]
print('Yes')
print(' '.join(list(map(str, b))))
Problem p02598 (python)

Fixed submission:
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

"""
目標とする最長の長さをxとして、それをk回で達成
できるか
aをソートしたので、途中でkを超えることが判明したら打ち切る
"""

def isOK(x):
    cnt = 0
    for _a in a:
        if _a<=x:
            return True
        try:
            cnt+=_a//x
        except:
            return False
        if cnt>k:
            return False
    return True

ng = 0
ok = 10**9+1

while abs(ng-ok)>0.1:
    mid = (ng+ok)/2
    if isOK(mid):
        ok = mid
    else:
        ng = mid
    if ok < 1:
        break
ok = ceil(ok)
if isOK(ok-1):
    print(ok-1)
else:
    print(ok)

Buggy submission (verdict: Runtime Error):
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

"""
目標とする最長の長さをxとして、それをk回で達成
できるか
aをソートしたので、途中でkを超えることが判明したら打ち切る
"""

def isOK(x):
    cnt = 0
    for _a in a:
        if _a<=x:
            return True
        cnt+=_a//x
        if cnt>k:
            return False
    return True

ng = 0
ok = 10**9+1

while abs(ng-ok)>0.1:
    mid = (ng+ok)/2
    if isOK(mid):
        ok = mid
    else:
        ng = mid
ok = ceil(ok)
if isOK(ok-1):
    print(ok-1)
else:
    print(ok)
Problem p02711 (python)

Fixed submission:
n = input()
if '7' in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
    DVSR = 1000000007
    def POW(x, y): return pow(x, y, DVSR)
    def INV(x, d=DVSR): return pow(x, d - 2, d)
    def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
    def LI(): return [int(x) for x in input().split()]
    def LF(): return [float(x) for x in input().split()]
    def LS(): return input().split()
    def II(): return int(input())
    
    n = II()
    n = str(n)
    if '7' in n:
        print('Yes')
    else:
        print('No')
Problem p02771 (python)

Fixed submission:
abc = map(int, input().split())
 
abc_set = set(abc)

if len(abc_set) == 2:
  print('Yes')
else:
  print('No')

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

p = []
for i in range(N-1):
  for j in range(i+1, N):
    p.append(i*j)

print(p.sorted[K])

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

f = False
for a in aa:
  if a % 2 == 0:
    if (a % 3 != 0) and (a % 5 != 0):
      print('DENIED')
      f = True
      break
if not f:
  print('APPROVED')

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

f = False
for a in aa:
  if a % 2 == 0:
    if a % 3 != 0:
      print('DENIED')
      f = True
      break
    elif a % 5 != 0:
      print('DENIED')
      f = True
      break
if not f:
  print('APPROVED')

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

abc_set = set(abc)

if len(set) == 2:
  print('Yes')
else:
  print('No')
Problem p02773 (python)

Fixed submission:
from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

max_count = max(c.values())

out_k = []
for k, v in c.items():
  if v == max_count:
    out_k.append(k)
out_k.sort()
for k in out_k:
  print(k)

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

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

max_count = max(c.values())

out_k = []
for k, v in c.items():
  if v == max_count:
    out_k.append(k)
sort(out_k)
for k in out_k:
  print(k)
Problem p02777 (python)

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

d = {a: an, b:bn}
d[s] -= 1

print("{} {}".format(d[a], d[b]))

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

    d = {a: an, b:bn}
    d[s] -= 1

    print("{} {}".format(d[a], d[b]))
Problem p02829 (python)

Fixed submission:
a = int(input()); b=int(input())
ans = [1, 2, 3]
ans.remove(a)
ans.remove(b)
print(ans[0])

Buggy submission (verdict: Runtime Error):
a = int(input());b = int(input())
ans = [1, 2, 3].delete(a).delete(b)
print(ans[0])
Problem p02933 (python)

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

if a >= 3200:
    print(s)
else:
    print("red")

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

if a => 3200:
    print(s)
else:
    print("red")
Problem p03307 (python)

Fixed submission:
n = int(input())
if n % 2 == 0:
  print(n)
else:
  print(n*2)

Buggy submission (verdict: Runtime Error):
n = int(input().split())
if n % 2 == 0:
  print(n)
else:
  print(n*2)
Problem p03634 (python)

Fixed submission:
from collections import deque
import sys
sys.setrecursionlimit(10**7)
n = int(input())
g = [[] for i in range(n)]
for i in range(n-1):
    a, b, c = map(int, input().split())
    a-=1; b-=1
    g[a].append((b, c))
    g[b].append((a, c))
q, k = map(int, input().split())

# 前処理
dist = [-1] * n

def dfs(st, depth=0):
    dist[st] = depth
    for to, c in g[st]:
        if dist[to] >= 0: continue
        dfs(to, depth+c)

dfs(k-1, 0)

for i in range(q):
    x, y = map(int, input().split())
    x-=1; y-=1
    print(dist[x]+dist[y])

Buggy submission (verdict: Runtime Error):
from collections import deque
n = int(input())
g = [[] for i in range(n)]
for i in range(n-1):
    a, b, c = map(int, input().split())
    a-=1; b-=1
    g[a].append((b, c))
    g[b].append((a, c))
q, k = map(int, input().split())

# 前処理
dist = [-1] * n

def dfs(st, depth=0):
    dist[st] = depth
    for to, c in g[st]:
        if dist[to] >= 0: continue
        dfs(to, depth+c)

dfs(k-1, 0)

for i in range(q):
    x, y = map(int, input().split())
    x-=1; y-=1
    print(dist[x]+dist[y])
Problem p03834 (python)

Fixed submission:
print(input().replace(',', ' '))

Buggy submission (verdict: Runtime Error):
pritn(input().replace(',', ' '))
Problem p02729 (python)

Fixed submission:
from math import factorial

def choose(n, k):
    if n < k:
        return 0
    else:
        return factorial(n) // factorial(k) // factorial(n - k)

n, m = map(int, input().split())
print(choose(n, 2) + choose(m, 2))

Buggy submission (verdict: Runtime Error):
from math import factorial

def choose(n, k):
    if n <= 0:
        return 0
    else:
        return factorial(n) // factorial(k) // factorial(n - k)

n, m = map(int, input().split())
print(choose(n, 2) + choose(m, 2))
Problem p02773 (python)

Fixed submission:
d = {}
max_value = 1
n = int(input())
for i in range(n):
    t = input()
    if t in d.keys():
        d[t] += 1
        if d[t] > max_value:
            max_value = d[t]
    else:
        d.setdefault(t, 1)
#print(f"d = {d}")
#print(f"max_value = {max_value}")
#print(f"d.keys() = {d.keys()}")
#print(f"d.values() = {d.values()}")
d = sorted(d.items())
#print(d)
for k, v in d:
    if v == max_value:
        print(k)

Buggy submission (verdict: Runtime Error):
import numpy as np
def f(n, a):
    index, count = np.unique(a, return_counts=True)
    mx = max(count)
    for s in index[count == mx]:
        print(s)
    print(mx)

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = input()
f(n, a)

Buggy submission (verdict: Runtime Error):
import numpy as np
def f(n, a):
    index, count = np.unique(a, return_counts=True)
    mx = max(count)
    for s in index[count == mx]:
        print(s)
    print(mx)

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = input()
f(n, a)

Buggy submission (verdict: Runtime Error):
import numpy as np
def f(n, a):
    index, count = np.unique(a, return_counts=True)
    mx = max(count)
    for s in index[count == mx]:
        print(s)

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = input()
f(n, a)
Problem p02779 (python)

Fixed submission:
import numpy as np
def f(n, a):
    if len(np.unique(a)) == n:
        print('YES')
    else:
        print('NO')

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

f(n, a)

Buggy submission (verdict: Runtime Error):
def f(n, a):
    if len(np.unique(a)) == a:
        print('YES')
    else:
        print('NO')

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

f(n, a)

Buggy submission (verdict: Runtime Error):
import numpy as np
def f(n, a):
    b = np.subtract.outer(a, a)
    c = np.triu(np.ones_like(b), 1) > 0
    if any(b[c] == 0):
        print('NO')
    else:
        print('YES')


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

f(n, a)
Problem p02970 (python)

Fixed submission:
# ABC001A

n, d = map(int, input().split())
print(-(-n // (2 * d + 1)))

Buggy submission (verdict: Runtime Error):
# ABC001A

n, d = map(int, input().split())
print(sp.ceil(n / (2 * d + 1)))
Problem p03042 (python)

Fixed submission:
# ABC126B

s = int(input())
aa = s // 100
bb = s %  100
if 1 <= aa and aa <= 12:
    if 1 <= bb and bb <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= bb and bb <= 12:
        print('YYMM')
    else:
        print('NA')

Buggy submission (verdict: Runtime Error):
# ABC126B

s = input()
aa = s // 100
bb = s %  100
if 1 <= aa and aa <= 12:
    if 1 <= bb and bb <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= bb and bb <= 12:
        print('YYMM')
    else:
        print('NA')
Problem p03073 (python)

Fixed submission:
# ABC124C

s = input()
s = [int(t) for t in list(s)]
repaint = 0
for i in range(1, len(s)):
    if s[i-1] == s[i]:
        repaint += 1
        s[i] = 1 - s[i]
print(repaint)

Buggy submission (verdict: Runtime Error):
# ABC124C

s = input()
s = [int(t) for t in list(s)]
repaint = 0
for i in range(1, len(s)):
    if s[i-1] == s[i]:
        repaint += 1
        s[i] = 1 - s[i]
paint(repaint)
Problem p03075 (python)

Fixed submission:
# ABC123A

import numpy as np
a = [0] * 5
for i in range(5):
    a[i] = int(input())
k = int(input())
a = np.array(a)
print(":(" if np.sum(abs(np.subtract.outer(a, a)) > k) > 0 else "Yay!")

Buggy submission (verdict: Runtime Error):
# ABC123A

import numpy as np
a = [0] * 5
for i in range(5):
    a[i] = int(input())
k = int(input())
a = np.array(a)
print(":(" if np.sum(abs(np.subtract.outer(a, a)) > k) > 0 else "Yay!")

ABC123A([1,2,4,8,9], 15)
ABC123A([15, 18, 26, 35, 36], 18)
Problem p03986 (python)

Fixed submission:
x = input()
while 'ST' in x:
    x = x.replace('ST', '')
    n = len(x) // 2
    if ('T' not in x[:n]) and ('S' not in x[n:]):
        x = ''
        break
print(len(x))

Buggy submission (verdict: Runtime Error):
# AGC005A

# TLE 2/13
x = input()
while 'ST' in x:
    x = x.replace('ST', '', 1)
print(len(x))