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

Fixed submission:

K, X = map(int, input().split())

if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

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

ans = 0
mod = 10**9 + 7

for l in range(N):
    r = N - l - 1
    if r > 0:
        ans += C[l] * (pow(2, r-1, mod) * r + pow(2, r, mod)) * pow(2, l, mod)
    else:
        ans += C[l] * (pow(2, r, mod)) * pow(2, l, mod)
        
print(int(ans * pow(2, N, mod)) % mod)
Problem p02813 (python)

Fixed submission:
from itertools import permutations

N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

data = P.copy()
data.sort()

for idx, i in enumerate(list(permutations(data, N))):
    if list(i) == P:
        a = idx
    if list(i) == Q:
        b = idx

print(abs(a-b))

Buggy submission (verdict: Runtime Error):
from itertools import permutations

N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

data = P.copy()
data.sort()

for idx, i in enumerate(list(permutations(data, N))):
    if list(i) == P:
        a = idx
    if list(i) == Q:
        b = idx

print(abs(a-b))
Problem p02814 (python)

Fixed submission:
from functools import reduce
import sys

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


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

def gcd(a, b):
    import fractions
    return fractions.gcd(a, b)


def temp(a):
    return int(a * 0.5)

max_a = max(A)

i = 0
while True:
    num = int((i+0.5) * max_a)
    if num > M:
        print(0)
        sys.exit()

    found = True
    for a in A:
        if int(num - 0.5 * a) % a != 0:
            found = False
            break
    if found:
        ans = 1
        break
    i += 1

aa = reduce(lcm, A)

ans += (M - num) // aa

print(int(ans))

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

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


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

def gcd(a, b):
    import math
    return math.gcd(a, b)


def temp(a):
    return int(a * 0.5)

max_a = max(A)

i = 0
while True:
    num = int((i+0.5) * max_a)
    if num > M:
        print(0)
        sys.exit()

    found = True
    for a in A:
        if int(num - 0.5 * a) % a != 0:
            found = False
            break
    if found:
        ans = 1
        break
    i += 1

aa = reduce(lcm, A)

ans += (M - num) // aa

print(int(ans))
Problem p02913 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# E
# 文字列比較をローリングハッシュを用いると高速

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

n = int(input())
s = input()[:-1]
# s = list(map(ord, list(input()[:-1])))
# print(s)

lb = 0
ub = n//2 + 1


def check(len):
    for l1 in range(n-len):
        for l2 in range(l1+len, n-len+1):
            if s[l1:l1+len] == s[l2:l2+len]:
                return True
    return False


mod = 10**9+7
base = 1234
power = [1]*(n+1)
for i in range(1, n+1):
    power[i] = power[i-1]*base%mod


def check2(m):
    res = 0
    for i in range(m):
        res+=s[i]*power[m-i-1]
        res%=mod

    dic = {res: 0}
    # defaultdictが早い
    # dic = defaultdict(int)
    # dic[res] = 0

    for i in range(n-m):
        res = ((res-s[i]*power[m-1])*base
                             +s[i+m])%mod
        if res in dic.keys():
            index = dic[res]
            if index +m<=i+1:
                return True
        else:
            dic[res] = i+1
    return False


def check3(m):
    dic = {}
    for i in range(n-m+1):
        s_ = s[i:i+m]
        if s_ in dic.keys():
            if dic[s_]+m<=i:
                return True
        else:
            dic[s_] = i
    return False


while ub > lb+1:
    x = (lb + ub)//2
    if check3(x):
        lb = x
    else:
        ub = x
    # print(lb, ub)


'''
print(3, check(3))
print(4, check(4))
print(5, check(5))
'''

print(lb)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# E
# 文字列比較をローリングハッシュを用いると高速

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

n = int(input())
s = list(map(ord, list(input()[:-1])))
# print(s)

lb = 0
ub = n//2 + 1


def check(len):
    for l1 in range(n-len):
        for l2 in range(l1+len, n-len+1):
            if s[l1:l1+len] == s[l2:l2+len]:
                return True
    return False


mod = 10**9+7
base = 1234
power = [1]*(n+1)
for i in range(1, n+1):
    power[i] = power[i-1]*base%mod

def check2(m):
    # defaultdictが早い
    res = 0
    for i in range(m):
        res+=s[i]*power[m-i-1]
        res%=mod
    dic = defaultdict(int)
    dic[res] = 0

    for i in range(n-m):
        res = ((res-s[i]*power[m-1])*base
                             +s[i+m])%mod
        if res in dic.keys():
            index = dic[res]
            if index +m<=i+1:
                return True
        else:
            dic[res] = i+1
    return False


