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

Fixed submission:
n = int(input())
fs = []
for _ in range(n):
    r = list(input())
    r = [ord(s) - ord("a") for s in r]    
    fs.append(r)
sym = [[0]*n for i in range(n)]
cnt = 0
# di,dj とdi+1,dj+1が同値
# dj側は0で固定して良い
for di in range(n):
    for i in range(n):
        for j in range(n):
            sym[(i+di)%n][j] = fs[i][j]
    flg = True
    for i in range(n):
        for j in range(i+1,n):
            if sym[i][j] != sym[j][i]:
                flg = False
                break
    if flg:
        cnt += n
print(cnt)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
fs = []
for _ in range(n):
    r = list(input())
    r = [ord(s) - ord("a") for s in r]    
    fs.append(r)
fs = np.array(fs)
sym = np.zeros((n,n))
cnt = 0
# di,dj とdi+1,dj+1が同値
# dj側は0で固定して良い
for di in range(n):
    for i in range(n):
        for j in range(n):
            sym[(i+di)%n][j] = fs[i][j]
    if (sym == sym.T).all():
        cnt += n
print(cnt)
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())

if B-A+1 <= 2*K:
    for ans in range(A,B+1):
        print(ans)
else:
    for ans in range(A, A+K):
        print(ans)
    for ans in range(B-K+1, B+1):
        print(ans)

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

a = list(range(A,B+1))
if B-A+1 <= 2*K:
    for ans in a:
        print(ans)
else:
    for ans in a[:K]:
        print(ans)
    for ans in a[-K:]:
        print(ans)
Problem p03388 (python)

Fixed submission:
"""
N/x-1 - N/x >= 1のところを狙っていく
解aだとして、aまではAを+1ずつインクリメントでOK
a以降はN/aからbをデクリメント
"""
N = int(input())

def calc(a,b):
    N = a * b 
    n = int(N**0.5)-2
    while (n+1)**2 < N:
        n += 1
    if a == b == 1:
        return 0
    cnta = n
    cntb = n
    if a <= n:
        cnta -= 1
    if b <= n:
        cntb -= 1
    ans = cnta + cntb
    # A : 1,2,3,..,n,n+1, 大きい数
    # B : 大きい数,n+1,n,...,3,2,1
    # それぞれペアを見つけながら進んでいけばいいので基本 2*n
    # 1. Aの1~nまでにaが入っていると-1
    # 2. Bの1~nまでにbが入っていると-1
    # 3. n*n+1がabより大きいと成り立たないので-1
    if n*(n+1) >= N:
        ans -= 1
    return ans        

for i in range(N):
    a,b = map(int, input().split())
    ans = calc(a,b)
    print(ans)

Buggy submission (verdict: Runtime Error):
"""
N/x-1 - N/x >= 1のところを狙っていく
解aだとして、aまではAを+1ずつインクリメントでOK
a以降はN/aからbをデクリメント
"""
N = int(input())

def calc(a,b):
    N = a * b
    n = int((N-1)**0.5)
    cnta = n
    cntb = n
    if a <= n:
        cnta -= 1
    if b <= n:
        cntb -= 1
    ans = cnta + cntb
    if (N-1)//n == n:
        ans -= 1
    # print("cnt",cnta,cntb)
    print(ans)        

for i in range(N):
    a,b = map(int, input().split())
    ans = calc(a,b)
Problem p03417 (python)

Fixed submission:
N, M = map(int, input().split())
if N > M:
    tmp = N
    N = M
    M = tmp

# N <= M としても一般性を失わない
if N == 1:
    if M == 1:
        print(1)
    elif M == 2:
        print(0)
    else:
        print(M-2)
elif N == 2:
    print(0)
else:
    print((N-2)*(M-2))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
if N > M:
    tmp = N
    N = M
    M = tmp
fields = [[0] * (M+2) for i in range(N+2)]

