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

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

sa = 10000
for i in range(n):
    if sa > abs(a - (t - array[i] * 0.006)):
        sa = abs((a - (t - array[i] * 0.006)))
        ans = i + 1

print(ans)

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

sa = 60
for i in range(n):
    if sa > a - (t - array[i] * 0.006):
        sa = a - (t - array[i] * 0.006)
        ans = i + 1

print(ans)

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

sa = 60
for i in range(n):
    if sa > a - (t - array[i] * 0.006):
        sa = a - (t - array[i] * 0.006)
        ans = i

print(ans)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")

Buggy submission (verdict: Runtime Error):
i = list(map(int, input().split()))
if i[0]　% i[1] == 0:
    print "Even"
else:
    print "Odd"
Problem p03471 (python)

Fixed submission:
# 自分の回答
n, y = map(int, input().split())

for i in range(n + 1):
    for j in range(n - i + 1):
            if(10000 * i + 5000 * j + 1000 * (n - i - j) == y):
                print(i, j, n - i - j)
                exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
# 自分の回答
n, y = map(int, input().split())

flag = False
for i in range(n + 1):
    for j in range(n - i + 1):
            if(10000 * i + 5000 * j + 1000 * (n - i - j) == y):
                print(i, j, k)
                flag = True
                exit()

if not flag:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
# 自分の回答
n, y = map(int, input().split())

flag = False
for i in range(n):
    for j in r6ange(n-i):
        for k in range(n-i-j):
            if(10000 * i + 5000 * j + 1000 * k == y):
                print(i, j, k)
                flag = True
                break
        if flag:
            break
    if flag:
        break

if not flag:
    print(-1, -1, -1)
Problem p03493 (python)

Fixed submission:
s = input()
count = 0
if(s[-1] == '1'):
    count += 1
if(s[-2] == '1'):
    count += 1
if(s[-3] == '1'):
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
# 自分の回答
n = int(input())
array = list(map(int, input().split()))
flg = 0
count = 0
while(flg == 0):
    j = 0
    for j in range(n):
        if(array[j] % 2 == 0):
            array[j] /= 2
            j += 1
            if(j == (n -1)):
                count += 1
        else:
            flg = 1
            break
print(count)

Buggy submission (verdict: Runtime Error):
# 自分の回答
n = int(input())
array = list(map(int, input().split()))
flg = 0
count = 0
while(flg == 0):
    j = 0
    for j in range(n):
        if(array[j] % 2 == 0):
            j += 1
            array[j] /= 2
            if(j == (n -1)):
                count += 1
        else:
            flg = 1
            break
print(count)

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
Problem p03494 (python)

Fixed submission:
# 自分の回答
n = int(input())
array = list(map(int, input().split()))
flg = 0
count = 0
while(flg == 0):
    j = 0
    for j in range(n):
        if(array[j] % 2 == 0):
            array[j] /= 2
            j += 1
            if(j == (n -1)):
                count += 1
        else:
            flg = 1
            break
print(count)

Buggy submission (verdict: Runtime Error):
i = list(map(int, input().split(',')))
flg = 0
count = 0
while(flg == 0):
    if(i[0] % 2 == 0 and i[1] % 2 == 0 and i[2] % 2 == 0):
        i[0] /= 2
        i[1] /= 2
        i[2] /= 2
        count += 1
    else:
        flg = 1

print(count)
Problem p02953 (python)

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

for i in range(1,N):
    if H[i-1] > H[i]:
        print("No")
        exit()

    if H[i-1] < H[i]:
        H[i] -= 1

print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ok = True
for i in range(N - 2):
    if (H[i] > H[i + 1] and H[i + 1] > H[i + 2]) or H[i]-H[i+1]>1:
        ok = False
if H[-2] - H[-1] > 1:
    ok = False
if ok:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ok = True
for i in range(N - 2):
    if (H[i] > H[i + 1] and H[i + 1] > H[i + 2]) or H[i]-H[i+1]>1:
        ok = False
if H[-2] - H[-1] > 1:
    of = False
if ok:
    print("Yes")
else:
    print("No")
Problem p03076 (python)

