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

Fixed submission:
r,g,b=map(int,input().split())
X = r * 100 + g * 10 + b
if X % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = input().split()
if (g*10+b)%4==0:
    print('YES')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
r,g,b = input().split()
if int((g*10+b)%4==0):
    print('YES')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
r,g b = input().split()
if int((g*10+b)%4==0):
    print('YES')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
r,g b = input().split()
if (g*10+b)%4==0:
    print('YES')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
r,g b = input().split()
if (g*10+b)%4%==0:
    print('YES')
else:
    print('No')
Problem p03086 (python)

Fixed submission:
S=input()
m=0
count=0
for s in S:
    if s in "A":count+=1
    elif s in "C":count+=1
    elif s in "G":count+=1
    elif s in "T":count+=1
    else:count=0
    m=max(m,count)
print(m)

Buggy submission (verdict: Runtime Error):
S=int(input())
m=0
count=0
for s in S:
    if s in "A":count+=1
    elif s in "C":count+=1
    elif s in "G":count+=1
    elif s in "T":count+=1
    else:count=0
    m=max(m,count)
print(m)
Problem p03146 (python)

Fixed submission:
S=int(input())
l=[]
while(S not in l):
    l.append(S)
    if S%2==0:S//=2
    else:S=3*S+1
print(len(l)+1)

Buggy submission (verdict: Runtime Error):
S=int(input())
l=[]
while(S not in l):
    l.append(S)
    if S%2==0:S//=2
    else:S=3*S+1
print(len(s)+1)
Problem p03316 (python)

Fixed submission:
n=input()
print("No" if int(n)%sum(map(int,n)) else "Yes")

Buggy submission (verdict: Runtime Error):
n=input()
print("No" if n%sum(map(int,n)) else "Yes")
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
for i in range(b-a+1):
    s.append(a+i)
    if i<k or i>b-a+1-k:print(a+i)
Problem p03399 (python)

Fixed submission:
a,b,c,d=[int(input()) for _ in range(4)]
print(min(a,b)+min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=[int(input()) for _ in range(4)]
print(min(a,b)+min(c.d))
Problem p03455 (python)

Fixed submission:
print("Odd" if eval(input().replace(" ","*"))%2 else "Even")

Buggy submission (verdict: Runtime Error):
print("Odd" if (int(input()).replace(" ","*"))%2 else "Even")

Buggy submission (verdict: Runtime Error):
print("Odd" if int(input()).replace(" ","*")%2 else "Even")
Problem p03494 (python)

Fixed submission:
input()
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
input()
A=list(map(int,input().split()))
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)
Problem p03547 (python)

Fixed submission:
x,y=input().split()
print("<" if x<y else "=" if x==y else ">")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
print("<" if x<y else "=" if x==y else ">")
Problem p03609 (python)

Fixed submission:
x,t=map(int,input().split())
print("0" if x-t<0 else x-t)

Buggy submission (verdict: Runtime Error):
X,t=map(int,input().split())
print("0" if x-t<0 else x-t)
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
print("Impossible" if a*b*(a+b)%3 else "Possible")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split()
print("Impossible" if a*b*(a+b)%3 else "Possible")
Problem p03693 (python)

Fixed submission:
print("NO" if int(input()[::2])%4 else "YES")

Buggy submission (verdict: Runtime Error):
print("NO" if int(input())[::2]%4 else "YES")
Problem p03813 (python)

Fixed submission:
x=int(input())
print("ABC" if x<1200 else "ARC")

Buggy submission (verdict: Runtime Error):
x=int(input())
print("ABC" x<1200 else "ARC")
Problem p03998 (python)

Fixed submission:
S={c:list(input()) for c in "abc"}
s="a"
while S[s]:s=S[s].pop(0)
print(s.upper())

Buggy submission (verdict: Runtime Error):
S=int(input())
l=[]
while(S not in l):
    l.append(S)
    if S%2==0:S/=2
    else:S=3*S+1
print(len(l)+1)
Problem p03469 (python)

Fixed submission:
import datetime
import sys