# for i in range(1,N+1):
#     for j in range(1,M+1):
#         for k in range(-1,2):
#             for l in range(-1,2):
#                 fields[i+k][j+l] += 1

# for f in fields:
#     print(*f)

n9 = max(0,N-2)*max(0,M-2)
n1 = 4
n2 = 8
n3 = max(0,N-2)*2 + max(0,M-2)*2
n6 = max(0,N-2)*2 + max(0,M-2)*2
n4 = 4

# N <= M としても一般性を失わない
if N == 1:
    if M == 1:
        print(1)
    elif M == 2:
        print(0)
    else:
        print(M-2)
elif N == 2:
    print(0)
else:
    print(n9)
Problem p03504 (python)

Fixed submission:
N,C  = map(int, input().split())
t_max = 2*10**5
c_imos = [[0]*t_max for t in range(C)]
# 前処理 : 同一チャンネルのときはくっつけられる
c_imos = [[0]*t_max for t in range(C)]

for i in range(N):
    s,t,c = map(int, input().split())
    c -= 1
    s -= 1
    # t -= 1
    c_imos[c][s] += 1
    c_imos[c][t] -= 1
    
ans = [0] * t_max
from itertools import accumulate
for c_ in c_imos:
    acc = list(accumulate(c_))
    ans = [a+min(1,b) for a,b in zip(ans,acc)]
print(max(ans))

Buggy submission (verdict: Runtime Error):
"""
https://atcoder.jp/contests/abc080/tasks/abc080_d
400

同じチャンネル同士でかぶりが発生するとアウト
imos
"""

N,C  = map(int, input().split())
t_max = 10**5
# c_imos = [[0]*t_max for t in range(C)]
imos = [0] * t_max
for i in range(N):
    s,t,c = map(int, input().split())
    c -= 1
    # t -= 1
    s -= 1
    # c_imos[c][s] += 1
    # c_imos[c][t] -= 1
    imos[s] += 1
    imos[t] -= 1 

    # for c_ in c_imos:
    #     print(list(accumulate(c_)))
    
from itertools import accumulate
print(max(list(accumulate(imos))))

Buggy submission (verdict: Runtime Error):
N,C  = map(int, input().split())
t_max = 10**5
# c_imos = [[0]*t_max for t in range(C)]
imos = [0] * t_max
for i in range(N):
    s,t,c = map(int, input().split())
    c -= 1
    # t -= 1
    s -= 1
    # c_imos[c][s] += 1
    # c_imos[c][t] -= 1
    imos[s] += 1
    imos[t] -= 1 

    # for c_ in c_imos:
    #     print(list(accumulate(c_)))
Problem p03525 (python)

Fixed submission:
n = int(input())
ds = list(map(int, input().split()))

from collections import defaultdict
d = defaultdict(int)

d[0] += 1
for d_ in ds:
    d[d_] += 1
    if (d_ == 12 or d_ == 0) and d[d_] == 2:
        print(0)
        exit()
    elif d[d_] == 3:
        print(0)
        exit()

def calcmin(tmp):
    n = len(tmp)
    ret = 1 << 50
    for i in range(n):
        for j in range(i+1,n):
            ret = min(ret, abs(tmp[i]-tmp[j]),24-abs(tmp[i]-tmp[j]))
    return ret

two = []
x = []

for k in d.keys():
    if d[k] == 2 or k == 12:
        two.append(k)
        two.append(24-k)
    elif d[k] == 1:
        x.append(k)

two = list(set(two))
n = len(x)
ans = 0
for i in range(1 << n):
    tmp = x[:]
    for j in range(n):
        if i & (1 << j):
            tmp[j] = 24-x[j]
    # print(tmp,two)
    tmp.extend(two)
    ans = max(calcmin(tmp), ans)

print(ans)

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

from collections import defaultdict
d = defaultdict(int)

d[0] = 1
for d_ in ds:
    d[d_] += 1
    if d_ == 12 and d[d_] == 2:
        print(0)
        exit()
    elif d_ == 0 and d[d_] == 2: 
        print(0)
        exit()
    elif d[d_] == 3:
        print(0)
        exit()

