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

Fixed submission:
S = input()
T = input()
count = 0
for i in range(3):
    if S[i]==T[i]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
def culc(n):
    if n%2==0:
        return (n+1)*(n/2)-n
    if n%2==1:
        return (n+1)*((n-1)/2)+(n+1)/2-n

N = int(input())
if N == 1:
    print(0)
else:
    print(int(culc(N)))

Buggy submission (verdict: Runtime Error):
def culc(n):
    if n%2==0:
        return (n+1)*(n/2)-n
    if n%2==1:
        return (n+1)*((n-1)/2)+(n+1)/2-n

N = int(input())
if N == 1:
    print(0)
else:
    print(culc(N))
Problem p02934 (python)

Fixed submission:
N = int(input())
A = list(map(float, input().split()))
deno = 0
for i in range(N):
    deno += 1/A[i]
print(1/deno)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(float, input().split()))
deno = 1
for i in range(N):
    deno += 1/A[i]
print(1/deno)
Problem p03145 (python)

Fixed submission:
s = list(map(int,input().split()))
s.sort()
print(int(s[0]*s[1]/2))

Buggy submission (verdict: Runtime Error):
N = int(input())
h = list(map(int,input().split()))
ans = h[0]
for i in range(1,N):
    if h[i]-h[i-1]>0:
        ans += h[i]-h[i-1]
print(ans)
Problem p03146 (python)

Fixed submission:
def func(n):
    count = 1
    while(n!=4):
        if n%2==0:
            n = n // 2
        else:
            n = 3*n + 1
        count += 1
    return count + 3


s = int(input())
if s==1:
    print(4)
elif s==2:
    print(4)
elif 3<=s and s<=100:
    print(func(s))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
s = int(input())
if s==1:
    print(4)
elif s==2:
    print(4)
else:
    print(func(s))
Problem p03289 (python)

Fixed submission:
S = input()
if S[0] == 'A' and S[2:-1].count('C')==1 and sum([c.isupper() for c in S])==2 :
  print('AC')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
S = input()
if S[0] == 'A' and S[2:-1].count('C')==1 and sum([for c in S c.isupper()])==2 :
  print('AC')
else:
  print('WA')
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a%2==1&&b%2==1:
    print("Odd")
else:
    print("Even")
Problem p03471 (python)

Fixed submission:
N,Y = map(int,input().split())
for x in range(N+1):
    for y in range(N-x+1):
        if 10000*x+5000*y+1000*(N-x-y)==Y:
            print(x,y,N-x-y)
            exit()
x = -1
print(x,x,x)

Buggy submission (verdict: Runtime Error):
N,Y = int(input().split())
for x in range(1,N+1):
    for y in range(1,N-x+1):
        for z in range(1,N-x-y+1):
            if 10000*x+5000*y+1000*z==Y:
                print(x,y,z)
                exit()
print("-1 -1 -1")
Problem p02760 (python)

Fixed submission:
a,b,c=input().split()
d,e,f=input().split()
g,h,i=input().split()

loopin=input()

A11,A12,A13,A21,A22,A23,A31,A32,A33=0,0,0,0,0,0,0,0,0


for x in range(int(loopin)):
	bingo = input()
	if bingo==a:
		A11=1
	elif bingo==b:
		A12=1	
	elif bingo==c:
		A13=1	
	elif bingo==d:
		A21=1	
	elif bingo==e:
		A22=1	
	elif bingo==f:
		A23=1	
	elif bingo==g:
		A31=1	
	elif bingo==h:
		A32=1
	elif bingo==i:
		A33=1


if (A11+A12+A13)==3:
	print("Yes")
elif (A21+A22+A23)==3:
	print("Yes")
elif (A31+A32+A33)==3:
	print("Yes")
elif (A11+A21+A31)==3:
	print("Yes")
elif (A12+A22+A32)==3:
	print("Yes")
elif (A13+A23+A33)==3:
	print("Yes")
elif (A11+A22+A33)==3:
	print("Yes")
elif (A13+A22+A31)==3:
	print("Yes")
else:
	print("No")

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

bingolist = []



A11,A12,A13,A21,A22,A23,A31,A32,A33=0,0,0,0,0,0,0,0,0


for i in range(int(loopin)):
	bingo = input()
	if bingo==a:
		A11=1
	elif bingo==b:
		A12=1	
	elif bingo==c:
		A13=1	
	elif bingo==d:
		A21=1	
	elif bingo==e:
		A22=1	
	elif bingo==f:
		A23=1	
	elif bingo==g:
		A31=1	
	elif bingo==h:
		A32=1	
	elif bingo==i:
		A33=1	