input_date = sys.stdin.read(10)
old_date = datetime.datetime.strptime(input_date, '%Y/%m/%d')
new_date = old_date.replace(old_date.year + 1)
out_date = "{0:%Y/%m/%d}".format(new_date)
print(out_date)

Buggy submission (verdict: Runtime Error):
import datetime

input_time = input()
old_date = datetime.datetime.strptime(input_time, '%Y/%m/%d')
new_date = old_date + datetime.timedelta(years=1)
print(new_date)
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H, W = map(list, input().split())
h, w = map(list, input().split())

print((H-h)*(W-w))
Problem p03112 (python)

Fixed submission:
a, b, q = map(int, input().split())
s = [int(input()) for _ in range(a)]
t = [int(input()) for _ in range(b)]
x = [(int(input()), i) for i in range(q)]
x = sorted(x)

def check(x, s0, s1, t0, t1):
    ans = float('inf')
    for x1, x2 in [(s0, t0), (s0, t1), (s1, t0), (s1, t1),
                   (t0, s0), (t0, s1), (t1, s0), (t1, s1)]:
        ans = min(ans, abs(x-x1)+abs(x1-x2))
    return ans

s0, t0 = -float('inf'), -float('inf')
s1, t1 = s[0], t[0]
i_s, i_t = 0, 0
answers = []
for x_i, i in x:
    while s1 < x_i and i_s < a-1:
        s0 = s1
        i_s += 1
        s1 = s[i_s]
    while t1 < x_i and i_t < b-1:
        t0 = t1
        i_t += 1
        t1 = t[i_t]
    ans = check(x_i, s0, s1, t0, t1)
    answers.append((i, ans))

for _, ans in sorted(answers):
    print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
inf = 10**18
a, b, q = map(int, input().split())
s = [-inf] + [int(input()) for _ in range(a)] + [inf]
t = [-inf] + [int(input()) for _ in range(a)] + [inf]

for _ in range(q):
    x = int(input())
    i = bisect.bisect_right(s, x)
    j = bisect.bisect_right(t, x)
    ans = inf
    for s_x in [s[i-1], s[i]]:
        for t_x in [t[j-1], t[j]]:
            ans0 = abs(s_x - x) + abs(t_x - s_x)
            ans1 = abs(t_x - x) + abs(s_x - t_x)
            ans = min(ans, ans0, ans1)
    print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
inf = 10**18
a, b, q = map(int, input().split())
s = [-inf] + [int(input()) for _ in range(a)] + [inf]
t = [-inf] + [int(input()) for _ in range(a)] + [inf]

for _ in range(q):
    x = int(input())
    i = bisect.bisect_right(s, x)
    j = bisect.bisect_right(t, x)
    ans = inf
    for s_x in [s[i-1], s[i]]:
        for t_x in [t[i-1], t[i]]:
            ans0 = abs(s_x - x) + abs(t_x - s_x)
            ans1 = abs(t_x - x) + abs(s_x - t_x)
            ans = min(ans, ans0, ans1)
    print(ans)
Problem p03128 (python)

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

n_use = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [0]+[-float('inf')]*n

for i in range(1, n+1):
    for a_j in a:
        i_prev = i - n_use[a_j]
        if i_prev < 0:
            continue
        else:
            dp[i] = max(dp[i], dp[i_prev]*10+a_j)
# print(dp)
print(dp[-1])

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

n_use = dict(zip(range(1, 10), [2, 5, 5, 4, 5, 6, 3, 7, 6]))
dp = [(0, 0)]*(n+1) # digit and produced number
for a_j in a:
    dp[n_use[a_j]] = (1, max(dp[n_use[a_j]][1], a_j))
for i in range(1, n+1):
    for a_j in a:
        d_cur, path_cur = dp[i]
        i_prev = i - n_use[a_j]
        if i_prev < 0:
            continue
        if dp[i_prev][0] == 0:
            continue
        else:
            d_prev, path_prev = dp[i_prev]
            path_new = a_j*pow(10, d_prev) + path_prev
            if path_new > path_cur:
                dp[i] = (d_prev+1, path_new)
            
# print(dp)
print(dp[-1][1])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
import pdb