Fixed submission:
nums = [int(input()) for _ in range(5)]
l = list(map(int,filter(lambda x:x !="0",[str(n)[-1] for n in nums])))
r = [(n+9) // 10 for n in nums]
print(sum(r)*10-(10-min(l))) if len(l) != 0 else print(sum(r)*10)

Buggy submission (verdict: Runtime Error):
nums = [int(input()) for _ in range(5)]
l = map(int,filter(lambda x:x !="0",[str(n)[-1] for n in nums]))
r = [(n+9) // 10 for n in nums]
print(sum(r)*10-(10-min(l))) if len(l) != 0 else print(sum(r)*10)

Buggy submission (verdict: Runtime Error):
nums = [int(input()) for _ in range(5)]
l = map(int,filter(lambda x:x !="0",[str(n)[-1] for n in nums]))
r = [(n+9) // 10 for n in nums]
print(sum(r)*10-(10-min(l)))
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
AC = []
ans = []
AC.append(0)
for i in range(1,N):
    if S[i - 1] == "A" and S[i] == "C":
        AC.append(AC[i - 1] + 1)
    else:
        AC.append(AC[i - 1])
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(AC[r - 1] - AC[l - 1])
print("\n".join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AC = []
ans = []
AC.append(0)
for i in range(1,N+1):
    if S[i - 1] == "A" and S[i] == "C":
        AC.append(AC[i - 1] + 1)
    else:
        AC.append(AC[i - 1])
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(AC[r - 1] - AC[l - 1])
print("\n".join(map(str,ans)))
Problem p03136 (python)

Fixed submission:
#ABC117 B
N = int(input())
Ln = list(map(int, input().split()))
Ln.sort(reverse=True)
max = Ln[0]
sum = sum(Ln)
    
if max < sum - max:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC117 B
N = int(input())
Ln = list(map(int, input().split()))
Ln.sort()
max = L[0]
sum = sum(ln)
    
if max < max - sum:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC117 B
N = int(input())
Ln = [input() for i in range(N)]
Ln.sort()
max = L[0]
sun = 0
for i in N-1:
    sum += L[i+1]
    
if max < sum:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC117 B
N = int(input()
Ln = [input() for i in range(N)]
Ln.sort()
max = L[0]
sun = 0
for i in N-1:
sum += L[i+1]
    
if max < sum:
    print("Yes")
else:
    print("No")
Problem p03145 (python)

Fixed submission:
#ABC116 A
AB, BC, CA = list(map(int, input().split()))
print(AB*BC//2)

Buggy submission (verdict: Runtime Error):
#ABC117 A
T, X = map(int, input().split())
print(T/X)
Problem p03273 (python)

Fixed submission:
#コピペコード
H, W = map(int, input().split())
a = [input() for _ in range(H)]
row = [False] * H
col = [False] * W
for i in range(H):
	for j in range(W):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True
 
for i in range(H):
	if row[i]:
		for j in range(W):
			if col[j]:
				print(a[i][j], end = '')
		print()

Buggy submission (verdict: Runtime Error):
#コピペコード
H, W = map(int, input().split())
a = [input() for _ in range(H)]
row = [False] * h
col = [False] * w
for i in range(h):
	for j in range(w):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True
 
for i in range(h):
	if row[i]:
		for j in range(w):
			if col[j]:
				print(a[i][j], end = '')
		print()
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
for s in S:
    if s == "1":
        if K == 1:
            print(1)
            break
        K -= 1
        continue
    print(s)
    break

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
for s in S:
    if s == "1":
        if K == 1:
            print(1)
            break
        k -= 1
        continue
    print(s)
    break
Problem p03285 (python)

Fixed submission:
#ABC105B
N = int(input())
flag = False
for i in range(30):
    for j in range(30):
        if i*4 + j*7 == N:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC105B
N = int(input())
OK = False
for i in range(N/4):
    for j in range(N/7):
        if i*4 + j*7 == N:
            OK = True
if OK:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC105B
N = int(input())
OK = False
for i in range(N/4):
    for j in range(N/7):
        if i*4 + j*7 == N:
            flag = True
if OK:
    print("Yes")
else:
    print("No")
Problem p03293 (python)

Fixed submission:
import sys
S = input()
T = input()
length = len(S)
for i in range(length):
    if S[length - i - 1 :] + S[: length - i - 1] == T:
        print("Yes")
        sys.exit(0)
print("No")

Buggy submission (verdict: Runtime Error):
import sys
S = input()
T = input()
length = len(S)
for i in range(length):
    if S[length - i - 1 :] + S[: length - i - 1] == T:
        print("Yes")
        sys.exit(1)
print("No")
Problem p03361 (python)

Fixed submission:
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
import sys
dxy = [(1,0),(0,1),(-1,0),(0,-1)]
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            flag = 0
            for dy,dx in dxy:
                if 0<= i+dy < H and 0 <= j+dx < W and s[i+dy][j+dx] == "#":
                    flag = 1
            if flag == 0:
                print("No")
                sys.exit(0)
print("Yes")

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
import sys
dxy = [(1,0),(0,1),(-1,0),(0,-1)]
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            flag = 0
            for dy,dx in dxy:
                if 0<= i+dy < W and 0 <= i+dx < H and s[i+dy][j+dx] == "#":
                    flag = 1
            if flag == 0:
                print("No")
                sys.exit(0)
print("Yes")
Problem p03378 (python)

Fixed submission:
N,M,X = map(int,input().split())
A = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for a in A:
    if X > a:
        ans1 +=1
    else:
        ans2 +=1 
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for a in A:
    if M > a:
        ans1 +=1
    else:
        ans2 +=1 
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for a in A:
    if M > a:
        ans1 +=1
    else:
        ans2 +=1 
paint(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for a in A:
    if x > a:
        ans1 +=1
    else:
        ans2 +=1 
paint(min(ans1,ans2))
Problem p03408 (python)

Fixed submission:
N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]

s.sort()
t.sort()

ans = 0
sset = set(s)

for si in sset:
    ans = max(ans, s.count(si)-t.count(si))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]

s.sort()
t.sort()

ans = 0
sset = set(s)

for si in sset:
    ans = max(ans, s.count(si)-t.coutn(si))
print(ans)
Problem p03425 (python)

Fixed submission:
#https://atcoder.jp/contests/abc089/tasks/abc089_c
import itertools
N = int(input())
S = [input() for _ in range(N)]
M,A,R,C,H = 0,0,0,0,0
ans = 0
for s in S:
    if s[0] == "M":
        M +=1
    if s[0] == "A":
        A +=1
    if s[0] == "R":
        R +=1
    if s[0] == "C":
        C +=1
    if s[0] == "H":
        H +=1

for i,j,k in itertools.combinations([M,A,R,C,H],3):
    ans += i*j*k
print(ans)

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc089/tasks/abc089_c
import itertools
N = int(input())
S = [input() for _ in range(N)]
march = [0]*N
ans = 0
for s in S:
    if s[0] == "M":
        march[0] +=1
    if s[0] == "A":
        march[1] +=1
    if s[0] == "R":
        march[2] +=1
    if s[0] == "C":
        march[3] +=1
    if s[0] == "H":
        march[4] +=1

for i,j,k in itertools.combinations(march,3):
    ans += i*j*k
print(ans)
Problem p03557 (python)

Fixed submission:
#https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
a.sort()
b.sort()
c.sort()
ai = 0
ci = 0
for bi in b:
    while ai < N and a[ai] < bi:
        ai += 1
    while ci < N and c[ci] <= bi:
        ci += 1
    ans += ai * (N -ci)
print(ans)

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
a.sort()
b.sort()
c.sort()
ai = 0
ci = 0
for bi in b:
    while ai < N and a[ai] < bi:
        ai += 1
    while ci >= 0 and c[ci] <= bi:
        ci += 1
    ans += ai * (N -ci)
print(ans)

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
a.sort()
b.sort()
c.sort()
for bi in b:
    ai = 0
    ci = 0
    while ai < N and a[ai] < bi:
        ai += 1
    while ci >= 0 and c[ci] <= bi:
        ci += 1
    ans += ai * (N -ci)
print(ans)
Problem p03574 (python)

Fixed submission:
#https://atcoder.jp/contests/abc075/tasks/abc075_b?lang=ja
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
for i in range(H):
    for j in range(W):
        count = 0
        if s[i][j] == "#":
            pass
        else:
            if i > 0 and j > 0 and s[i-1][j-1] == "#": #左上
                count +=1
            if i > 0 and s[i-1][j]=="#": #上
                count +=1
            if i > 0 and j <W-1 and s[i-1][j+1] =="#": #右上
                count +=1  
            if j < W-1 and s[i][j+1] =="#": #右
                count +=1
            if i < H-1 and j<W-1 and s[i+1][j+1] =="#": #右下
                count +=1
            if i < H-1 and s[i+1][j] =="#": #下
                count +=1
            if i<H-1 and j>0 and s[i+1][j-1] =="#":  #左下
                count +=1
            if j > 0 and s[i][j-1] == "#":   #左
                count +=1
            s[i][j] = str(count)         
for i in range(H):
    print("".join(s[i]))

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc075/tasks/abc075_b?lang=ja
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
for i in range(H):
    for j in range(W):
        count = 0
        if s[i][j] == ".":
            if i > 0 and j > 0 and s[i-1][j-1] == "#": #
                count +=1
            if i > 0 and s[i-1][j]=="#": #上
                count +=1
            if i > 0 and j <W-1 and s[i-1][j+1] =="#": #
                count +=1  
            if j < W-1 and s[i][i+1] =="#": #右
                count +=1
            if i < H-1 and j<W-1 and s[i+1][j+1] =="#":
                count +=1
            if i < H-1 and s[i+1][j] =="#": #下
                count +=1
            if i<H-1 and j<0 and s[i+1][j-1] =="#":
                count +=1
            if j > 0 and s[i][j-1] == "#":   #左
                count +=1
            s[i][j] = str(count)         
        else:
            pass
for i in range(H):
    print("".join(s[i]))
Problem p03698 (python)

Fixed submission:
#ABC063B
S = input()
all_dif = True
for i in range(len(S)):
    if i == len(S)-1:
        break
    for j in range(1,len(S)-i):
        if S[i] == S[i+j]:
            all_dif = False
if all_dif:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
#ABC063B
S = input()
all_dif = True
for i in range(len(S)):
    for j in range(i+1, len(S)):
        if S[i] == S[i+j]:
            all_dif = False
if all_dif:
    print("yes")
else:
    print("no")
Problem p03699 (python)

Fixed submission:
#ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
    ans = sum(s)
    if ans % 10 != 0:
        break
    elif len(s) == 0:
        ans = 0
        break
    elif len(s) >= 2:
        del_ok = False
        for i in range(1, len(s)):
            if s[0]%10 == 0 and s[i]%10 != 0:
                s.pop(i)
                del_ok = True
                break
        if not del_ok:
            s.pop(0)
    else:
        s.pop(0)
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
    ans = sum(s)
    if ans % 10 != 0:
        break
    elif len(s) == 0:
        ans = 0
        break
    elif len(s) >= 2:
        del_ok = False
        for i in range(1, len(s)):
            if (ans - s[0])%10 == 0 and (ans - s[i])%10 != 0:
                s.pop(i)
                del_ok = True
        if not del_ok:
            s.pop(0)
    else:
        s.pop(0)
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
    ans = sum(s)
    if ans % 10 != 0:
        break
    elif len(s) == 0:
        ans = 0
        break
    elif len(s) >= 2:
        for i in range(1, len(s)):
            if (ans - s[0])%10 == 0 and (ans - s[i])%10 != 0:
                s.pop(i)
                del_ok = True
        if not del_ok:
            s.pop(0)
    else:
        s.pop(0)
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC063C
N = int(input())
s = [int(input()) for _ in range(N)]
ans = -1
s.sort()
for _ in range(N+1):
    ans = sum(s)
    if ans % 10 != 0:
        ans = max(ans, sum(s))
        break
    else:
        if (ans - s[0])%10 == 0:
            s.pop(1)
        else:
            s.pop(0)
        if len(s) == 0:
            ans = 0
            break
print(ans)
Problem p03719 (python)

Fixed submission:
#ABC061A
A,B,C = map(int,input().split())
if C >= A and C <= B:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC061C
import sys
N, K = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
now = 0
ans = ""
for a, b in ab:
    for i in range(b):
        now += 1
        if now == K:
            print(a)
            sys.exit(0)
Problem p03721 (python)

Fixed submission:
#ABC061C
import sys
N, K = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
now = 0
ab.sort()
for a, b in ab:
    now += b
    if now >= K:
            print(a)
            sys.exit()

Buggy submission (verdict: Runtime Error):
#ABC061C
N, K = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]

cnt = 0
ans = ""
for a, b in ab:
    ans += str(a) * b
    cnt += b
    if cnt >= K:
        print(ans[-1])
        break
Problem p03730 (python)

Fixed submission:
#ABC060B
A, B, C = map(int, input().split())
ok = False
for i in range(1,B+1):
    if i*A % B ==C:
        ok = True
if ok:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
#ABC060B
A, B, C = map(int, input().split()
if A % 2 == (2 * B + 1) % 2:
    print("YES")
else:
    print("NO")
Problem p02882 (python)

Fixed submission:
import math
a, b, x = list(map(float, input().split()))

# %%
# a, b, x = [3, 1, 8]
if x/a > a*b/2:
    # 台形
    y = 2*x/(a**2) - b
    # print(90-math.degrees(math.atan(   (a/(b-y))  )))
    print(90-math.degrees(math.atan2(a, b-y)))
else:
    # 三角形
    # print(90-math.degrees(math.atan( (2*x/(a*b)) / b  )))
    print(90-math.degrees(math.atan2(2*x/(a*b), b)))

Buggy submission (verdict: Runtime Error):
import math
a, b, x = list(map(float, input().split()))

# %%
# a, b, x = [3, 1, 8]
if x/a > a*b/2:
    # 台形
    y = 2*x/(a**2) - b
    # print(90-math.degrees(math.atan(   (a/(b-y))  )))
    print(90-math.degrees(math.atan2(a, b-y)))
else:
    # 三角形
    # print(90-math.degrees(math.atan( (2*x/(a*b)) / b  )))
    print(90-math.degrees(math.atan2(2*x/(a*b),

Buggy submission (verdict: Runtime Error):
import math
a, b, x = list(map(float, input().split()))

# %%
# a, b, x = [3, 1, 8]
if x/a > a*b/2:
    # 台形
    y = 2*x/(a**2) - b
    print(90-math.degrees(math.atan(   (a/(b-y))  )))
else:
    # 三角形
    print(90-math.degrees(math.atan( (2*x/(a*b)) / b  )))

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

# %%
# a, b, x = [3, 1, 8]
if x/a > a*b/2:
    # 台形
    y = 2*x/(a**2) - b
    print(90-math.degrees(math.atan(   (a/(b-y))  )))
else:
    # 三角形
    print(90-math.degrees(math.atan( (2*x/(a*b)) / b  )))
Problem p02911 (python)

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

# vec = [K for _ in range(N)]

vec = [0 for _ in range(N)]

for _ in range(Q):
    A = int(input())
#     for i in range(N):
#         vec[i] -= 1
    vec[A-1] += 1

ret = '\n'.join(['Yes' if K-Q+x > 0 else 'No' for x in vec])
print(ret)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K, Q = list(map(int, input().split()))

vec = np.ones(N)*K

A = []
for _ in range(Q):
    A = int(input())
    vec -= 1
    vec[A-1] += 1

ret = '\n'.join(['Yes' if x > 0 else 'No' for x in vec])
print(ret)
Problem p02952 (python)

Fixed submission:
N = int(input())
# %%

digit = len(str(N))
cnt = 0

for x in range(digit):
    x += 1
    if x % 2 != 0:
        if x < digit:
            cnt += (10**x) - (10**(x-1))
        else:
            cnt += N - (10**(x-1)) + 1

print('{}'.format(cnt))

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

N = int(input)

digit = int(np.log10(N).round()+1)
cnt = 0

for x in range(digit):
    x += 1
    if x % 2 != 0:
        if x < digit:
            cnt += (10**x) - (10**(x-1))
        else:
            cnt += N - (10**(x-1)) + 1
print('{}'.format(cnt))
Problem p02983 (python)

Fixed submission:
L, R= list(map(int, input().split()))
# array = np.arange(L, R+1)


# flg = True

def get_amari():
    min_ = 2019
    for i in range(L,R):
        for j in range(i+1, R+1):
            # if (i*j)%2019==0:
            #     print(0)
            #     flg = False
            #     break
            # elif (i*j)%2019 < min_:
            #     min_ = (i*j)%2019
            if (i*j)%2019 < min_:
                min_ = (i*j)%2019
    return min_
#     if flg:
        # print(min_)
                
def get_flg3():
    if R-L >= 3:
        return True
    elif R//3 != L//3:
        return True
    else:
        return False
    

def get_flg673():
    if R-L >= 673:
        return True
    elif R//673 != L//673:
        return True
    else:
        return False

def mataganai_2019():
    return (L*(L+1))//2019 == ((R-1)*R)//2019
        
if get_flg3() & get_flg673():
    print(0)
else:
    print(get_amari())

Buggy submission (verdict: Runtime Error):
import numpy as np
L, R= list(map(int, input().split()))
array = np.arange(L, R+1)

div_3 = array / 3
np.mod(div_3,1,div_3)
flg_3 = np.any(div_3 == 0)

div_673 = array / 673
np.mod(div_673,1,div_673)
flg_673 = np.any(div_673 == 0)

print('{}'.format(0 if flg_3 & flg_673 else L*(L+1)%2019))