if (A11+A12+A13)==3:
	print("Yes")
elif (A21+A22+A23)==3:
	print("Yes")
elif (A31+A32+A33)==3:
	print("Yes")
elif (A11+A22+A33)==3:
	print("Yes")
elif (A13+A22+A31)==3:
	print("Yes")
else:
	print("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().split()
if s=='Sunny':
  print('Cloudy')
ifelse s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s=input()
if s=='Sunny':
  print('Cloudy')
ifelse s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
Problem p02957 (python)

Fixed submission:
a,b=map(int, input().split())
if (a+b)%2==1:
  print('IMPOSSIBLE')
else:
  k=int((a+b)/2)
  print(k)

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
if (a+b)%2==1:
  print('IMPOSSIBLE')
else:
  print(int(a+b)/2))
Problem p03455 (python)

Fixed submission:
a,b=input().split()
aa=int(a)
bb=int(b)
if aa*bb%2==0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a=int
b=int
c=a*b%2

if c==0:
  print(even)
else:
  print(odd)
Problem p03693 (python)

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

Buggy submission (verdict: Runtime Error):
r,g,b=map(int, input.split())
x=100*r+10*g+b
if x%4==0:
 print('YES')
else:
  print('NO')
Problem p03943 (python)

Fixed submission:
from functools import reduce
from operator import add

A = list(map(int, input().split()))
M = max(A)
T = [i for i in A if i != M]
if len(T) == 0:
    print("No")
else:
    print("Yes" if M==reduce(add, T) else "No")

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

A = list(map(int, input().split()))
print("Yes" if max(A) == reduce(add, [i for i in A if i != max(A)]) else "No")
Problem p02811 (python)

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

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

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

if(500*K>=X):
  print("Yes")
else:
  print("No")
Problem p02885 (python)

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

ans = A-B*2

if(ans>=0):
  print(ans)
else:
  print("0")

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

ans = A-B*2

if(x>=0):
  print(ans)
else:
  print("0")
Problem p02923 (python)

Fixed submission:
import sys
input = sys.stdin.readline

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


N = N+1
H.insert(0,-100)

A = [ 0 for _ in range(N)]
tmp=0

for i in range(N-1,0,-1):
    if(H[i] <= H[i-1]):
        tmp +=1
    else:
        A[i]= tmp
        tmp = 0

print(max(A))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

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

A = [ 0 for _ in range(N)]
tmp=0
N = N+1
H.insert(0,-100)

for i in range(N-1,0,-1):
    if(H[i] <= H[i-1]):
        tmp +=1
    else:
        A[i]= tmp
        tmp = 0

print(max(A))
Problem p02947 (python)

Fixed submission:
from collections import Counter
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


N = int(input())

s = [ list(input()) for _ in range(N)]
for i in range(N):
    s[i].sort()
    s[i]=''.join(s[i])

s.sort()
s.append('0')
ans_tmp = 0
ans = 0
for i in range(N):
    if(s[i]== s[i+1]):
        ans_tmp += 1
    elif(ans_tmp>=1):
        ans+= cmb(ans_tmp+1, 2)
        ans_tmp=0


print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


N = int(input())

s = [ list(input()) for _ in range(N)]
for i in range(N):
    s[i].sort()
    s[i]=''.join(s[i])

s.sort()

ans_tmp = 0
ans = 0
for i in range(N-1):
    if(i == N-2):
        if(s[i]== s[i+1]):
            ans_tmp += 1
        ans+= cmb(ans_tmp+1, 2)
    if(s[i]== s[i+1]):
        ans_tmp += 1
    elif(ans_tmp>=1):
        ans+= cmb(ans_tmp+1, 2)
        ans_tmp=0


print(ans)
Problem p03059 (python)

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