n_use = dict(zip(range(1, 10), [2, 5, 5, 4, 5, 6, 3, 7, 6]))
dp = ['']*(n+1)
for a_i in a:
    dp[n_use[a_i]] = str(a_i)
for i in range(1, n+1):
    for a_j in a:
        path_cur = '0' if dp[i] == '' else dp[i]
        i_prev = i - n_use[a_j]
        if i_prev < 0:
            continue
        else:
            path_prev = dp[i_prev]
            if len(path_prev) == 0:
                continue
            path_new = str(a_j)+path_prev
            dp[i] = str(max(int(path_cur), int(path_new)))
            
# print(dp)
print(dp[-1])
Problem p03148 (python)

Fixed submission:
n, k = map(int, input().split())
td = [list(map(int, input().split())) for _ in range(n)]

td = sorted(td, key = lambda x: x[1], reverse = True)
eat_types = set()
sushi_dup = []
value = 0
for t, d in td[:k]:
    if not t in eat_types:
        eat_types.add(t)
    else:
        sushi_dup.append(d)
    value += d

ans = value + len(eat_types)**2
for t, d in td[k:]:
    if len(sushi_dup) == 0:
        break
    
    if t in eat_types:
        continue
    else:
        eat_types.add(t)
        r = sushi_dup.pop()
        value += d - r
        ans = max(ans, value + len(eat_types)**2)
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq
from collections import defaultdict
n, k = map(int, input().split())
td = [list(map(int, input().split())) for _ in range(n)]

td = sorted(td, key = lambda x: x[1], reverse = True)
sushi_types = set([])
sushi_tops = []
sushi_remains = []
for t, d in td:
    if not t in sushi_types:
        sushi_types.add(t)
        sushi_tops.append((t, d))
    else:
        sushi_remains.append((t, d))

n_types = len(sushi_types)
ans = sum([d for _, d in sushi_tops][:k]) + k**2
answers = [ans]
eat_types = set([t for t, _ in sushi_tops][:k])
i = 0
for t, d in sushi_tops[::-1]:
    eat_types.remove(t)
    while i < len(sushi_remains):
        t_r, d_r = sushi_remains[i]
        if t_r not in eat_types:
            i += 1
        else:
            ans = ans - d + d_r - (2*len(eat_types)+1)
            answers.append(ans)
            break
    # print(ans, (t, d), len(eat_types))
print(max(answers))
Problem p03248 (python)

Fixed submission:
s = input()
n = len(s)

if s[0] == '0' or s[-1] == '1':
    print(-1)
    exit()
for i in range(n-1):
    if s[i] != s[-2-i]:
        print(-1)
        exit()

path = {1:[v for v in range(2, n+1)]}

ans = []
u_cur, v_cur = 1, 2
n_prev = 0
for i in range(1, n//2):
    if s[i] == '1':
        for _ in range(i-n_prev):
            ans.append((u_cur, v_cur))
            v_cur += 1
        ans.append((v_cur, u_cur))
        u_cur, v_cur = v_cur, v_cur+1
        n_prev = i+1
for v in range(v_cur, n+1):
    ans.append((v_cur-1, v))
for a in ans:
    print(*a)

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)

if s[0] == '0' or s[-1] == '1':
    print(-1)
    exit()
for i in range(n-1):
    if s[i] != s[-2-i]:
        print(-1)
        exit()

ans = [(1, v) for v in range(2, n+1)]
u_child = 2
i_replace = -1
for i in range(1, n//2):
    if s[i] == '1':
        for _ in range(i):
            ans[i_replace] = (u_child, ans[i_replace][1])
            i_replace -= 1
        u_child += 1
for a in ans:
    print(*a)
Problem p03249 (python)

Fixed submission:
n = int(input())
d = [int(input()) for i in range(n)]

if sum(d)%2 > 0:
    print(-1)
    exit()

d = sorted([(dd, i) for i, dd in enumerate(d)], reverse = True)
d_to_i = {dd:i for dd, i in d}
n_child = [1]*n
d_child = [0]*n
ans = []
for dd, i in d:
    d_i = dd+2*n_child[i]-n
    if d_i in d_to_i.keys():
        i_next = d_to_i[d_i]
        ans.append((i+1, i_next+1))
        n_child[i_next] += n_child[i]
        d_child[i_next] += d_child[i] + n_child[i]
        if n_child[i_next] == n:
            break
    else:
        print(-1)
        exit()

d_min, i_min = d[-1]
if d_min == d_child[i_min]:
    for a in ans:
        print(*a)
else:
     print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(input()) for i in range(n)]