def check3(m):
    dic = {}
    for i in range(n-m+1):
        s = s[i:i+m]
        if s in dic.keys():
            if dic[s]+m<=i:
                return True
        else:
            dic[s] = i
    return False


while ub > lb+1:
    x = (lb + ub)//2
    if check3(x):
        lb = x
    else:
        ub = x
    # print(lb, ub)


'''
print(3, check(3))
print(4, check(4))
print(5, check(5))
'''

print(lb)
Problem p02953 (python)

Fixed submission:
N=int(input())
l=list(map(int,input().split()))
l[0]-=1

if N==1:
    print("Yes")
else:
    for i in range(N-1):
        if l[i]<l[i+1]:
            l[i+1]-=1
            continue
        elif l[i]>l[i+1]:
            print("No")
            break
        else:
            pass
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
N=int(input())
l=list(map(int,input().split()))
if N==1:
    print("Yes")
elif N==2:
    if l[1]-l[0]<-2:
        print("No")
    else:
        print("Yes")
else:
    for i in range(N-1):
        if l[i+1]-l[i]<-2 or l[i]>l[i+1]>l[i+2]:
            print("No")
            break
        else:
            continue
    else:
        print("Yes")
Problem p03625 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split(' ')))
x=0
y=0
a.sort()
a.reverse()
for i in range(len(a)-1):
    if a[i]==a[i+1]:
        x=a[i]
        p=i+1
        break
if x!=0:
    for i in range((p+1),len(a)-1):
        if a[i]==a[i+1]:
            y=a[i]
            break
print(x*y)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n;
    cin>>n;
    ll arr[n];
    map<ll,ll, greater<ll>>mp;
    for(ll i=0; i<n; i++ )
    {
        cin>>arr[i];
        mp[arr[i]]++;
    }
    ll c=0;
    ll ar=1;
    ll f=0;
    for(auto it=mp.begin(); it!=mp.end(); ++it)
    {
        ll s=it->second;
        if(c==0)
        {
            if(s>=4)
            {
                cout<<it->first*it->first<<endl;
                f=1;
                break;
            }
        }
        if(s>=2)
        {
            ar=ar*it->first;
            c++;
            if(c==2)
            {
                break;
            }
        }
    }
    if(c!=2&&f==0)
    {
        cout<<0<<endl;
    }
    else if(c==2&&f==0)
    {
        cout<<ar<<endl;
    }

}

Buggy submission (verdict: Runtime Error):
n=int(input()) a=list(map(int,input().split(' '))) x=0 y=0 a.sort() a.reverse() for i in range(len(a)-1): if a[i]==a[i+1]: x=a[i] p=i+1 break if x!=0: for i in range((p+1),len(a)-1): if a[i]==a[i+1]: y=a[i] break print(x*y)
Problem p03262 (python)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


inputs = input().strip().split()

N  = int(inputs[0])
X  = int(inputs[1])

xi = list(map(lambda x: abs(X - int(x)), input().strip().split()))

if N == 1:
    print(xi[0])
else:
    a = xi[0]
    b = xi[1]

    nx = gcd(a, b)

    for i in range(2, len(xi)):
        nx = gcd(nx, xi[i])     

    print(nx)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    return gcd(b, a % b)


inputs = input().strip().split()

N  = int(inputs[0])
X  = int(inputs[1])

xi = list(map(lambda x: abs(X - int(x)), input().strip().split()))

if N == 1:
    print(xi[0])
else:
    a = xi[0]
    b = xi[1]

    nx = gcd(a, b)

    for i in range(2, len(xi)):
        nx = gcd(nx, xi[i])     

    print(nx)
Problem p03280 (python)

Fixed submission:
inputs = input().strip().split()

yoko = int(inputs[0])
tate = int(inputs[1])

print((yoko - 1) * (tate - 1))

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

yoko = int(inputs[0])
tate = int(inputs[1])

print((yoko - 1) * (tate - 1))
Problem p03288 (python)

Fixed submission:
inputs = input()
R = int(inputs)

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
inputs  input()
R = int(inputs)

if R < 1200:
    print("ARC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")
Problem p03567 (python)

Fixed submission:
inputs = input()

x = list(inputs)

flag = False
for i in range(len(x) - 1):
    if x[i] == 'A' and x[i+1] == 'C':
        flag = True

if flag:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import itertools

inputs = input()
N = int(inputs)


inputs = input().split()
A = map(lambda x: int(x), inputs)