def calcmin(tmp):
    n = len(tmp)
    ret = 1 << 50
    for i in range(n):
        for j in range(i+1,n):
            ret = min(ret, abs(tmp[i]-tmp[j]))
    return ret

two = []
x = []
for k in d.keys():
    if d[k] == 2:
        two.append(k)
        two.append(24-k)
    if d[k] == 1:
        x.append(k)
two = list(set(two))
n = len(x)

ans = 0
for i in range(1 << n):
    tmp[] = x[:]
    for j in range(n):
        if i & (1 << j):
            tmp[j] = 24-x[j]
    tmp.extend(two)
    ans = max(calcmin(tmp), ans)
print(ans)

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

from collections import defaultdict
d = defaultdict(int)

d[0] = 1
for d_ in ds:
    d[d_] += 1
    if d_ == 12 and d[d_] == 2:
        print(0)
        exit()
    elif d_ == 0 and d[d_] == 2: 
        print(0)
        exit()
    elif d[d_] == 3:
        print(0)
        exit()

def calcmin(tmp):
    n = len(tmp)
    ret = 1 << 50
    for i in range(n):
        for j in range(i+1,n):
            ret = min(ret, abs(tmp[i]-tmp[j]))
    return ret

two = []
x = []
for k in d.keys():
    if d[k] == 2:
        two.append(k)
        two.append(24-k)
    if d[k] == 1:
        x.append(k)
two = list(set(two))
n = len(x)

ans = 0
for i in range(1 << n):
    tmp[:] = x[:]
    for j in range(n):
        if i & (1 << j):
            tmp[j] = 24-x[j]
    tmp.extend(two)
    ans = max(calcmin(tmp), ans)
print(ans)
Problem p03612 (python)

Fixed submission:
N = int(input())
ps = list(map(int,input().split()))
# p_swap = [-1]*N
ans = 0
for i in range(N-1):
    if i+1 == ps[i]:
        p1,p2 = ps[i:i+2]
        ps[i] = p2
        ps[i+1] = p1
        ans += 1
if ps[N-1] == N:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# 前から順番に後ろに向けてswap
n = int(input())
ps = list(map(int, input().split()))

cnt = 0
for i, p in enumerate(ps):
    if i + 1 == p:
        ps[i], ps[i+1] = ps[i+1], ps[i]
        cnt += 1
print(cnt)
Problem p03628 (python)

Fixed submission:
n = int(input())
s1 = input()
s2 = input()
mod = 10**9 + 7
ind = []
for i,(_s1,_s2) in enumerate(zip(s1,s2)):
    if _s1 == _s2:
        ind.append(i)
# print(ind)
cnt = 0
if len(ind) == 0:
    d = 6
    cnt = 2
    single = False
elif ind[0] == 0:
    d = 3
    single = True
    cnt = 1
else:
    d = 6
    single = False
    cnt = 2
        
while cnt < n:
    if cnt in ind: # * -> 1
        if single: 
            d *= 2
        else:#2->1
            d *= 1
        cnt += 1
        single = True
    else: # * -> 2
        if single:
            d *= 2
        else:
            d *= 3
        cnt += 2
        single = False
    d %= mod
    
print(d)

"""
"""

Buggy submission (verdict: Runtime Error):
n = int(input())
s1 = input()
s2 = input()
mod = 10**9 + 7
ind = []
for i,(_s1,_s2) in enumerate(zip(s1,s2)):
    if _s1 == _s2:
        ind.append(i)
# print(ind)
cnt = 0
if ind[0] == 0:
    d = 3
    single = True
    cnt = 1
else:
    d = 6
    single = False
    cnt = 2
        
while cnt < n:
    if cnt in ind: # * -> 1
        if single: 
            d *= 2
        else:#2->1
            d *= 1
        cnt += 1
        single = True
    else: # * -> 2
        if single:
            d *= 2
        else:
            d *= 3
        cnt += 2
        single =False
    d %= mod