if sum(d)%2 > 0:
    print(-1)
    exit()

d_to_i = {d[i]:i+1 for i in range(n)}
d_set = set(d)
ans = []
while len(ans) < n-1:
    d_max, d_min = max(d_set), min(d_set)
    for m in range(1, n):
        if m*(n-m-1) == d_max-d_min:
            l = n-m-1
            break
    u = d_to_i[d_max]
    for diff in range(1, m+1):
        d_v = d_max - (m*l - (m-diff)*(l-diff))
        v = d_to_i[d_v]
        ans.append((u, v))
        u = v
        if d_v > d_min:
            d_set.remove(d_v)
    d_set.remove(d_max)

for a in ans:
    print(*a)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(input()) for i in range(n)]

# if sum(d)%2 >= 0:
#     print(-1)
#     exit()

d_to_i = {d[i]:i+1 for i in range(n)}
d_set = set(d)
ans = []
while len(ans) < n-1:
    d_max, d_min = max(d_set), min(d_set)
    for m in range(1, n):
        if m*(n-m-1) == d_max-d_min:
            l = n-m-1
            break
    u = d_to_i[d_max]
    for diff in range(1, m+1):
        d_v = d_max - (m*l - (m-diff)*(l-diff))
        v = d_to_i[d_v]
        ans.append((u, v))
        u = v
        if d_v > d_min:
            d_set.remove(d_v)
    d_set.remove(d_max)

for a in ans:
    print(*a)
Problem p03262 (python)

Fixed submission:
import fractions
n, X = list(map(int, input().split()))
x = list(map(int, input().split()))

x = sorted(x+[X])
x_diff = [x[i+1]-x[i] for i in range(n)]
# print(x, x_diff)
ans = x_diff[0]
for i in range(1, n):
    ans = fractions.gcd(ans, x_diff[i])
print(ans)

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

x = sorted(x+[X])
# print(x)
x_diff = [x[i+1]-x[i] for i in range(n)]
ans = x_diff[0]
for i in range(1, len(x_diff)):
    ans = math.gcd(ans, x_diff[i])
print(ans)
Problem p03267 (python)

Fixed submission:
l = int(input())

p = 0
while True:
    if 2**p > l:
        p -= 1
        break
    else:
        p += 1
        
n = p+1
m = 2*p
ans = []
for i in range(1, n):
    ans.append([i, i+1, 0])
    ans.append([i, i+1, 2**(i-1)])
    
while l > 2**p:
    for i in range(n-1, 0, -1):
        if l-2**(i-1) >= 2**p:
            ans.append([i, n, l-2**(i-1)])
            l = l-2**(i-1)
            m += 1
            break

print(n, m)
for a in ans:
    print(' '.join(list(map(str, a))))

Buggy submission (verdict: Runtime Error):
l = int(input())

for p in range(19, 0, -1):
    if 2**p < l:
        n = p+1
        break

p = n-1
m = 2*p
ans = []
for i in range(1, n):
    ans.append([i, i+1, 0])
    ans.append([i, i+1, 2**(i-1)])
    
while l > 2**p:
    for i in range(n-1, 0, -1):
        if l-2**(i-1) >= 2**p:
            ans.append([i, n, l-2**(i-1)])
            l = l-2**(i-1)
            m += 1
            break

print(n, m)
for a in ans:
    print(' '.join(list(map(str, a))))

Buggy submission (verdict: Runtime Error):
l = int(input())

for p in range(19, 0, -1):
    if 2**p < l:
        n = p+1
        break

p = n-1
m = 2*p
ans = []
for i in range(1, n):
    ans.append([i, i+1, 0])
    ans.append([i, i+1, 2**i])
    