count = 1
for i in A:
    if i % 2 == 0:
        count = count * 2
        
print(3**N - count )

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

x = list(inputs)

flag = False
for i in range(len(x) - 1):
    if x[i] == 'A' and x[i+1] == 'C'
        flag = True

if flag:
    print('Yes')
else:
    print('No')

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

inputs = list(inputs)

flag = False
for i in range(len(inputs) - 1):
    if inputs[i] == 'A' and inputs[i+1] == 'C'
        flag = True
        
if flag:
    print('Yes')
else:
    print('No')
Problem p03569 (python)

Fixed submission:
inputs = input()

a = inputs

ans = 0
while len(a) > 1:
    if a[0] == a[-1]:
        a = a[1:-1]
    elif a[0] == 'x' and a[-1] != 'x':
        ans += 1
        a += 'x'
    elif a[0] != 'x' and a[-1] == 'x':
        ans += 1
        a = 'x' + a
    elif a[0] != a[-1]:
        ans = -1
        break
        
print(ans)

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

a = inputs

ans = 0
while len(a) > 1:
    if a[0] == a[-1]:
        a = a[1:-1]
    if a[0] == 'x' and a[-1] != 'x':
        ans += 1
        a += 'x'
    if a[0] != 'x' and a[-1] == 'x':
        ans += 1
        a = 'x' + a
    if a[0] != a[-1]:
        ans = -1
        break
        
print(ans)
Problem p03573 (python)

Fixed submission:
inputs=input().split()
A = int(inputs[0])
B = int(inputs[1])
C = int(inputs[2])

if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
puts=input().split()
A = int(inputs[0])
B = int(inputs[1])
C = int(inputs[2])

if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
inputs=input()
A = int(inputs[0])
B = int(inputs[1])
C = int(inputs[2])

if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)
Problem p03574 (python)

Fixed submission:
inputs = input().split()
H = int(inputs[0])
W = int(inputs[1])

grid = []

grid.append('.'*W+'..')
for i in range(H):
    inputs = input().strip()
    inputs = '.' + inputs + '.'
    grid.append(inputs)
grid.append('.'*W+'..')


dx = [1,1,1,0,-1,-1,-1,0]
dy = [1,0,-1,-1,-1,0,1,1]

ans = [[0 for x in range(W)] for y in range(H)]

for row in range(len(grid)-2):
    for col in range(W):
        if grid[row+1][col+1] == '#':
            ans[row][col] = '#'
        for i in range(8):
            if grid[row+1 + dy[i]][col+1 + dx[i]] == '#':
                if ans[row][col] != '#':
                    ans[row][col] += 1

for row in ans:
    print(''.join(map(lambda x: str(x), row)))

Buggy submission (verdict: Runtime Error):
inputs = input().split()
H = int(inputs[0])
W = int(inputs[1])

grid = []

grid.append('.'*W+'..')
for i in range(H):
    inputs = input().strip()
    inputs = '.' + inputs + '.'
    grid.append(inputs)
grid.append('.'*W+'..')


dx = [1,1,1,0,-1,-1,-1,0]
dy = [1,0,-1,-1,-1,0,1,1]

ans = [[0 for x in range(W)] for y in range(H)]

for row in range(len(grid)-2):
    for col in range(W):
        if grid[row+1][col+1] == '#':
            ans[row][col] = '#'
        for i in range(8):
            if grid[row+1 + dy[i]][col+1 + dx[i]] == '#':
                ans[row][col] += 1
                
for row in ans:
    print(''.join(map(lambda x: str(x), row)))
Problem p03578 (python)

Fixed submission:
inputs = input()
N = int(inputs)

inputs = input().split()

prob = {}
for i in inputs:
    if not int(i) in prob.keys():
        prob[int(i)] = 1
    else:
        prob[int(i)] += 1

inputs = input()
M = int(inputs)

inputs = input().split()
flag = True

for i in inputs:
    if not int(i) in prob.keys():
        flag = False
    else:
        prob[int(i)] -= 1
        if prob[int(i)] < 0:
            flag = False

if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
inputs = input()
N = int(inputs)

inputs = input().split()

prob = {}
for i in inputs:
    if not int(i) in prob.keys():
        prob[int(i)] = 1
    else:
        prob[int(i)] += 1

inputs = input()
M = int(inputs)

inputs = input().split()
flag = True

for i in inputs:
    prob[int(i)] -= 1
    if prob[int(i)] < 0:
        flag = False

if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
inputs = input()
N = int(inputs)

inputs = input().split()