print(d)
Problem p03639 (python)

Fixed submission:
n = int(input())
As = list(map(int, input().split()))

four = sum([1 for a in As if a%4 == 0])
odd = sum([1 for a in As if a%2 == 1])
two = sum([1 for a in As if a%2 == 0 and a%4 != 0])
if four < two%2 + odd - 1:
    print("No")
else:
    print("Yes")

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

# four = sum([1 for a in As if a%4 == 0])
# odd = sum([1 for a in As if a%2 == 1])
# two = sum([1 for a in As if a%2 == 0 and a%4 != 0])
four = 0
odd = 0
two = 0
for a in As:
    if a % 2 == 1:
        odd += 1
    elif a % 4 == 0:
        four += 1
    else:
        two += 1


if four < two%2 + odd - 1:
    print("No")
else:
    print("Yes")


fields @timestamp, @message
| sort @timestamp desc
| filter 
| limit 20
Problem p03645 (python)

Fixed submission:
N,M = map(int, input().split())
from collections import defaultdict
edges = defaultdict(list)
for i in range(M):
    a, b = map(int, input().split())
    edges[a].append(b)
    edges[b].append(a)

first = edges[1]
# print(first)
for fr in first:
    if N in edges[fr]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
from collections import defaultdict
edges = defaultdict(list)
for i in range(M):
    a, b = map(int, input().split())
    edges[a].append(b)
    edges[b].append(a)

first = edges[1]
# print(first)
for fr in first:
    if N in edges[fr]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")N,M = map(int, input().split())
from collections import defaultdict
edges = defaultdict(list)
for i in range(M):
    a, b = map(int, input().split())
    edges[a].append(b)
    edges[b].append(a)

first = edges[1]
# print(first)
for fr in first:
    if N in edges[fr]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")
Problem p03646 (python)

Fixed submission:
K = int(input())
N = 50

a = [i for i in range(N)]
a = [x + K // N for x in a]
for i in range(K % N):
    a = [x - 1 for x in a]
    a[i] += N + 1

print(N)
print(*a)

Buggy submission (verdict: Runtime Error):
K = int(input())
print(2)
print(N+K-2,2)
Problem p03659 (python)

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
from itertools import accumulate
acc = list(accumulate(As))
s = sum(As)
mn = 10**10
for i,x in enumerate(acc[:-1]):
    y = s - x
    if mn >= abs(x-y):
        mn = abs(x-y)
print(mn)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
from collections import defaultdict
edges = []
to = defaultdict(list) # 1から到達できるか
ot = defaultdict(list) # Nから到達できるか
N, M, P = map(int, input().split())
visited_toN = [False]*(N+1)
visited_fm1 = [False]*(N+1)    
for i in range(M):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    edges.append((a,b,-c+P))
    to[a].append(b)
    ot[b].append(a)

def dfs(v):
    global visited_fm1
    if visited_fm1[v]:return
    visited_fm1[v] = True
    for nxt in to[v]:
        dfs(nxt)
    
def dfs_r(v):
    global visited_toN
    if visited_toN[v]:return
    visited_toN[v] = True
    for nxt in ot[v]:
        dfs_r(nxt)
        
dfs(0)
dfs_r(N-1)
is_ok = []

for s, t in zip(visited_fm1,visited_toN):
    is_ok.append(s and t)


# BellmanFord    
INF = 10 ** 18
def bellmanFord(n, edges, s, g):
    """
    input
        n : 頂点の数
        edges : (始点, 終点, コスト)のリスト
        s : 探索の始点
        g : 探索の終点
    output
        sから各点への最短距離
    """    
    d = [INF] * n
    d[s] = 0
    cnt = 0
    while True:
        update = False
        for a, b, c in edges:
            if not is_ok[a]:continue
            if not is_ok[b]:continue
            if d[a] != INF and d[b] > d[a] + c:
                d[b] = d[a] + c
                update = True
        if not update:
            break
        cnt += 1
        # 負閉路の存在をチェック
        if cnt > n:
            print(-1)
            exit()
        # print(d,cnt)
    return d[g]



ans = bellmanFord(N,edges,0,N-1)
print(max(0,-ans))
Problem p03660 (python)

Fixed submission:
n = int(input())
edges = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)
f = 0
s = 0
from collections import deque
ps = [-1] * n
used = [False] * n
used[0] = True # 始めどこから行くか
q = deque([0])
while len(q) > 0:
    a = q.popleft()
    if a == n-1:
        break
    for u in edges[a]:
        if not used[u]:
            ps[u] = a
            q.append(u)
            used[u] = True

