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

Fixed submission:
A, B = map(int, input().split())
if A % 2 is 0 or B % 2 is 0:
    print('No')
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = x[0] - X
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, a - X)
print(t)

Buggy submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = x[0] - X
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, abs(a - X))
print(t)

Buggy submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = abs(x[0] - X)
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, a - X)
print(t)

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>

#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))
#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))
#define repv(i, v) for (unsigned (i)(0); (i)<(v.size()); ++(i))
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define sortgi(v) sort(all(v), greater<int>())
#define sortgd(v) sort(all(v), greater<double>())
#define sortgll(v) sort(all(v), greater<ll>())
#define debug(x) cerr << #x << ": " << x << '\n'

using namespace std;
using pii = pair<int, int>;
using pss = pair<string, string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vpii = vector<pii>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;

int main() {
	int a, b;
	cin >> a >> b;
	if (a % 2 == 0 || b % 2 == 0) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
}
Problem p03261 (python)

Fixed submission:
import sys
N = int(input())
s = []
for i in range(N):
    s.append(input())
for i, s0 in enumerate(s):
    for j, s1 in enumerate(s):
        if i != j and s0 == s1:
            print('No')
            sys.exit()
s0 = s[0]
for i in range(1, len(s)):
    s1 = s[i]
    if s0[-1] != s1[0]:
        print('No')
        sys.exit()
    s0 = s1
print('Yes')

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>

#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))
#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))
#define repv(i, v) for (unsigned (i)(0); (i)<(v.size()); ++(i))
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define sortgi(v) sort(all(v), greater<int>())
#define sortgd(v) sort(all(v), greater<double>())
#define sortgll(v) sort(all(v), greater<ll>())
#define debug(x) cerr << #x << ": " << x << '\n'

using namespace std;
using pii = pair<int, int>;
using pss = pair<string, string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vpii = vector<pii>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;

int main() {
	int n;
	cin >> n;
	vs w;
	rep(i, 0, n) {
		string s;
		cin >> s;
		w.push_back(s);
	}
	string s0(w[0]);
	repv(i, w) {
		repv(j, w) {
			if (w[i] == w[j] && i != j) {
				cout << "No" << endl;
				return 0;
			}
		}
	}
	rep(i, 1, n) {
		string s1 = w[i];
		if (s0[s0.size() - 1] != s1[0]) {
			cout << "No" << endl;
			return 0;
		}
		s0 = s1;
	}
	cout << "Yes" << endl;
}
Problem p03309 (python)

Fixed submission:
sousuu = int(input())
listnum = list(map(int, input().split()))
_list = []
for i in range(sousuu):
    _list.append(listnum[i] - (1 + i))