prob = {}
for i in inputs:
    if not int(i) in prob.keys():
        prob[int(i)] = 1
    else:
        prob[int(i)] += 1

inputs = input()
M = int(inputs)

inputs = input().split()
flag = True

for i in inputs:
    prob[int(i)] -= 1
    if prob[int(i)] < 0:
        flag = False

if flag:
    print('YES')
else:
    print('NO')
Problem p03587 (python)

Fixed submission:
inputs = input()

print(inputs.count('1'))

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

print(inputs.count('1'))
Problem p03591 (python)

Fixed submission:
i = input()

if len(i) < 4:
    print('No')
elif i[:4] == 'YAKI':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
raw1 = input().split()
H = int(raw1[0])
W = int(raw1[1])

c = [0 for x in range(26)]

for i in range(H):
    raw = input()
    for j in range(W):
        c[ord(raw[j]) - 97] += 1

for i in range(len(c)):
    c[i] = c[i] % 4


if c.count(3) > 0 :
    print('No')
elif W%2 == 1 and H%2 == 1 and c.count(1) == 1 and c.count(2) == (H-1)/2 +(W-1)/2:
    print('Yes')
elif W%2 == 0 and H%2==0 and c.count(1)==0 and c.count(2) ==0:
    print('Yes')
elif W % 2 ==0 and  H % 2  == 1 and c.count(1) == 0 and c.count(2) == W/2:
    print('Yes')
elif W % 2 ==1 and  H % 2  == 0 and c.count(1) == 0 and c.count(2) == H/2:
    print('Yes')
else:
    print('No')
Problem p02696 (python)

Fixed submission:
import math
A, B, N = map(int, input().split())
def kansu(x):
  S = math.floor(A*x/B)
  return S
print(min(kansu(N), kansu(B-1)))

Buggy submission (verdict: Runtime Error):
import math
A, B, N = map(int, input().split())
def kansu(x):
  S = floor(A*x/B)
  return S
print(min(kansu(N), kansu(B)))

Buggy submission (verdict: Runtime Error):
import floor from math
A, B, N = map(int, input().split())
def kansu(x):
  S = floor(A*x/B)
  return S
print(min(kansu(N), kansu(B)))
Problem p02705 (python)

Fixed submission:
import math
R = int(input())
L = 2*R*math.pi
print(L)

Buggy submission (verdict: Runtime Error):
import math
R = int(input())
L = R*math.pie
print(L)
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
A = input().split()
B = [ ]
for i in range(M):
  B.append(int(A[i]))
if(sum(B) == N):
  print('0')
elif(sum(B) < N):
  print(N - sum(B))
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input().split()) for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input().split() for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input() for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

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

if(sum(A) = N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')
Problem p02713 (python)

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

Buggy submission (verdict: Runtime Error):
import numpy as np
K = int(input())
a = np.arange(a,K+1)
b = np.gcd.outer(np.gcd.outer(a, a), a)
print(np.sum(b))

Buggy submission (verdict: Runtime Error):
import numpy as np
K = int(input())
a = np.arrange(a,K+1)
b = np.gcd.outer(np.gcd.outer(a, a), a)
print(np.sum(b))

Buggy submission (verdict: Runtime Error):
from numpy import gcd
N = int(input())
a = np.arange(1,N+1)
b = np.gcd.outer(np.gcd.outer(a,a), a)
print(b)
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int,input().split()))
B = 0
for i in range(N):
  if(A[i] >= sum(A)/(4*M)):
    B += 1
if(B >= M):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int,input().split()))
B = 0
for i in A:
  if(A[i] >= 1/(4*M)):
    B += 1
if(B >= M):
  print('Yes')
else:
  print('No')
Problem p02730 (python)

Fixed submission:
S = list(input())
n = (len(S)-1)//2
m = 0
for i in range(n):
  if S[i] == S[-(i+1)] and S[i] == S[i+n+1]:
    continue
  else:
    print('No')
    m = 1
    break
if m < 1:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S = list(input())
n = (len(S)-1)//2
for i in range(n):
  if S[i] == S[-(i+1)] and S[i] == S[i+n+1]:
    continue
  else:
    print('No')
for i in 
print('Yes')
Problem p02748 (python)

Fixed submission:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
for i in range(M):
    xi = list(map(int, input().split()))
    c.append(a[xi[0]-1]+b[xi[1]-1]-xi[2])
print(min(min(a)+min(b), min(c)))

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [map(int, input().split()) for i in rangeM]
print(min(min(a)+min(b),a[x[0]-1]+b[x[1]-1]-x[2]))
Problem p02755 (python)