nx = n - 1
xs = [n-1]
while nx != 0:
    nx = ps[nx]
    xs.append(nx)

xs.reverse()
l = len(xs) - 2
f = (l+1)//2
s = l-f

if len(xs) == 2:
    z_lim = -1
    n_lim = 0
else:
    z_lim = (len(xs)+1)//2
    n_lim = z_lim - 1

# bfs 0側
used = [-1] * n
used[0] = 0 
q = deque([0])
cnt = 0
while len(q) > 0:
    a = q.popleft()
    for u in edges[a]:
        if used[u] == -1 and u != xs[z_lim]:
            q.append(u)
            used[u] = 0
            cnt += 1
# print("cnt",cnt)
f += cnt

# bfs n-1側
used = [-1] * n
used[n-1] = 0 
q = deque([n-1])
cnt = 0
while len(q) > 0:
    a = q.popleft()
    for u in edges[a]:
        if used[u] == -1 and u != xs[n_lim]:
            q.append(u)
            used[u] = 0
            cnt += 1

s += cnt
# print("z_lim",z_lim,"nlim",n_lim)
# print("f",f,"s",s)
if f > s:
    print("Fennec")
else:
    print("Snuke")

Buggy submission (verdict: Runtime Error):
n = int(input())
edges = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)
f = 0
s = 0
from collections import deque
ps = [-1] * n
used = [False] * n
used[0] = True # 始めどこから行くか
q = deque([0])
while len(q) > 0:
    a = q.popleft()
    if a == n-1:
        break
    for u in edges[a]:
        if not used[u]:
            ps[u] = a
            q.append(u)
            used[u] = True
nx = n - 1
xs = [n-1]
while nx != 0:
    nx = ps[nx]
    xs.append(nx)
l = len(xs) - 2
f = (l + 1)//2
s = l - f

mid = len(xs)//2

# bfs 0側
used = [-1] * n
used[0] = 0 
q = deque([0])
cnt = 0
while len(q) > 0:
    a = q.popleft()
    for u in edges[a]:
        if used[u] == -1 and u != xs[mid+1]:
            q.append(u)
            used[u] = 0
            cnt += 1
# print("cnt",cnt)
f += cnt

# bfs n-1側
used = [-1] * n
used[n-1] = 0 
q = deque([n-1])
cnt = 0
while len(q) > 0:
    a = q.popleft()
    for u in edges[a]:
        if used[u] == -1 and u != xs[mid]:
            q.append(u)
            used[u] = 0
            cnt += 1
# print("cnt",cnt)
s += cnt

if f > s:
    print("Fennec")
else:
    print("Snuke")
Problem p03701 (python)

Fixed submission:

N = int(input())
Ss = [int(input()) for _ in range(N)]
Ss.sort()
ans = sum(Ss)
if ans % 10 != 0:
    print(ans)
    exit()
cnt_10 = 0
for s in Ss:
    if s % 10 == 0:continue
    ans -= s
    if ans % 10 != 0:
        print(ans)
        exit()
print(0)

Buggy submission (verdict: Runtime Error):
n = sum(Ss)
# INF = 10**10
dp = [False] * (n+1)
dp[0] = True
for i in range(N):
    x = Ss[i]
    for j in range(n+1):
        if j+x > n : continue 
        dp[j+x] = dp[j] or dp[j+x]