num = sorted(_list)[sousuu//2]
dst = 0
for i in range(sousuu):
    dst += abs(listnum[i] - (i+1+num))
print(dst)

Buggy submission (verdict: Runtime Error):
import math
sousuu = int(input())
listnum = list(map(int, input().split()))
posinum = sousuu // 2 if sousuu % 2 == 0 else sousuu // 2 + 1
posival = sum(listnum) // len(listnum)
dst = math.inf
for p in range(posinum - 3, posinum + 3):
    _dst = 0
    for i, s in enumerate(range(p - sousuu//2, p - sousuu//2 + sousuu)):
        _dst += abs(listnum[i] - s)
    if dst > _dst:
        dst = _dst
print(dst)
Problem p03370 (python)

Fixed submission:
n, x = map(int, input().split())
don = [int(input()) for i in range(n)]
dst = (x - sum(don)) // min(don) + n
print(dst)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
don = [int(stdin[i]) for i in range(n)]
dst = (x - sum(don)) // min(don) + n
print(dst)
Problem p04044 (python)

Fixed submission:
def hikaku(n1, n2):
    for x, y in zip(n1, n2):
        if ord(x) == ord(y):
            continue
        else:
            return True if ord(x) > ord(y) else False
num, length = map(int, input().split())
wlist = []
for i in range(num):
    wlist.append(input())
for n in range(num - 1):
    kumi = [(x, x+1) for x in range(num - 1 - n)]
    if kumi:
        for x, y in kumi:
            if hikaku(wlist[x], wlist[y]):
                wlist[x], wlist[y] = wlist[y], wlist[x]
dst = ""
for w in wlist:
    dst += w
print(dst)

Buggy submission (verdict: Runtime Error):
def hikaku(n1, n2):
    for x, y in zip(n1, n2):
        if ord(x) == ord(y):
            continue
        else:
            if ord(x) < ord(y):
                return False
    return True
num, length = map(int, input().split())
wlist = []
for i in range(num):
    wlist.append(input())
kumi = [(x, y) for x in range(num) for y in range(x, num) if x != y]
for x, y in kumi:
    if hikaku(wlist[x], wlist[y]):
        wlist[x], wlist[y] = wlist[y], wlist[x]
print(wlist[0] + wlist[1] + wlist[2])
Problem p03211 (python)

Fixed submission:

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 10000000000000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    tempmin = abs(comp_num - temp)
    
    if tempmin <= min:
      min = tempmin
  print(min)

Buggy submission (verdict: Runtime Error):
import math
if __name__ == '__main__':
  
  S = input()
  index = range(0, len(S)-2)
  comp_num = 753
  min = 0
  tempmin = math.inf
  for i in index:
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if (min >= tempmin):
      break
    tempmin = min


  print(min)
Problem p04045 (python)

Fixed submission:

def main():
    N, K = input().split(" ")

    D = list(input().split(" "))
    use_num = list(set([str(i) for i in range(10)]) - set(D))

    N = int(N)
    i = N
    while True:

        if not set(str(i)) <= set(use_num) and i >= N:
            i += 1
        else:
            print(i)
            break

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    N,K = input().split()
    D = input().split()
    num = set([str(i) for i in range(10)])
    
    diff = num^set(D)
    print(diff)
    ans = N
    while True:
        strN = set(list(ans))
        if strN - diff:
            ans += 1
        else:
            break
    print(ans)

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    N, K = input().split(" ")
    D = input().split()
    num = set([str(i) for i in range(10)])
    diff = num ^ set(D)

    temp = N
    while True:
        setN = set(list(N))
        if setN - diff:
            temp += 1
        else:
            break
    print(temp)

Buggy submission (verdict: Runtime Error):
import os

if __name__ == "__main__":
    temp = input().split(" ")
    N = temp[0]
    L = int(temp[1])
    D = list(map(int, input().split(" ")))
    
    like = []
    for i in range(0, 10):
        if D.count(i) == 0:
            like.append(i)
   
    ans = []
    for n in N:
        for l in like:
            if int(l) >= int(n):
                ans.append(l)
                break
    if int("".join(map(str, ans))) < int("".join(map(str, N))):
        ans = []
        for i in range(0, len(N)):
            ans.append(min(like))
            
    print("".join(map(str, ans)))
Problem p03149 (python)

Fixed submission:
if set(input().split())==set("1974"):
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
        if set(input().split())==set("1974"):
          print("Yes")
        else:
          print("No")

Buggy submission (verdict: Runtime Error):
    if set(input().split())==set([1,9,7,4]):
      print("Yes")
    else:
      print("No")

Buggy submission (verdict: Runtime Error):
if set(input().split())==aet([1,9,7,4]):
  print("Yes")
else:
  print("No")
Problem p03149 (python)

Fixed submission:
a=[int(i) for i in input().split(" ")]
kouho=set([1,9,7,4])
for k in a:
    if k in kouho:
        kouho.remove(k)
if kouho==set([]):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a=[int(i) for i in input().split(" ")]
kouho=[1,9,7,4]
for k in a:
	if k in kouho:
        kouho.pop(k)
if kouho==[]:
    print("YES")
else:
    print("NO")
Problem p03149 (python)

Fixed submission:
a = [False,False,False,False]
for x in input().split():
  x = int(x)
  if(x == 1):
    a[0] = True
  elif(x == 9):
    a[1] = True
  elif(x == 4):
    a[2] = True
  elif(x == 7):
    a[3] = True
 
all = True
for x in a:
  all &= x
 
print('YES' if all else 'NO')

Buggy submission (verdict: Runtime Error):
a = [False,False,False,False]
for x in input().split():
  if(x == 1):
    a[0] =True
  else if(x == 9):
    a[1] = True
  else if(x == 4):
    a[2] = True
  else if(x == 7):
    a[3] = True

all = True
for x in a:
  all &= x

print('YES' if all else 'NO')
Problem p03150 (python)

Fixed submission:
word = 'keyence'
l = input()
i = l.find(word)
if i == 0 or i == (len(l)-len(word)) :
  print('YES')
  exit()

for i in range(1,len(word)):
  a = word[:i]
  b = word[i:]
  #print(l[:len(a)], l[-len(b):])
  if l[:len(a)] == a and l[-len(b):] == b:
    print('YES')
    exit()
print('NO')

Buggy submission (verdict: Runtime Error):
word = 'keyence'
l = input()
now = 0
start = False
for w in l:
  if word[now] == w:
    now += 1
  else:
    if start:
      return
    else:
      start = True
  if now == len(word):
    print('YES')
    exit()
print('NO')

Buggy submission (verdict: Runtime Error):
word = 'keyence'
l = input()
now = 0
for w in l:
  if word[now] == w:
    now ++
  if now == len(word):
    print('YES')
    exit()
print('NO')
Problem p03149 (python)

Fixed submission:
l1  = input().split(" ")
ar = []
for i in l1:
  ar.append(int(i))
d = {1:0,9:0,7:0,4:0}
for i in ar:
  for j in d:
    if  i == j:
      d[j] = 1
con = True
for  i in d:
  if d[i] == 0:
    con = False
    print("NO")
    break
if con:
  print("YES")

Buggy submission (verdict: Runtime Error):
N = int(input())
A =  []
l1 = input().split()
for i in l1:
    A.append(int(i))
B = []
l2 = input().split()
for i in l2:
    B.append(int(i))
if sum(A) < sum(B):
    print(-1)
else:
    z = 0
    ar1 = []
    ar2 = []
    for i in range(N):
        if A[i] < B[i] :
            ar1.append(B[i] - A[i])
        if A[i] > B[i]:
            ar2.append(A[i] - B[i])
    if len(ar1) == 0:
        print(0)
    else:
        s = sum(ar1)
        ar2.sort(reverse = True)
        temp = 0
        b = 0
        for  i in range(len(ar2)):
            temp += ar2[i]
            if temp >= s:
                b = i+1
                break
        print(len(ar1)+b)

Buggy submission (verdict: Runtime Error):
N = int(input())
A =  []
l1 = input().split()
for i in l1:
    A.append(int(i))
B = []
l2 = input().split()
for i in l2:
    B.append(int(i))
if sum(A) < sum(B):
    print(-1)
else:
    z = 0
    ar1 = []
    ar2 = []
    for i in range(N):
        if A[i] < B[i] :
            ar1.append(B[i] - A[i])
        if A[i] > B[i]:
            ar2.append(A[i] - B[i])
    if len(ar1) == 0:
        print(0)
    else:
        ar2.sort(reverse = True)
        temp = 0
        b = 0
        for  i in range(len(ar2)):
            temp += ar2[i]
            if temp >= sum(ar1):
                b = i+1
                break
        print(len(ar1)+b)

Buggy submission (verdict: Runtime Error):
N = int(input())
A =  []
l1 = input().split()
for i in l1:
    A.append(int(i))
B = []
l2 = input().split()
for i in l2:
    B.append(int(i))
if sum(A) < sum(B):
    print(-1)
else:
    z = 0
    ar1 = []
    ar2 = []
    for i in range(N):
        if A[i] < B[i] :
            ar1.append(B[i] - A[i])
        if A[i] > B[i]:
            ar2.append(A[i] - B[i])
    ar1.sort(reverse = True)
    ar2.sort(reverse = True)
    b = 0
    for a in ar1:
        while a > ar2[b]:
            ar2[b] = 0
            a -= ar2[b]
            b += 1
        ar2[b] -= a
        ar2.sort(reverse = True)
        if a == ar1[-1] and ar2[b] != 0:
            z = 1
    ans = 0
    for i in ar2:
        if i == 0:
            z +=1
    ans = len(ar1) + z
    print(ans)
Problem p03151 (python)

Fixed submission:
N = int(input())
A =  []
l1 = input().split()
for i in l1:
    A.append(int(i))
B = []
l2 = input().split()
for i in l2:
    B.append(int(i))
if sum(A) < sum(B):
    print(-1)
else:
    z = 0
    ar1 = []
    ar2 = []
    for i in range(N):
        if A[i] < B[i] :
            ar1.append(B[i] - A[i])
        if A[i] > B[i]:
            ar2.append(A[i] - B[i])
    if len(ar1) == 0:
        print(0)
    else:
        s = sum(ar1)
        ar2.sort(reverse = True)
        temp = 0
        b = 0
        for  i in range(len(ar2)):
            temp += ar2[i]
            if temp >= s:
                b = i+1
                break
        print(len(ar1)+b)

Buggy submission (verdict: Runtime Error):
N = int(input())
A =  []
#l1 = input().split()
#for i in l1:
#    A.append(int(i))
B = []
#l2 = input().split()
#for i in l2:
#    B.append(int(i))
for n in N:
    A.append(int(input()))
for n in N:
    B.append(int(input()))
if sum(A) < sum(B):
    print(-1)
else:
    z = 0
    ar1 = []
    ar2 = []
    for i in range(N):
        if A[i] < B[i] :
            ar1.append(B[i] - A[i])
        if A[i] > B[i]:
            ar2.append(A[i] - B[i])
    ar1.sort(reverse = True)
    ar2.sort(reverse = True)
    b = 0
    for a in ar1:
        while a > ar2[b]:
            ar2[b] = 0
            a -= ar2[b]
            b += 1
        ar2[b] -= a
        ar2.sort(reverse = True)
        if a == ar1[-1] and ar2[b] != 0:
            z = 1
    ans = 0
    for i in ar2:
        if i == 0:
            z +=1
    ans = len(ar1) + z
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A =  []
#l1 = input().split()
#for i in l1:
#    A.append(int(i))
B = []
#l2 = input().split()
#for i in l2:
#    B.append(int(i))
for n in N:
    A.append(int(input()))
for n in N:
    B.append(int(input()))
if sum(A) < sum(B):
    print(-1)
else:
    z = 0
    ar1 = []
    ar2 = []
    for i in range(N):
        if A[i] < B[i] :
            ar1.append(B[i] - A[i])
        if A[i] > B[i]:
            ar2.append(A[i] - B[i])
    ar1.sort(reverse = True)
    ar2.sort(reverse = True)
    b = 0
    for a in ar1:
        while a > ar2[b]:
            ar2[b] = 0
            a -= ar2[b]
            b += 1
        ar2[b] -= a
        ar2.sort(reverse = True)
        if a == ar1[-1] and ar2[b] != 0:
            z = 1
    ans = 0
    for i in ar2:
        if i == 0:
            z +=1
    ans = len(ar1) + z
    print(ans)
Problem p03149 (python)

Fixed submission:
import math
a = 0
b = 0
c = 0
d = 0
input_str = input().split()
input_str_list = []

## 少数を省く
for x in input_str:
    try:
       input_str_list.append(int(x))
    except:
      print("NO")
      exit()

for i in range(len(input_str_list)):
  if input_str_list[i] == 1:
    a+=1
  elif input_str_list[i] == 9:
    b+=1
  elif input_str_list[i] == 7:
    c+=1
  elif input_str_list[i] == 4:
    d+=1
if a==1 and b==1 and c==1 and d==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
import math
a = 0
input_str = input()
input_str_list = []
for x in input_str:
    try:
       input_str_list.append(int(x))
    except:
       pass
if len(input_str_list) == 4:
  pass
else:
  print("NO")
  exit()

if math.modf(float(input_str))[0] == 0.0:
  pass
else:
  print("NO")
  exit()
  

for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
if a==4:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
import math 

a = 0
input_flo = float(input())
if math.modf(input_flo)[0] == 0.0:
  if len(str(int(input_flo))) == 4:
    input_str=str(int(input_flo))    
  else:
    print("NO")
    exit()
else:
  print("NO")
  exit()

for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
    
if a==4:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a = 0
input_str = input()
if int(input_str)//10000 >=1:
  print("NO")
  exit()
for i in range(len(input_str)):
  if input_str[i] == '1':
    a+=1
  elif input_str[i] == '9':
    a+=1
  elif input_str[i] == '7':
    a+=1
  elif input_str[i] == '4':
    a+=1
if a==4:
  print("YES")
else:
  print("NO")
Problem p03150 (python)

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

for i in range(n): #文字列の長さ分繰り返す
    for j in range(i,n): #
        tmp = s[:i]+s[j:]
        if tmp == "keyence":
            print("YES")
            quit()

print("NO")

Buggy submission (verdict: Runtime Error):

S = list(input())

str = ["k","e","y","e","n","c","e"]
false = 0
split = 0

for i in S :
    if i==str[0]:
        str.pop(0)
        if false > 0 :
            split += 1
            false = 0
    else:
        false += 1

if len(str)==0:
    if split <=1 :
        print("YES") 
    else :
        print("NO")
else :
    print("NO")
Problem p03210 (python)

Fixed submission:

inp = input()

if inp == "3" or inp == "5" or inp == "7" :
    print("YES")
else:
    print("NO")

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

if(input>9):
    print("error")
elif(input == 3 or input == 5 or input == 7):
    print("YES")
else:
    print("NO")
Problem p03210 (python)

Fixed submission:
a=int(input())
if a==3 or a==5 or a==7:
    print("YES")
else:
    print("NO ")

Buggy submission (verdict: Runtime Error):
a=int(input())
if a=3 or a=5 or a=7:
    print("YES")
else:
    print("NO ")
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):
if int(input())==1:
    print("Hello World!")
else:
    a,b = map(int, input().split())
    print(a+b)
Problem p03284 (python)

Fixed submission:
n, k = map(int, input().split())
if n%k==0:
    print("0")
else:
    print("1")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    if (n-i)%4==0 and i%7==0:
        print("Yes")
        exit()
    else:
        print("No")
Problem p03296 (python)

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

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

Buggy submission (verdict: Runtime Error):
t = int(input())
a, b, c, d = map(int, input().split())
for i in range(t):
    if a>=b and c >=b and d>=b:
        print("Yes")
    else:
        print("No")

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

for i in range (n-1):
    count = 0
    if a[i] == a[i+1]:
        count += 1
        for j in range(n):
            count += 1
            a[i+1] = j
    ans = min(count, ans)
print(ans)
Problem p03328 (python)

Fixed submission:
a,b=map(int, input().split())
print(int((b-a)*(b-a+1)/2-b))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(sum([1:b])-(b-a))
Problem p03331 (python)

Fixed submission:
from numpy import inf
n=int(input())
ans=inf
for i in range(n-1):
    ans=min(ans,sum(list(map(int, list(str(n-i-1)))))+sum(list(map(int, list(str(i+1))))))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=inf
for i in range(n):
    ans=min(ans,sum(list(n-i))+sum(list(i)))
print(ans)
Problem p03378 (python)

Fixed submission:
from numpy import inf
n, m, x =map(int, input().split())
a = list(map(int, input().split()))
ans=inf
if x<a[0] or a[m-1]<x:
    print(0)
    exit()
for i in range(m-1):
    if a[i]<x<a[i+1]:
        ans=min(ans,min(i+1,m-i-1))
print(ans)

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

for i in range(m):
    if a[i+1]<x<a[i+2]:
        ans=min(ans,min(i+1,m-i-1))
print(ans)
Problem p03448 (python)

Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == i*500 + j*100 + k*50:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
x = input()
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == i*500 + j*100 + k*50:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, x = map(int, input().split())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == i*500 + j*100 + k*50:
                ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, x = map(int, input().split())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == i*500 + j*100 + k*50:
                ans +=1
print(ans)
Problem p03455 (python)

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

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

Fixed submission:
n = int(input())
ti=0
xi=0
yi=0
for i in range(n):
    t, x, y = map(int, input().split())
    if abs(x-xi) + abs(y-yi) > abs(t-ti) or (abs(x-xi) + abs(y-yi) + abs(t-ti)) % 2 != 0:
        print("No")
        exit()
    ti=t
    xi=x
    yi=y
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (x+y-t)%2 /= 0:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (x+y-t)%2 /= 0
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (x+y-t)%2 /= 0
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y <= t or (x+y-t)%2 /= 0
        print("No")
        exit()
print("Yes")