Fixed submission:
A, B = map(int, input().split())
A1 = A/0.08
A2 = (A+1)/0.08
B1 = B/0.1
B2 = (B+1)/0.1
C = 0
for i in range(1001):
  if A1 <= i < A2 and B1 <= i < B2:
    print(i)
    C = 1
    break
if C == 0:
  print(-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
C = A//0.08
if(C*0.1 = B):
  print(C)
else:
  print(-1)
Problem p02765 (python)

Fixed submission:
N,R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R+100*(10-N))

Buggy submission (verdict: Runtime Error):
N,R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R+100*(10-K))

Buggy submission (verdict: Runtime Error):
N, R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R-100*(10-K))
Problem p02786 (python)

Fixed submission:
H = int(input())
I = len(bin(H))-3
Sn = 2**(I+1)-1
print(Sn)

Buggy submission (verdict: Runtime Error):
H = int(input())
I = len(bin(H)-3)
Sn = 2**(I+1)-1
print(Sn)
Problem p02842 (python)

Fixed submission:
N = int(input())
A = N//1.08
if (N+1)//1.08 - N//1.08 == 0:
  print(':(')
else:
  print(int((N+1)//1.08))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = N//1.08
for i in range(100):
  if N/1.08 <= A+i <= (N+1)/1.08 and N/1.08 <= A+i:
    print(A+i)
  elif N/1.08 >= A+i:
  else:
    break
Problem p02899 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(list(), input().split()))
ans = [0]*n
for i in range(n):
  ans[A[i]-1] = i+1
ans.sort()
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input().split())
A = list(map(int, input().split()))
A_sort = sorted(A, reverse=True)
print(*A)
Problem p02909 (python)

Fixed submission:
N = ['Sunny', 'Cloudy', 'Rainy']
print(N[(N.index(input())+1)%3])

Buggy submission (verdict: Runtime Error):
N = ['Sunny', 'Cloudy', 'Rainy']
S = input()
print(N.index(N.index(input())%3))
Problem p02934 (python)

Fixed submission:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
print(1/sum(1/A))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array(list(map(int, input().solit())))
print(1/sum(1/A))
Problem p02952 (python)

Fixed submission:
N = int(input())
cnt = 0
for i in range(1,N+1):
  if len(str(i))%2 == 1:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 0
for i in range(N):
  if len(i)%2 == 1:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 0
for i in range(N):
  if len(i)%2 == 1:
    cnt += 0
print(cnt)
Problem p02958 (python)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N):
  if i+1 != P[i]:
    cnt += 1
print('NO' if cnt>2 else 'YES')

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N-1):
  if i+1 == P[i]:
    continue
  elif i+1 != P[i] and P[P[i]] == i+1:
    cnt = 1
  elif cnt == 0:
    print('NO')
    cnt = 2
    break
if cnt!=2:
  print('YES')

Buggy submission (verdict: Runtime Error):
 = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N-1):
  if i+1 == P[i]:
    continue
  elif i+1 != P[i] and P[P[i]] == i+1:
    cnt = 1
  elif cnt == 0:
    print('NO')
    cnt = 2
    break
if cnt!=2:
  print('NYES')

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N-1):
  if i+1 == P[i]:
    continue
  elif i+1 != P[i] and P[P[i]] == i+1:
    cnt = 1
  elif cnt == 0:
    print('NO')
    cnt = 2
    break
print('YES' if cnt!=2)
Problem p02969 (python)

Fixed submission:
print(int(input())**2*3)

Buggy submission (verdict: Runtime Error):
print(int(input()**2*3))
Problem p02993 (python)

Fixed submission:
S = list(input())
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
S = list(input())
if S[0]==s[1] or S[1]==S[2] or S[2]==S[3]:
  print('Bad')
else:
  print('Good')
Problem p03086 (python)

Fixed submission:
N = list(input())
dp = [0]*(len(N)+1)
for i in range(len(N)):
  if N[i] in'ACGT':
    dp[i] += 1
    dp[i+1] = dp[i]
  else:
    dp[i] = 0
print(max(dp))

Buggy submission (verdict: Runtime Error):
N = list(input())
N.append(0)
for i in range(len(N)-1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Buggy submission (verdict: Runtime Error):
N = list(input())
N.appnd('Z')
for i in range(len(N)-1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Buggy submission (verdict: Runtime Error):
N = list(input())
for i in range(len(N)+1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Buggy submission (verdict: Runtime Error):
N = list(input())
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Buggy submission (verdict: Runtime Error):
N = list(input)
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
print(max(N))