print(B*(T//A))

Buggy submission (verdict: Runtime Error):
from math import gcd
import copy 

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

if __name__ == '__main__':
	N=int(input())
	A=list(map(int,input().split()))

	ans=0
	for i in range(N):
		l=copy.deepcopy(A)
		l.pop(int(i))
		if(N>2):
			tmp_gcd=math.gcd(l[0],l[1])
			for j in range(2,len(l)):
				tmp_gcd=gcd(l[j],tmp_gcd)
			if(tmp_gcd > ans):
				ans=tmp_gcd
		else:
			ans=gcd(A[0],A[1])
	print(ans)

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

V=list(map(int,input().split()))
C=list(map(int,input().split()))

ans=0
for i in range(N):
	if(V[i]-C[i]>0):
		ans+=V[i]-C[i]
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,T=map(int,input())

print(B*(T//A))
Problem p03076 (python)

Fixed submission:
L = []
for i in range(5):
    L.append(int(input()))

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

if(len(tmp) > 0):
    ans -= 10 - min(tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
L = []
for i in range(5):
    L.append(int(input()))

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

ans -= 10 - min(tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
L = []
for i in range(5):
    L.append(int(input()))

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

ans -= min(tmp)

print(ans)
Problem p03106 (python)

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

tmp = []

for i in range(1,max(A,B)+1):
    if((A % i == 0) and (B%i==0)):
        tmp.append(i)

tmp.reverse()
#print(tmp)
print(tmp[K-1])

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

tmp = []

for i in range(1,A):
    if((A % i == 0) and (B%i==0)):
        tmp.append(i)

tmp.reverse()
print(tmp[K-1])
Problem p03136 (python)

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

M = max(L)

if(M < sum(L)-M):
    print('Yes')
else:
    print('No')

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

M = L.pop(max(L))

if(M < sum(L)):
    print('Yes')
else:
    print('No')
Problem p03377 (python)

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


if(A<=X and X-A <= B):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A,B,X = map(int,input())


if(A<=X and X-A <= B):
    print('YES')
else:
    print('NO')
Problem p03485 (python)

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

if((a+b)%2 == 1):
    print((a+b)//2+1)
else:
    print((a+b)//2)

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

if((a+b)%2 == 1):
    print((a+b)//2+1)
else:
    print((a+b)//)
Problem p03501 (python)

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

if(A*T > B):
    print(B)
else:
    print(A*T)

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

if(A*T > B):
    print(B)
else:
    print(A*T)
Problem p03543 (python)

Fixed submission:
s = input()

if(s[1]==s[2]):
    if(s[1]==s[3] or s[1]==s[0]):
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

if(s[1]==s[2]):
    if(s[1]==s[4] or s[1]==s[0]):
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

if(s[1]==a[2]):
    print('Yes')
else:
    print('No')
Problem p04029 (python)

Fixed submission:
N = int(input())

print((N*(N+1)//2))

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

print((N*(N+1)//2)
Problem p03212 (python)

Fixed submission:
N = int(input())

def dfs(s):
    if int (s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s+c)
    return ret

print(dfs('0'))

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
/* TLEだった orz 
int main() {
  ll N; cin >> N;
  ll val = 357, cnt = 0;
  while (N >= val) {
    string s = to_string(val);
    bool three=false,five=false,seven=false,ok=true;
    for(int i=0; i < s.size(); i++) {
      if(s[i]=='3')three=true;
      else if(s[i]=='5')five=true;
      else if(s[i]=='7')seven=true;
      else ok = false;
    }
    if(three&&five&&seven&&ok){
      cnt++;
      //cout<<"s = "<<s<<endl;
      //printf("cnt=%d\n",cnt);
    }
    val++;
  }
  cout << cnt << endl;
} 
*/
int N, ans;
void dfs(ll x,bool flag3,bool flag5,bool flag7) {
    if(x > N) {
        return ;
    }
    if(flag3 && flag5 && flag7) {
        ans++;
    }
    dfs(x*10+3, true, flag5, flag7);
    dfs(x*10+5, flag3, true, flag7);
    dfs(x*10+7, flag3, flag5, true);
}
int main() {
    cin >> N;
    dfs(0,0,0,0);
    cout << ans << endl;
}
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):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))

count = 0
for i in range(0, n):
    a = list(map(int, input().split()))
    s = 0
    for j in range(0, m):
        s += a[j] * b[j]
    if s + c > 0:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
H, W, h, w = map(int, input().split())
print((H - h) * (W - w))
Problem p03323 (python)

Fixed submission:
a, b = map(int, input().split())
print('Yay!' if a <= 8 and b <= 8 else ':(')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
print('Yay' if a <= 8 and b <= 8 else ':(')
Problem p03493 (python)

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
def main():
    unko = raw_input()
    unko_ans = 0
    for i in range(3):
        if unko[i] == '1':
            unko_ans = unko_ans + 1
    print(unko_ans)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
def main():
    unko = raw_input()
    unko_ans = 0
    for i in range(3):
        if unko[i] == '1':
            unko_ans = unko_ans + 1
    print(unko_ans)
if __name__ == "__main__":
    main()
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())
 
if n < 10:
	print(r + 100*(10-n))
else:
    print(r)

Buggy submission (verdict: Runtime Error):
n, r = map(int, input().split())
 
if n < 10:
	print(r + 100*(10-k))
else:
    print(r)
Problem p02767 (python)

Fixed submission:
n = int(input())
list_x = list(map(int, input().split()))
 
#iが座標の位置
 
list_ans = []
 
for i in range(min(list_x), max(list_x)+1):
    
    #計算する
    ans = 0
    for j in list_x:
        ans += (i-j)**2
 
    list_ans.append(ans)
  
print(min(list_ans))

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

#iが座標の位置

list_ans = []

for i in range(min(list_x), max(list_x)):
    
    #計算する
    ans = 0
    for j in list_x:
        ans += (i-j)**2

    list_ans.append(ans)

print(min(list_ans))
Problem p02922 (python)

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

if B == 1:
    print(0)
    exit()
    
for i in range(1, 400):
    count = count + A - 1
    if count >= B:
        print(i)
        exit()

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
count = 1
for i in range(100000):
    count = count + A - i
    if count > B
        print(i)
        exit()
Problem p02953 (python)

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

# 右から左へ走査する
for i in reversed(range(1, n)):
    l, r = list_h[i-1], list_h[i]

    #左が小さい場合
    if l <= r:
        continue

    #一個だけ左が大きい場合
    elif l - 1 == r:
        list_h[i-1] = list_h[i-1] -1
        continue

    #あかんパターン
    else:
        print("No")
        exit()

print("Yes")

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

# 左から走査する
for i in reversed(range(1, n)):
    print(list_h, i)
    l, r = list_h[i-1], list_h[i]

    #左が小さい場合
    if l <= r:
        continue

    #一個だけ左が大きい場合
    elif l - 1 == r:
        list_h[i-1] = list_h[i-1] -1
        continue
    #あかんパターン
    else:
        print("No")
        exit()

print("YES")

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

# 左から走査する
for i in range(n-1):
    l, r = list_h[i], list_h[i+1]
    if l == R:
        continue
    elif l + 1 == r:
        list_h[i+1] = list_h[i+1] -1
        continue
    else:
        print("No")
        exit()

print("YES")
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())

if r-l>=2019 :
    print(0)
    exit()

l = l%2019
r = r%2019

if l == 0 or r == 0 :
    print(0)
    exit()

if l > r:
    r += 2019

# print(l, r)

list_score = []
for i in range(l+1, r+1):
    for j in range(l, i):
        # print(i, j)
        list_score.append(i*j%2019)
# print(list_score)
print(int(min(list_score)))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

l = l%2019
r = r%2019

if l == 0 or r == 0 :
    print(0)
    exit()

if l > r:
    r += 2019

# print(l, r)

list_score = []
for i in range(l+1, r+1):
    for j in range(l, j):
        # print(i, j)
        list_score.append(i*j%2019)
# print(list_score)
print(int(min(list_score)))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

l = l%2019
r = r%2019

list_score = []
for i in range(l+1, r+1):
    for j in range(i, r+1):
        list_score.append(i*j%2019)

print(int(min(list_score)))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

l = l%2019
r = r%2019

list_score = []
for i in range(l+1, r+1):
    for j in range(l+1, r+1):
        list_score.append(i*j%2019)
        print(i*j%2019)

print(int(min(list_score)))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

l = l%2019
r = r%2019

list_score = []
for i in range(l, r+1):
    for j in range(i+1, r+1):
        list_score.append(i*j%2019)

print(int(min(list_score)))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

l = l%2019
r = r%2019

list_score = []
for i in range(l, r+1):
    for j in range(i+1, r+1):
        list_score.append(i*j%2019)

print(min(list_score))
Problem p02993 (python)

Fixed submission:
s = input()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print("Bad")
        exit()

print("Good")

Buggy submission (verdict: Runtime Error):
import pandas as pd
s = input()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print("Bad")
        exit()

print("Good")
Problem p02996 (python)

Fixed submission:
import heapq as hq

n = int(input())

list_A = []
list_B = []
h = []
for i in range(n):
    a, b = map(int, input().split())
    hq.heappush(h, [b, a])

time = 0
for _ in range(n):
    b, a = hq.heappop(h)
    time += a
    if b < time:
        print("No")
        exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
import pandas as pd
n = int(input())

list_A = []
list_B = []

for i in range(n):
    a, b = map(int, input().split())
    list_A.append(a)
    list_B.append(b)

# print(list_A , list_B)

df = pd.DataFrame()
df["a"] = list_A
df["b"] = list_B
df = df.sort_values(["b", "a"]).reset_index(drop = True)
for i in df.index[1:]:
    df.loc[i, "a"] = df.loc[i, "a"] + df.loc[i-1, "a"]
    if df.loc[i, "a"] > df.loc[i, "b"]:
        print("No")
        exit()
print("Yes")
Problem p03029 (python)

Fixed submission:
a, p = map(int, input().split())
print(int((a*3 + p)/2))

Buggy submission (verdict: Runtime Error):
a, p = map(int, input().split())
print(int((a*3 + p)/2)
Problem p03457 (python)

Fixed submission:
n = int(input())
list_plan = []
for i in range(n):
    t, x, y = map(int, input().split())
    list_plan.append([t, x, y])

for i in list_plan:
    t, x, y = i[0], i[1], i[2]
    if x + y <= t and (t - x - y)%2 == 0:
        pass
    else:
        print("No")
        exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
t, x, y = 0, 0, 0
tn, xn, yn = 0, 0, 0

for i in list_plan:
    tn, xn, yn = int(i[0]) - t, int(i[1]) - x, int(i[2]) - y
    tn, xn, yn = abs(tn), abs(xn), abs(yn)
    if xn + yn < tn and (tn - xn - yn)%2 == 0:
        t, x, y = i[0], i[1], i[2]
    else:
        print("No")
        exit()
        
print("Yes")
Problem p03545 (python)

Fixed submission:
s = input()
n = len(s) - 1 #隙間の数

for i in range(2**3):
    tmp = s[0]
    for j in range(n):
        if (i >> j) & 1:
            tmp += "+"

        else:
            tmp += "-"

        tmp += s[j+1]

    list_tmp = [tmp[0], tmp[1:3], tmp[3:5], tmp[5:7]]

    res = 0
    for j in list_tmp:
        res += int(j)

    if res == 7:

        print(tmp + "=7")
        exit()

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s) - 1 #隙間の数

for i in range(2**3):
    tmp = s[0]
    for j in range(n):
        if (i >> j) & 1:
            tmp += "+"

        else:
            tmp += "-"

        tmp += s[j+1]

    list_tmp = [tmp[0], tmp[1:3], tmp[3:5], tmp[5:7]]

    for j in list_tmp:
        res += int(j)

    if res == 7:

        print(tmp + "=7")
        exit()
Problem p02909 (python)

Fixed submission:
weather = ['Sunny', 'Cloudy', 'Rainy']
s = input()
for i,v in enumerate(weather):
    if v == s:
        print(weather[(i + 1) % 3])

Buggy submission (verdict: Runtime Error):
weather = ['Sunny', 'Cloudy', 'Rainy']
s = input()
for i,v in enumerate(weather):
    if v == s:
        print(weather[i + 1 % 3])

Buggy submission (verdict: Runtime Error):
weather = ['Sunny', 'Cloudy', 'Rainy']
s = input()
for i,v enumerate(weather):
    if v == s:
        print(weather[i + 1 % 3])
Problem p02981 (python)

Fixed submission:
n, a, b = map(int, input().split())
print(min(a*n, b))

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
count = 0
x_list = (list(map(int, input().split())) for _ in range(n))

for i in range(n-1):
    for j in range(i+1, n):
        count += (sum((a-b)**2 for a,b in zip(x_list[i], x_list[j]))**0.5).is_integer
print(count)
Problem p02982 (python)

Fixed submission:
import math

n, d = map(int, input().split())
x_list = []
count = 0

for i in range(n):
    x_list.append([int(i) for i in input().split()])

for i in range(len(x_list)-1):
    for j in range(i+1, len(x_list)):
        cal = 0
        for k in range(d):
            cal += (x_list[i][k] - x_list[j][k])**2
        if math.sqrt(cal) == int(math.sqrt(cal)):
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
count = 0
x_list = (list(map(int, input().split())) for _ in range(n))

for i in range(n-1):
    for j in range(i+1, n):
        count += (sum((a-b)**2 for a,b in zip(x_list[i], x_list[j]))**0.5).is_integer
print(count)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
count = 0
x_list = (list(map(int, input().split())) for _ in range(n)))

for i in range(n-1):
    for j in range(i+1, n):
        count += (sum((a-b)**2 for a,b in zip(x_list[i], x_list[j]))**0.5).is_integer
print(count)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
count = 0
x_list = (list(map(int, input().split())) for _ in range(n)))

for i in range(n-1):
    for j in range(i+1, n):
        count += (sum((a-b)**2 for a,b in zip(x_list[i], x_list[j]))**0.5).is_integer
print(count)
Problem p03029 (python)

Fixed submission:
a, p = map(int, input().split())
print((a*3+p)//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s_p_list = []

for i in range(n):
    s_p_list.append(input().split())
    s_p_list[i].append(i+1)

result = sorted(s_p_list, key=lambda x: (x[0], -int(x[1]))) #sortedは非破壊的

for i in result:
  print(i[2])