ans = 0
for i in range(n+1):
    if dp[i] and i%10 != 0:
        ans = i
print(ans)
Problem p03937 (python)

Fixed submission:
H,W = map(int, input().split())
fields = [list(input()) for i in range(H)]

mvs = [(0,1),(1,0)]

from collections import deque
q = deque()
q.append((0,0))

cnt = 0
for f in fields:
    cnt += f.count("#")
if cnt != H + W - 1: 
    print("Impossible")
    exit()
# ゴールまで連結しているか
while len(q) > 0:
    h,w = q.popleft()
    if h == H-1 and w == W-1:
        print("Possible")
        exit()
    for dh, dw in mvs:
        h_nx = h + dh
        w_nx = w + dw
        if h_nx >= H or w_nx >= W:continue
        if fields[h_nx][w_nx] == ".":continue
        q.append((h_nx,w_nx))
print("Impossible")

Buggy submission (verdict: Runtime Error):
H,W = map(int, input().split())
fields = [list(input()) for i in range(H)]

for f in fields:
    cnt += f.count("#")
if cnt == H + W - 1: 
    print("Possible")
else:
    print("Impossible")
Problem p04029 (python)

Fixed submission:
N = int(input())
print(int(N*(N+1)/2))

Buggy submission (verdict: Runtime Error):
N = int(input())
return(N*(N+1)//2)
Problem p04034 (python)

Fixed submission:
N,M  = map(int, input().split())
balls = [1]*(N+1)
reds = [False]*(N+1)
reds[0] = True
for i in range(M):
    x,y = map(int, input().split())
    x -= 1
    y -= 1
    balls[x] -= 1
    balls[y] += 1
    if reds[x]:
        reds[y] = True
    if balls[x] == 0:
        reds[x] = False

print(sum(reds))

Buggy submission (verdict: Runtime Error):
N,M  = map(int, input().split())
balls = [1]*N
reds = [False]*N
reds[0] = [True]
for i in range(M):
    x,y = map(int, input().split())
    x -= 1
    y -= 1
    balls[x] -= 1
    balls[y] += 1
    if reds[x]:
        reds[y] = True
    if balls[x] == 0:
        reds[x] = False

print(sum(reds))
Problem p02630 (python)

Fixed submission:
import collections

N=int(input())
A=list(map(int, input().split()))
Q=int(input())
countA=collections.Counter(A)
ans=sum(A)

for i in range(Q):
    B,C=map(int, input().split())
    b=countA[B]
    ans=ans+(C-B)*b
    print(ans)
    countA[B]=0
    countA[C]+=b

Buggy submission (verdict: Runtime Error):
H,W,K=map(int,input().split())
c=[list(input()) for i in range(H)]
b=0
for i in range(H):
  b+=c[i].count('#')
if b==K:
  print(1)
  exit()
  
else:
  a=K-b
  count=0
  hc=[]
  wc=[]
  for i in range(2 ** H):
    h=['0']*H 
    for j in range(H):
        if ((i >> j) & 1):
            h[H- 1 - j] = '1'
    hc.append(h)
  for i in range(2 ** W):
    w=['0']*W
    for j in range(W):
        if ((i >> j) & 1):
            w[W- 1 - j] = '1'
    wc.append(w)
  
  for k in range(len(hc)):
    for l in range(len(wc)):
      c1=list(c)
      for m in range(H):
        if hc[k][m]=='0':
          c1[m]='.'
        for n in range(W):
          if wc[l][n]=='0' and c1[m][n]=='#':
                c1[m][n]=c1[m][n].replace('#','.')
      for i in range(H):
        b+=c1[i].count('#')
        print(c1)
      if b==a:
        count+=1
        
print(count)
Problem p02730 (python)

Fixed submission:
S = input()
c = True
for i in range (len(S)//2):
  if S[i]==S[len(S)//2-i-1]==S[len(S)//2+1+i]==S[len(S)-i-1]:
    c = True
  else:
    c = False
    break
if (c):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
c = True
for i in range (len(S)//2):
  if S[i]=S[len(S)//2-i-1]=S[len(S)//2+1+i]=S[len(S)-i-1]:
    c = True
  else:
    c = False
if (c):
  print('Yes')
else:
  print('No')
Problem p02767 (python)

Fixed submission:
N=int(input())
X= list(map(int,input().split()))
cnt = 1000000
for j in range(100):
    t = 0
    for i in X:
        t += (i-(j+1))**2
    if t <= cnt:
        cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
X= list(map(int,input().split()))
cnt = 1000000
for j in range(100):
    t = 0
    for i in li:
        t += (i-(j+1))**2
    if t <= cnt:
        cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
N =int(input())
X = list(map(int,input().split()))
c = 100000000
for i in range(1,101):
  t=0
  for j in X:
    t += (j-i)**2

  if t=<c:
    t=c
print(c)

Buggy submission (verdict: Runtime Error):
N =int(input())
X = map(int,input().split())
c = 100000000
for i in range(1,101):
  t=0
  for j in X:
    t += (j-i)**2

  if t=<c:
    t=c
print(c)
Problem p02789 (python)

Fixed submission:
A,B = map(int,input().split())
if A==B:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
def AC(N,M):
  if N = M:
    return ('Yes')
  else:
    return ('No')
Problem p02909 (python)

Fixed submission:
S = input()
if S =='Sunny':
  print('Cloudy')
elif S == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
S = input()
if S = 'Sunny':
  print('Cloudy')
elif S = 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Problem p02969 (python)

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

Buggy submission (verdict: Runtime Error):
print(3*(input()**2))

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

Fixed submission:
S = input()
count = 0
count_max = 0

for k in range(len(S)):
    if S[k] == "A" or S[k] == "C" or S[k] == "G" or S[k] == "T":
        count += 1
        if count > count_max:
             count_max = count
    else:
        count=0
print(count_max)

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
count_max = 0

for k in range(len(s)):
    if S[k] == "A" or S[k] == "C" or S[k] == "G" or S[k] == "T":
        count += 1
        if count > count_max:
             count_max = count
    else:
        count=0
print(count_max)
Problem p03102 (python)

Fixed submission:
N,M,C= map(int,input().split())
B= list(map(int,input().split()))
now = 0
for i in range(N):
    A=list(map(int,input().split()))
    ans = C
    for j in range(M):
        ans += A[j]*B[j]
    if (ans)>0:
        now += 1
print(now)

Buggy submission (verdict: Runtime Error):
N,M,C= map(int,input().split())
B= list(map(int,input().split()))
now = 0
for i in range(N):
  A=list(map(int,input().split()))
    ans = C
    for j in range(M):
        ans += A[j]*B[j]
    if (ans)>0:
        now += 1
print(now)
Problem p03106 (python)

Fixed submission:
A,B,K=map(int,input().split())
c=[]
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0:
    c.append(i)
    
print(c[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
c=[]
for i in range(1,abs(A-B)+1):
  if A%i==0 and B%i==0:
    c.append(i)
    
print(c[-K])
Problem p03254 (python)

Fixed submission:
N,x = map(int, input().split())
A = sorted(map(int, input().split()))

S = 0
c = 0

for i in range(N):
  S += A[i]
  
if S < x:
  print(N-1)
else:
  for i in range(N):
    b = x - A[i]
    if b > 0:
      c += 1
      x -= A[i]
    elif b == 0:
      c += 1  
      break
    else:
      break
  print(c)

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

S = 0
c = 0

for i in range(N):
  S += A[i]
  
if S < x:
  print(N-1)
else:
  for i in range(N):
    b = x - A[i]
    if b > 0:
      c += 1
      x -= A[i]
    elif b == 0:
      count += 1  
      break
    else:
      break
  print(c)