while l > 2**p:
    for i in range(n-1, 0, -1):
        if l-2**(i-1) >= 2**p:
            ans.append([i, n, l-2**(i-1)])
            l = l-2**(i-1)
            m += 1
            break

print(n, m)
for a in ans:
    print(' '.join(list(map(str, a))))

Buggy submission (verdict: Runtime Error):
l = int(input())

for p in range(19, 0, -1):
    if 2**p < l:
        n = p+1
        break

p = n-1
m = 2*p
ans = []
for i in range(n-1):
    ans.append([i, i+1, 0])
    ans.append([i, i+1, 2**i])
    
while l > 2**p:
    for i in range(n-1, 0, -1):
        if l-2**(i-1) >= 2**p:
            ans.append([i, n, l-2**(i-1)])
            l = l-2**(i-1)
            m += 1
            break

print(n, m)
for a in ans:
    print(' '.join(list(map(str, a))))
Problem p03318 (python)

Fixed submission:
# almost the copy of answer #2730510 

def S(n):
    return sum(list(map(int, str(n))))

def norm(n):
    return n/S(n)

k = int(input())
j = 1
order = 1
for i in range(k):
    print(j)
    if norm(j+10**(order-1)) > norm(j+10**(order)):
        order += 1
    j += 10**(order-1)

Buggy submission (verdict: Runtime Error):
from collections import deque
k = int(input())

digsum = lambda x: sum(list(map(int, list(str(x)))))

que = deque([])
MAX = 800000
min_v = MAX
for i in range(MAX-1, 0, -1):
    v = i/digsum(i)
    if v <= min_v:
        que.append(i)
        # print(i, v)
        min_v = v
        
while k > 0:
    print(que.pop())
    k -= 1

Buggy submission (verdict: Runtime Error):
from collections import deque
k = int(input())

digsum = lambda x: sum(list(map(int, list(str(x)))))

que = deque([])
MAX = 500000
min_v = MAX
for i in range(MAX-1, 0, -1):
    v = i/digsum(i)
    if v <= min_v:
        que.append(i)
        # print(i, v)
        min_v = v
        
while k > 0:
    print(que.pop())
    k -= 1
Problem p03354 (python)

Fixed submission:
from collections import deque
n, m = map(int, input().split())
p = list(map(int, input().split()))
paths = {}
for _ in range(m):
    x, y = map(int, input().split())
    if not x in paths.keys():
        paths[x] = [y]
    else:
        paths[x].append(y)
    if not y in paths.keys():
        paths[y] = [x]
    else:
        paths[y].append(x)

connected = [None]*(n+1)
path_id = 1
for i in range(1, n+1):
    if connected[i] is None:
        connected[i] = path_id
    else:
        continue

    if i in paths.keys():
        stack = deque(paths[i])
        cluster = set([i]+paths[i])
    else:
        stack = []
    while len(stack) > 0:
        j = stack.pop()
        connected[j] = path_id
        for k in paths[j]:
            if connected[k] is None and not k in cluster:
                stack.append(k)
                cluster.add(k)
    path_id += 1
# print(connected)

ans = 0
for i in range(n):
    if connected[i+1] == connected[p[i]]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
n, m = map(int, input().split())
p = list(map(int, input().split()))
paths = {}
for _ in range(m):
    x, y = map(int, input().split())
    if not x in paths.keys():
        paths[x] = [y]
    else:
        paths[x].append(y)
    if not y in paths.keys():
        paths[y] = [x]
    else:
        paths[y].append(x)

connected = [None]*(n+1)
path_id = 1
for i in range(1, n+1):
    if connected[i] is None:
        connected[i] = path_id
    else:
        continue

    stack = deque(paths[i]) if i in paths.keys() else []
    cluster = set([i]+paths[i])
    while len(stack) > 0:
        j = stack.pop()
        connected[j] = path_id
        for k in paths[j]:
            if connected[k] is None and not k in cluster:
                stack.append(k)
                cluster.add(k)
    path_id += 1
# print(connected)

