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

Fixed submission:
N = int(input())
max = 0
h_list = list(map(int , input().split()))
for i in h_list:
    if max < i:
        max = i
    elif max - 1 > i:
        print("No")
        exit(0)
print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
flag = False
h_list = list(map(int , input().split()))
for i in range(N):
  h_list[i] - 1 > h_list[i-1]:
    flag = True
    break
if flag:
  print("No")
else:
  print("Yes")
Problem p02982 (python)

Fixed submission:
import numpy as np

N, D = map(int , input().split())
X = [list(map(int , input().split())) for _ in range(N)]
X = np.array(X)
cnt = 0
for i in range(N - 1):
    for j in range(i + 1 , N):
        dis = np.linalg.norm(X[i] - X[j])
        if dis.is_integer():
            cnt += 1
print(cnt)

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

N, D = map(int , input().split())
X = [list(map(int , input().split())) for _ in range(N)]
X = np.array(X)
cnt = 0
for i in range(N - 1):
    for j in range(i + 1 , N):
        dis = np.linalg.norm(X[i] - X[j])
        if dis.is_integer():
            cnt += 1
print(cnt)
Problem p02995 (python)

Fixed submission:
def solve():
    def gcd(x,y):
        while y != 0:
            x , y = y , x % y
        return x

    A,B,C,D = map(int ,input().split())
    A -= 1
    gcd_val = gcd(C , D)
    lcm_val = C * D // gcd_val
    ReduceFromB = B - (B // C + B // D - B // lcm_val)
    ReduceFromA = A - (A // C + A // D - A // lcm_val)
    print(ReduceFromB - ReduceFromA)

solve()

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)¥


A, B, C, D = map(int, input().split())
cnt = B - A + 1
all_range = B // C + B // D - B // lcm(C , D)
sub_end = A - 1
sub_range = sub_end // C + sub_end // D - sub_end // lcm(C , D)
print(cnt - (all_range - sub_range))
Problem p02999 (python)

Fixed submission:
X , A = map(int,input().split())
if A > X:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
N , K = map(int ,input().split())
A = list(map(int , input().split()))
cnt = 0
right = 0
s = 0
for left in range(N):
    while right < N and s < K:
        s += A[right]
        right += 1
    if s < K:
        break
    else:
        cnt += len(A[right - 1:])
        s -= A[left]
print(cnt)
Problem p03001 (python)

Fixed submission:
W , H ,x , y = map(int,input().split())
'''
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
# 直線上に存在すれば三角形の面積
if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    print("0")
# 直線上にない時、長方形の面積
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
    if horizon == vertical:
        print("1")
    else:
        print("0")
'''

print("{:.6f}".format(W * H /2) , end = ' ')
if x + x  == W and y + y == H:
    print('1')
else:
    print("0")

Buggy submission (verdict: Runtime Error):
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
flag = False
# 直線上に存在すれば三角形の面積
if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    print("0")
# 直線上にない時
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
    #if horizon == vertical:
    if x == W//2 and y == H //2
        print("1")
    else:
        print('0')
Problem p03014 (python)

Fixed submission:
import numpy as np
H, W = map(int, input().split())
s = np.array([list(input()) for _ in range(H)])=="."

R = np.zeros((H,W),dtype = int)
L = np.zeros((H,W),dtype = int)
U = np.zeros((H,W),dtype = int)
D = np.zeros((H,W),dtype = int)

for i in range(H):
    U[i] = (U[i - 1] + 1) *s[i]
    D[- i - 1] = (D[-i] + 1) * s[-i-1]
for i in range(W):
    L[:,i] = (L[:,i-1] + 1) * s[:,i]
    R[:,-1-i] = (R[:,-i] + 1) * s[:,-i-1]
print(np.max(L+R+U+D - 3))

Buggy submission (verdict: Runtime Error):
import numpy as np
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
table = np.zeros((H , W))
done = np.zeros((H , W))
max = 0
print(s[0][1])

for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            continue
        if done[i][j] == 1:
            continue
        l = 0
        while j + l < W:
            if s[i][j + l] == "#":
                break
            l += 1
        for k in range(l):
            table[i][j + k] += l
            done[i][j+k] = 1
print(table)
done = np.zeros((H , W))
for j in range(W):
    for i in range(H):
        if s[i][j] == "#":
            continue
        if done[i][j] == 1:
            continue
        l = 0
        while i + l < H:
            if s[i + l][j] == "#":
                break
            l += 1
        for k in range(l):
            table[i + k][j] += l
            done[i + k][j] = 1
            if table[i + k][j] > max:
                max = table[i + k][j]

print(table)
print(int(max - 1))
Problem p03032 (python)

Fixed submission:
from collections import deque
from copy import deepcopy
N, K = map(int, input().split())
#V = list(map(int, input().split()))
V = deque(map(int, input().split()))
ans = 0
for l in range(K + 1):
    for r in range(0 , K - l + 1):
        work_V = deepcopy(V)
        if l + r > N:
            continue
        d = K - (r + l)
        now = 0
        hold = []
        for i in range(l):
            #hold.append(V[i])
            hold.append(work_V.popleft())
        for i in range(N - r , N):
            #hold.append(V[-i])
            hold.append(work_V.pop())
        hold.sort()
        now = sum(hold)
        for i in range(d):
            if i >= len(hold):
                break
            if hold[i] > 0:
                break
            else:
                now -= hold[i]
        ans = max(ans , now)
print(ans)

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

ans = 0
for l in range(K):
    for r in range(0 , K - l):
        if l + r > K:
            continue
        d = K - (r + l)
        now = 0
        hold = []
        for i in range(l):
            hold.append(V[i])
        for i in range(1 , r + 1):
            hold.append(V[-i])
        hold.sort()
        now = sum(hold)
        for i in range(d):
            if i >= len(hold):
                break
            if hold[i] > 0:
                break
            else:
                now -= hold[i]
        ans = max(ans , now)
print(ans)
Problem p03086 (python)

Fixed submission:
S = list(input())
ans = 0
i = 0
cnt = 0
lst = ["A","C","G","T"]
for c in S:
    if c in lst:
        cnt += 1
    else:
        if ans < cnt:
            ans = cnt
        cnt = 0
if ans < cnt:
    ans = cnt
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
ans = 0
i = 0
lst = ["A","C","G","T"]
while i < len(S):
    cnt = 0
    if S[i] in lst:
        cnt = 1
        for j in range(1 , 4):
            if not S[j + i] in lst or i + j >= len(S):
                break
            cnt += 1
        ans = cnt
    i += j
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
ans = 0
i = 0
lst = ["A","C","G","T"]
while i < len(S) - 1:
    cnt = 0
    if S[i] in lst:
        cnt = 1
        for j in range(4):
            j += 1
            if not S[j] in lst:
                break
            cnt += 1
        ans = cnt
    i += 1
print(ans)
Problem p03087 (python)

Fixed submission:
N , Q = map(int,input().split())
S = list(input())
slice_list = []
for _ in range(Q):
    l , r =map(int,input().split())
    slice_list.append([l - 1,r - 1])
cnt_list = [0] * (N + 1)

for i in range(N - 1):
    if S[i] == "A" and S[i + 1] == "C":
        cnt_list[i + 1] = cnt_list[i] + 1
    else:
        cnt_list[i + 1] = cnt_list[i]

for i in range(Q):

    print(cnt_list[slice_list[i][1]] - cnt_list[slice_list[i][0]])

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

S = list(input())
l_list = []
r_list = []
slice_list = []
for _ in range(Q):
    l , r =map(int,input().split())
    slice_list.append([l - 1,r - 1])
cnt_list = [0] * (N + 1)
#print(cnt_list)

for i in range(len(S)):
    if S[i] == "A" and S[i + 1] == "C":
        cnt_list[i + 1] = cnt_list[i] + 1
    else:
        cnt_list[i + 1] = cnt_list[i]
#print(cnt_list)
for i in range(Q):
    #l, r = map(int, input().split())
    print(cnt_list[slice_list[i][1]] - cnt_list[slice_list[i][0]])
Problem p03161 (python)

Fixed submission:
import sys
input = sys.stdin.readline
N , K = map(int,input().split())
h = list(map(int,input().split()))
inf = float('inf')
dp = [inf] * N
if K == 1:
    ans = 0
    for i in range(N - 1):
        ans += abs(h[i + 1] - h[i])
    print(ans)
    exit()

for i in range(N):
    if i == 0:
        min_cost = 0
    elif i == 1:
        min_cost = abs(h[1] - h[0])
    else:
        current = h[i]
        tmp_min = min(abs(current - h[i - K]) + dp[i - K] , abs(current - h[i - K + 1]) + dp[i - K + 1])
        for j in range(K - 2):
            tmp_min = min(abs(current - h[i - K + 2 + j]) + dp[i - K + 2 + j], tmp_min)
        min_cost = tmp_min
    dp[i] = min_cost
#print(dp)
print(dp[N - 1])

Buggy submission (verdict: Runtime Error):
N , K = map(int,input().split())
h = list(map(int,input().split()))
inf = float('inf')
dp = [inf] * N
if K == 1:
    ans = 0
    for i in range(N - 1):
        ans += abs(h[i + 1] - h[i])
    print(ans)
    exit()

for i in range(N):
    if i == 0:
        min_cost = 0
    elif i == 1:
        min_cost = abs(h[1] - h[0])
    else:
        corrent = h[i]
        tmp_min = min(abs(corret - h[i - K]) + dp[i - K] , abs(corrent - h[i - K + 1]) + dp[i - K + 1])
        for j in range(K - 2):
            tmp_min = min(abs(corrent - h[i - K + 2 + j]) + dp[i - K + 2 + j], tmp_min)
        min_cost = tmp_min
    dp[i] = min_cost
#print(dp)
print(dp[N - 1])
Problem p03163 (python)

Fixed submission:
import numpy as np
N , W = map(int, input().split())
goods = np.array([list(map(int , input().split())) for _ in range(N)])
dp = np.zeros((N + 1 , W + 1) , dtype = np.int)

for i in range(0,N):
    w, v = goods[i,:]
    dp[i + 1, w:] = np.maximum(dp[i,w:] , dp[i,:-w] + v)
    dp[i + 1, :] = np.maximum(dp[i + 1,:],dp[i,:])
print(int(dp[N,W]))

Buggy submission (verdict: Runtime Error):
N , W = map(int , input().
weight = []               
value = []                
for _ in range(N):        
    w , v = map(int , inpu
    weight.append(w)      
    value.append(v)       
                          
def knapsack():           
    dp = [[0] * (W + 1) fo
    def solve(i,w):       
        if N == i:        
            ret_val = 0   
        elif w - weight[i]
            ret_val = solv
        else:             
            ret_val = max(
        dp[i][w] = ret_val
        return dp[i][w]   
    solve(0,W)            
    #print(dp)            
    return max(dp[0])     
                          
if __name__ == "__main__":
    print(knapsack())
Problem p03164 (python)

Fixed submission:
N, W = map(int, input().split())
weight = []
value = []
for _ in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)
value_sum = sum(value)
dp = []
for _ in range(N + 1):
    dp_val = [float('inf') for _ in range(value_sum + 1)]
    dp.append(dp_val)
dp[0][0] = 0

for idx in range(N):
    for v in range(value_sum + 1):
        if value[idx] <= v:
            dp[idx + 1][v] = min(dp[idx][v], dp[idx][v - value[idx]] + weight[idx])
        else:
            dp[idx + 1][v] = dp[idx][v]
ans = 0
# print(dp)
for i in range(value_sum + 1):
    if dp[-1][i] <= W:
        ans = i
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N , W = map(int, input().split())
goods = np.array([list(map(int , input().split())) for _ in range(N)])
dp = np.zeros((N + 1 , W + 1) , dtype = np.int)

for i in range(0,N):
    w, v = goods[i]
    dp[i + 1, w:] = np.maximum(dp[i,w:] , dp[i,:-w] + v)
    dp[i + 1, :] = np.maximum(dp[i + 1,:],dp[i,:])
print(int(dp[N,W]))

Buggy submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline
N, W = map(int, input().split())
weight = []
value = []
for _ in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)


def knapsack():
    dp = [[-1] * (W + 1) for _ in range(N + 1)]

    def solve(i, w):
        if dp[i][w] != -1:
            return dp[i][w]
        if N == i:
            ret_val = 0
        elif w - weight[i] < 0:
            ret_val = solve(i + 1, w)
        else:
            ret_val = max(solve(i + 1, w), solve(i + 1, w - weight[i]) + value[i])
        dp[i][w] = ret_val
        return dp[i][w]

    solve(0, W)
    # print(dp)
    return max(dp[0])


if __name__ == "__main__":
    print(knapsack())
Problem p03196 (python)

Fixed submission:
def solve(N, P):
    prime_list = []
    for i in range(2, int(P ** (1 / 2)) + 1):
        cnt = 0
        while P % i == 0:
            cnt += 1
            P //= i
        if cnt:
            prime_list.append([i, cnt])
    if P != 1:
        prime_list.append([P, 1])

    ans = 1
    for prime, cnt in prime_list:
        if cnt >= N:
            ans *= prime ** (cnt // N)
    return ans

if __name__ == '__main__':
    n, p = map(int, input().split())
    print(solve(n, p))

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())
if N == 1:
    print(P)
    exit()

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


div_list = make_divisors(P)
ans = 0
for i in range(10 ** 6 + 1):
    # idx = bisect.bisect_left(div_list, i ** N)
    # if i ** N == div_list[min(idx, len(div_list) - 1)]:
    if i ** N in div_list:
        ans = i
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
N, P = map(int, input().split())
if N == 1:
    print(P)
    exit()

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


div_list = make_divisors(P)
ans = 0
for i in range(10 ** 6 + 1):
    idx = bisect.bisect_left(div_list, i ** N)
    if i ** N == div_list[min(idx, len(div_list) - 1)]:
        ans = i
print(ans)
Problem p03231 (python)

Fixed submission:
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N, M)
d = {}
s = set()
for i in range(N):
    d[str(i * (L // N))] = S[i]
    s.add(str(i * (L // N)))

for i in range(M):
    key = str(i * (L // M))
    if key in s:
        if d[key] != T[i]:
            print(-1)
            exit()
print(L)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


N, M = map(int, input().split())
s = input()
t = input()
L = lcm(N, M)
X = [''] * L
for i in range(N):
    X[i * (L // N)] = s[i]
for i in range(M):
    if X[i * (L // M)] == '':
        X[i * (L // M)] = t[i]
    elif X[i * (L // M)] == t[i]:
        continue
    else:
        print(-1)
        exit()
# print(X)
print(L)
Problem p03238 (python)

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

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

if N == 1:
  print("Hello World")
else:
  print(a + b)
Problem p03262 (python)

Fixed submission:
import bisect
def gcd(x , y):
    max_val = max(x , y)
    min_val = min(x , y)
    while min_val != 0:
        max_val , min_val = min_val , max_val % min_val
    return max_val
N , X = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
split_idx = bisect.bisect_left(x , X)
BeforeList = x[:split_idx]
AfterList = x[split_idx:]
now = X
ans = 0
DistanceList = []
for val in AfterList:
    distance = abs(val - now)
    DistanceList.append(distance)
    now = val
for val in BeforeList:
    distance = abs(val - now)
    DistanceList.append(distance)
    now = val

ans = DistanceList[0]
for i in range(1,len(DistanceList)):
    ans = gcd(DistanceList[i] , ans)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
N, X = map(int, input().split())
x = list(map(int, input().split()))
x.insert(0, X)
distance = []
for i in range(1, len(x)):
    distance.append(abs(x[i] - x[i - 1]))

ans = distance[0]
for i in range(1, len(distance)):
    ans = gcd(ans, distance[i])
print(ans)
Problem p03361 (python)

Fixed submission:
H , W = map(int,input().split())
stage = list(list(input()) for _ in range(H))

dx = [0,1,0,-1]
dy = [1,0,-1,0]
for i in range(H):
    for j in range(W):
        if stage[i][j] == ".":
            continue
        Flag = True
        for k in range(4):
            if 0 <= j + dx[k] < W and 0 <= i + dy[k] < H and stage[i + dy[k]][j + dx[k]] == "#":
                Flag = False
                break
        if Flag:
            print("No")
            exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
H , W = map(int,input().split())
stage = list(list(input()) for _ in range(H))

dx = [0,1,0,-1]
dy = [1,0,-1,0]
for i in range(H):
    for j in range(W):
        if stage[i][j] == ".":
            continue
        Flag = True
        for k in range(4):
            if 0 <= i + dx[k] < W and 0 <= j + dy[k] < H  and stage[i + dx[k]][j + dy[k]] == "#":
                Flag = False
                break
        if Flag:
            print("No")
            exit()
print("Yes")
Problem p03436 (python)

Fixed submission:
from collections import deque

def dfs(stage , visited , start_x,start_y,goal_x,goal_y):
    queue = deque([[start_x,start_y]])
    visited[start_x][start_y] = 1
    while queue:
        x , y = queue.popleft()
        if [x , y] == [goal_x,goal_y]:
            return visited[x][y]

        for dx , dy in ([1,0],[-1,0],[0,1],[0,-1]):
            new_x , new_y = x + dx , dy + y
            #print(new_x,new_y)
            if 0 <= new_x <= goal_x and 0 <= new_y <= goal_y  and stage[new_x][new_y] == "." and visited[new_x][new_y] == -1:
                #print(new_x , new_y)
                visited[new_x][new_y] = visited[x][y] + 1
                queue.append([new_x,new_y])
    print("-1")
    exit(0)
if __name__ == "__main__":
    H , W = map(int , input().split())
    stage = []
    for _ in range(H):
        stage.append(list(input()))
    start_x,start_y ,goal_x,goal_y = 0,0,H-1,W-1
    visited = [[-1] * W for _ in range(H)]
    #print(visited)
    #print(stage)
    #print(visited[0][1])
    sum = 0
    for value in stage:
        sum += value.count('.')
    #print(sum)
    print(sum - dfs(stage,visited,start_x,start_y,goal_x,goal_y))

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

def dfs(stage , visited , start_x,start_y,goal_x,goal_y):
    queue = deque([[start_x,start_y]])
    visited[start_x][start_y] = 1
    while queue:
        x , y = queue.popleft()
        if [x , y] == [goal_x,goal_y]:
            return visited[x][y]
        for dx , dy in ([1,0],[-1,0],[0,1],[0,-1]):
            new_x , new_y = x + dx , dy + y
            #print(new_x,new_y)
            if 0 <= new_x <= goal_x and 0 <= new_y <= goal_y  and stage[new_x][new_y] == "." and visited[new_x][new_y] == -1:
                #print(new_x , new_y)
                visited[new_x][new_y] = visited[x][y] + 1
                queue.append([new_x,new_y])
        #print(queue)
if __name__ == "__main__":
    H , W = map(int , input().split())
    stage = []
    for _ in range(H):
        stage.append(list(input()))
    start_x,start_y ,goal_x,goal_y = 0,0,H-1,W-1
    visited = [[-1] * W for _ in range(H)]
    #print(visited)
    #print(stage)
    #print(visited[0][1])
    sum = 0
    for value in stage:
        sum += value.count('.')
    #print(sum)
    print(sum - dfs(stage,visited,start_x,start_y,goal_x,goal_y))
Problem p03471 (python)

Fixed submission:
N , Y = map(int , input().split())
for k1 in range(N + 1):
    for k5 in range(N + 1 - k1):
        k10 = N - k1 - k5
        if k1 + k5 + k10 == N and 1000 * k1 + 5000 * k5 + 10000 * k10 == Y and k10 >= 0:
            print(k10 , k5 , k1)
            exit(0)
print("-1 -1 -1 ")

Buggy submission (verdict: Runtime Error):
N , Y = map(int , input().split())
for y in range(N + 1):
    z = - N / 9 + Y / 9000 - 4 * y / 9
    tmp_z = z - int(z)
    if int(str(tmp_z)[2]) != 0:
        continue
    else:
        z = int(z)
    x = 5 * N / 4 - Y / 4000 + 5 * z / 4
    tmp_x = x - int(x)
    if int(str(tmp_x)[2]) != 0:
        continue
    else:
        x = int(x)
    '''
    if x >= 0 and y >= 0 and z >= 0:
        print("------------")
        print(x)
        print(y)
        print(z)
        print("------------")
    '''
    if x + y + z == N and 1000 * x + 5000 * y + 10000 * z == Y and 2000 >= x >= 0 and 2000 >= z >= 0:#and y >= 0 and z >= 0:
        print(z,y,x)
        exit(0)
print("-1 -1 -1")
Problem p03503 (python)

Fixed submission:
N = int(input())
open = []
for _ in range(N):
    open.append(list(map(int,input().split())))
sales = []
for _ in range(N):
    sales.append(list(map(int,input().split())))

ans = -float("inf")
for i in range(1 , 1024):
    sum_val = 0
    mapping = []
    for k in range(N):
        cnt = 0
        for j in range(10):
            if i >> j & 1 and open[k][j] == 1:
                cnt += 1
        mapping.append(cnt)
    for k in range(N):
        sum_val += sales[k][mapping[k]]
    if sum_val > ans:
        ans = sum_val
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
open = []
for _ in range(N):
    open.append(list(map(int,input().split())))
open = np.array(open)
sales = []
for _ in range(N):
    sales.append(list(map(int,input().split())))
sales = np.array(sales)

ans = -float("inf")
for i in range(1 , 1024):
    sum_val = 0
    mapping = []
    for k in range(N):
        cnt = 0
        for j in range(10):
            if i >> j & 1 and open[k][j] == 1:
                cnt += 1
        mapping.append(cnt)
    for k in range(N):
        sum_val += sales[k][mapping[k]]
    if sum_val > ans:
        ans = sum_val
print(ans)
Problem p03543 (python)

Fixed submission:
abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Buggy submission (verdict: Runtime Error):
abcd = list(input())
pirnt("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = input().split()
pirnt("Yes") if a==b==c or b==c==d else print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = input().split()
pirnt("Yes") if a==b==c or b==c==d else print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = input().split()
pirnt("Yes",if a==b==c or b==c==d else "No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = input()
pirnt("Yes",if a==b==c or b==c==d else "No")