ans = 0
for i in range(n):
    if connected[i+1] == connected[p[i]]:
        ans += 1
print(ans)
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split(' '))
if a <= b:
	print(a)
else:
	print(a-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input.split(' '))
if a <= b:
	print(a)
else:
	print(a-1)
Problem p03360 (python)

Fixed submission:
a, b, c = list(map(int, input().split(' ')))
N = int(input())
max_ = max([a, b, c])
print(a+b+c+max_*(2**N)-max_)

Buggy submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split(' ')))
N = int(input())
max_ = max([a, b, c]
print(a+b+c+max_**N-max_)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split(' '))
N = int(input())
max_ = max([a, b, c]
print(a+b+c+max_**N-max_)
Problem p03418 (python)

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

if k == 0:
    print(n**2)
    exit()
    
ans = 0
for b in range(k+1, n+1):
    ans_bk = (n-k)//b+1
    ans_b = ans_bk*(b-k)
    
    mod_k_max = ((n-k)//b)*b+k
    if n-mod_k_max+1 < b-k:
        ans_b -= ((b-k) - (n-mod_k_max+1))
    # print(ans_b)
    ans += ans_b
            
print(ans)

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

if k == 0:
	print(n**2)
	exit()
    
ans = 0
for b in range(k+1, n+1):
	p = n//b
	r = n%b
    
    ans += p*(b-k)-1
    ans += max(0, r-k+1)
print(ans)
Problem p03434 (python)

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

p_a = sum(sorted(a, reverse = True)[::2])
p_b = sum(a) - p_a
print(p_a - p_b)

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

ans = 'No'
for i in range(a+1):
    if (n-i)%500 == 0:
        ans = 'Yes'
        break
print(ans)
Problem p03474 (python)

Fixed submission:
a, b = list(map(int, input().split()))
s = input().split('-')

if len(s) != 2:
    print('No')
elif len(s[0]) == a and len(s[1]) == b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().slpit()))
s = input().split('-')

if len(s) != 2:
    print('No')
elif len(s[0]) == a and len(s[1]) == b:
    print('Yes')
else:
    print('No')
Problem p03504 (python)

Fixed submission:
T_MAX = 10**5
n, nc = list(map(int, input().split()))
stc = [list(map(int, input().split())) for _ in range(n)]

recs = [[0]*(T_MAX+1) for c in range(nc+1)]
for s, t, c in stc:
    recs[c][s-1:t] = [1]*(t-s+1)

ans = max(map(sum, zip(*recs)))
print(ans)

Buggy submission (verdict: Runtime Error):
T_MAX = 10**5
n, nc = list(map(int, input().split()))
stc = [list(map(int, input().split())) for _ in range(n)]

rec = [0]*(2*T_MAX+1)
for i in range(n):
    s, t, c = stc[i]
    rec[2*s-1] += 1
    rec[2*t+1] -= 1

for i in range(1, len(rec)):
    rec[i] += rec[i-1]
# print(rec[:100])

print(max(rec))
Problem p03545 (python)

Fixed submission:
a, b, c, d = list(map(int, list(input())))

ops = {'+', '-'}

for op1 in ops:
    if op1 == '+': ab = a+b
    else: ab = a-b
    
    for op2 in ops:
        if op2 == '+': abc = ab+c
        else: abc = ab-c
        
        for op3 in ops:
            if op3 == '+': abcd = abc+d
            else: abcd = abc-d

            if abcd == 7:
                a, b, c, d = map(str, [a, b, c, d])
                print(a+op1+b+op2+c+op3+d+'=7')
                exit()

Buggy submission (verdict: Runtime Error):
a, b, c, d = list(map(int, list(input())))

ops = {'+', '-'}

for op1 in ops:
    if op1 == '+': ab = a+b
    else: ab = a-b
    
    for op2 in ops:
        if op2 == '+': abc = ab+c
        else: abc = ab-c
        
        for op3 in ops:
            if op3 == '+': abcd = abc+d
            else: abcd = abc-d

            if abcd == 7:
                print(f'{a}{op1}{b}{op2}{c}{op3}{d}=7')
                exit()