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

Fixed submission:
s = input()
t = input()
ans = []
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        if t[j] != s[i+j]:
            cnt += 1
    ans.append(cnt)
    
cnt2 = min(ans)
print(cnt2)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans = []
for i in range(len(s)-len(t)):
    cnt = 0
    for j in range(len(t)):
        if t[j] != s[i+j]:
            cnt += 1
    ans.append(cnt)
    
cnt2 = min(ans)
print(cnt2)
Problem p02572 (python)

Fixed submission:
MOD = 10 ** 9 + 7  # MODは変数に入れてしまったほうが打ち間違えなくていいです

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

S = sum(A) % MOD
ans = 0

# A_Nも含まれてしまいますが、そのときはs=0なので問題ありません
for x in A:
    S -= x  # 自分と自分自身を掛けないように、先に引く必要があります
    S %= MOD  # MODはいちいち取っておくといいです
    ans += S * x
    ans %= MOD

ans %= MOD  # この行は完全に不要ですが、最後だけMODを取り忘れてWAになるミスは非常によくあるので、必要以上に取っておくと安心できます
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
SUMA = 0
MOD = 10**9 + 7
C = [0] * (N-1) 
for i in range(N): 
    SUMA += A[i]
    C[i] = SUMA
ans = 0
for i in range(N-1):
    ans += A[i]*C[i]
    ans %= MOD 
print(ans)

Buggy submission (verdict: Runtime Error):
mod =10**9 +7
n = int(input())
a = list(map(int, input().split()))
sumpro = 0

for i in range(n-1):
    x = 0
    for j in range(i+1, n):
        x += a[j]
    x = x%mod
    y = a[i]* x
        sumpro += y

print(sumpro%mod)
Problem p02622 (python)

Fixed submission:
S = list(input())
T = list(input())

length = int(len(S))
difference = 0

for i in range(length):
    if S[i] != T[i]:
        difference = difference + 1

   
print(str(difference))

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())

length = int(len(S))
difference = 0

for i in range(length):
    if S[i] != T[i]:
        difference = difference + 1

if difference%2 == 0:
    change = difference/2
if differenc%2 != 0:
    change = (difference+1)/2
    
print(str(change))
Problem p02707 (python)

Fixed submission:
n = int(input())
k =[0]*n
a = list(map(int, input().split()))

for i in range(n-1):
    k[a[i]-1] += 1

for i in range(len(k)):
    print(k[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
k =[]*n
a = list(map(int, input().split()))

for i in range(n-1):
    k[a[i-1]] += 1

for i in range(k):
    print(k[i])
Problem p02623 (python)

Fixed submission:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
# Aの累積和
a_sum = [0]
for i in range(n):
    a_sum.append(a_sum[i] + a[i])
# Bの累積和
b_sum = [0]
for i in range(m):
    b_sum.append(b_sum[i] + b[i])
b_sum.append(10**20)
ans = 0
# Aを固定する
for i in range(n+1):
    t = a_sum[i]
    l = 0
    r = len(b_sum)
    # Bのうち何冊目まで読めるか二分探索する
    while l+1<r:
        # c:探索範囲の中央
        c = (l + r) // 2
        # 中央がK以下の場合は、求めたい位置が右にあるので
        # 探索範囲の左端を中央にする
        if t+b_sum[c]<=k:
            l = c
        # 中央がKよりも大きい場合は、求めたい位置が左にあるので
        # 探索範囲の右端を中央にする
        else:
            r = c
    # 合計がKを超えないか確認する
    if a_sum[i]+b_sum[l]<=k:
        ans = max(ans,i+l)
print(ans)

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

#define rep(i,n) for(int i=0; i<(n); ++i)
#define pai 3.1415926535897932384

using namespace std;
using ll =long long;
using P = pair<int,int>;

#define MAX_N 200001
#define MAX_M 200001

int N, M;
int K = 0;
int res = 0;

int A[MAX_N];
int B[MAX_M];


int main(int argc, const char * argv[]) {

    cin >> N >> M >> K;
    
    rep(i, N){
        int a;
        cin >> a;
        if(i==0) A[i] = a;
        else A[i] = A[i-1] + a;
    }
    
    rep(i, M){
        int b;
        cin >> b;
        if(i==0) B[i] = b;
        else B[i] = B[i-1] + b;
    }
    
    int a=0;
    for(int i=0; i<N; i++){
        if(A[i]>K) continue;
        
        a=i+1;
    }
    int b=M;
    for(int j=M-1; j>=0; j--){
        if(B[j] <= K-A[a]){
            res = max(res, a+b);
            break;
        }
        b--;
    }
    
    cout << res << endl;
    
    return 0;
}

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

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
while b[j] > K - a[i]:
    j -= 1
    ans = max(ans, i + j)
print(ans)
Problem p02659 (python)

Fixed submission:
from math import floor
from decimal import Decimal

A, B = list(input().split())

ans = int(A) * Decimal(B)

print(floor(ans))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

A, B = list(map(float, input().split()))

ans = Decimal(A) * Decimal(B)

print(floor(ans))
Problem p02723 (python)

Fixed submission:
from math import floor
from decimal import Decimal

S = input()

if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from math import floor
from decimal import Decimal

S = int(input())

if S[2] == S[3] and S[4] === S[5]:
    print("Yes")
else:
    print("No")
Problem p02771 (python)

Fixed submission:
A = [0] * 10

B = list(map(int, input().split()))
for i in range(len(B)):
    A[B[i]] += 1

for i in range(len(A)):
    if A[i] == 2:
        print('Yes')
        break
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A = [0] * 10

B = list(map(int, input().split()))
for i in range(len(B)):
    A[B[i]] += 1

for i in range(len(A)):
    if A[i] == 2:
        print('Yes')
        break
else 
    print('No')
Problem p02773 (python)

Fixed submission:
N = int(input())
A = {}

MAX = 0
for i in range(N):
    s = input()
    A[s] = A.get(s,0) + 1
    MAX = max(MAX, A[s])

B = sorted(A.items())
for k, v in B:
    if v == MAX:
        print(k)

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

MAX = 0
for i in range(N):
    s = input()
    A[s] = A.get(s,0) + 1
    MAX = max(MAX, A[s])

A = sorted(A.items())
for k,v in A.items():
  if MAX == v:
    print(k)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = str(input())
 
if N % 2 == 0:
  NN = int(N/2)
  for i in range(0, NN):
    if S[i] != S[i+NN]:
      print('No')
      break
  else:
    print('Yes')
    
else:
  print('No')

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

if N % 2 == 0:
  NN = N/2
  for i in range(0, NN):
    if S[i] != S[i+NN]:
      print('No')
  else:
    print('Yes')
    
else:
  print('No')
Problem p02622 (python)

Fixed submission:
a = list(input())
b = list(input())
n = 0
for c, d in zip(a, b):
  if c != d:
    n += 1
print(n)

Buggy submission (verdict: Runtime Error):
a = list(input())
b = list(input())
n = 0
for c, d in zip(a, b):
  if c != d:
    count += 1
Problem p02682 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if d <= a:
  print(d)
elif d <= a + b:
  print(a)
else:
  print(a-(d-(a+b)))

Buggy submission (verdict: Runtime Error):
text_list = input().split()
n = 0
a = int(text_list[0])
b = int(text_list[0]) + int(text_list[1])
c = int(text_list[0]) + int(text_list[1]) + int(text_list[2])
for i in range(int(text_list[3])):
    if i a:
        n += 1
    elif i b:
        continue
    elif i c:
        n -= 1

print(n)

Buggy submission (verdict: Runtime Error):
text_list = input().split()
n = 0
for i in range(str(text_list[3])):
  if i >= int(text_list[0]):
    n += 1
  elif i >= int(text_list[0]) + int(text_list[1]):
    pass
  elif i >= int(test_list[0]) + int(text_list[1]) + int(text_list[2]):
    n -= 1
    
print(n)
Problem p02831 (python)

Fixed submission:
import math
import fractions
a, b = map(int, input().split())
print(math.floor((a*b) / fractions.gcd(a, b)))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(math.floor((a*b) / math.gcd(a, b)))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())

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

print(lcm(a, b))
Problem p02578 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N-1):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N)
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N)
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
    else:
        count=count
print (count)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
sum(A)
count=0
for num in range(N)
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
    else:
        count=count
print (count)
Problem p02859 (python)

Fixed submission:

x = int(input())
print(x * x)

Buggy submission (verdict: Runtime Error):
input = input()
print(input * input)
Problem p02597 (python)

Fixed submission:
n = int(input())
c = input()
lists = list(c)
cnt = 0

for i in range(len(lists)):
    if lists[i] == "R":
        cnt += 1
change = 0
for i in range(cnt):
    if lists[i] == "W":
        change += 1
print(change)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = input()
lists = list(c)
cnt = 0
while 1:
    if lists[cnt] == "W":
        cnt += 1
    else:
        break
number = 0
for i in range(len(lists) - cnt):
    if lists[i + cnt] == "W":
        number += 1
print(number)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = input()
lists = list(c)
cnt = 0
while 1:
    if lists[cnt] == "W":
        cnt += 1
    else:
        break
number = 0
for i in range(len(lists) - cnt):
    if lists[i + cnt] == "W":
        number += 1
print(number)
Problem p02623 (python)

Fixed submission:
from itertools import accumulate
from bisect import bisect_right

n, m, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

##累積和のリストが得られる
a_cum = [0] + list(accumulate(a))
b_cum = [0] + list(accumulate(b))

ans = [0]
for i in range(n + 1):    #0~n+1
    c = bisect_right(b_cum, k-a_cum[i]) - 1 ##Aをi冊読んだ場合の残り時間 : k-a[i]  bisect_rightでbの累積時間の最大のインデックス(本の冊数)が求まる
                                 ##bisectは位置が求まるので、-1で冊数を求めている
    if c != -1: #0から始まるので、冊数が0の場合は-1となってしまう
        ans.append(c+i)

print(max(ans))

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
from bisect import bisect_right

n, m, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

##累積和のリストが得られる
a_cum = list(accumulate(a))
b_cum = list(accumulate(b))

ans = [0]
for i in range(n+1):    
    c = bisect_right(b, k-a[i]) - 1 
    if c != -1: 
        ans.append(c+i)
print(max(ans))

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
from bisect import bisect_right

n, m, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

##累積和のリストが得られる
a_cum = list(accumulate(a))
b_cum = list(accumulate(b))

ans=[0]
for i in range(n+1):    #0~n+1
    c = bisect_right(b,k-a[i])-1 ##Aをi冊読んだ場合の残り時間 : k-a[i]  bisect_rightでbの累積時間の最大のインデックス(本の冊数)が求まる
                                 ##bisectは位置が求まるので、-1で冊数を求めている
    if c!=-1: #0から始まるので、冊数が0の場合は-1となってしまう
        ans.append(c+i)
print(max(ans))
Problem p02571 (python)

Fixed submission:
S = input()
T = input()

score = []
for i in range(len(S)-len(T)+1):
    U = S[i: i+len(T)]
    cnt = 0
    for j in range(len(T)):
        if U[j] != T[j]:
            cnt = cnt + 1
    score.append(cnt)
print(min(score))

Buggy submission (verdict: Runtime Error):
s = input().split()
S = s[0]
T = s[1]

score = []
for i in range(len(S)-len(T)):
    U = s[i: i+len(T)]
    cnt = 0
    for j in range(T):
        if U[j] != T[j]:
            cnt = cnt + 1
        score.append(cnt)
print(min(score))
Problem p02701 (python)

Fixed submission:
from collections import Counter
N = int(input())
s = [input() for i in range(N)]
c = Counter(s)
print(len(c))

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
s = [input() for i in range(N)]
c = collections.Counter(s)
print(len(c))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)] #複数行の数値の入力を取得
c = collections.Counter(s)
print(len(c))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)] #複数行の数値の入力を取得
c = collections.Counter(s)
print(c)
Problem p02699 (python)

Fixed submission:
S,W = map(int,input().split())
print('safe' if S > W else 'unsafe')

Buggy submission (verdict: Runtime Error):
S,W = map(int,input())
print('safe' if S > W else 'unsafe')
Problem p02729 (python)

Fixed submission:
import math
N,M = map(int,input().split())
ans = N*(N-1)/2 + M*(M-1)/2
print( int(ans) )

Buggy submission (verdict: Runtime Error):
import math
N,M = map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N == 0:
  ans = combinations_count(M, 2)
elif M == 0:
  ans = combinations_count(N, 2)
elif N == 0 and M == 0:
  ans = 0
else:
  ans = combinations_count(N, 2) +  combinations_count(M, 2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
N,M = map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N == 0:
  ans = combinations_count(M, 2)
elif M == 0:
  ans = combinations_count(N, 2)
else:
  ans = combinations_count(N, 2) +  combinations_count(M, 2)
print(ans)
Problem p02759 (python)

Fixed submission:
N = int(input())
amari = N % 2
count = int( N // 2 )
print( count + amari )

Buggy submission (verdict: Runtime Error):
N = int(input())
amari = N % 2
count = int( N // 2 )
print( count + arari )
Problem p02711 (python)

Fixed submission:
n=input()
n=list(n)
flag=0
for i in n:
    if i=='7':
        flag=1
if flag==1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=input()
flag=0
for i in n:
    if i=='7':
        flag=1
if flag==1:
    print('Yes')
else
    print('No')
Problem p02547 (python)

Fixed submission:
N = int(input())
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]
flag = 0
count = 0

for i in range(N):
  if x[i] == y[i]:
    count += 1
    if count >= 3:
      flag = 1
  else:
    count = 0

if flag == 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
xy = [map(int, input().split()) for _ in range(5)]
x, y = [list(i) for i in zip(*xy)]
flag = 0
count = 0

for i in range(N-1):
  if x[i] == y[i]:
    count += 1
    if count >= 3:
      flag = 1
  else:
    count = 0
  

if flag == 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
xy = [map(int, input().split()) for _ in range(5)]
x, y = [list(i) for i in zip(*xy)]
flag = 0

for i in range(N-3):
  if x[i] == y[i]:
    if x[i+1] == y[i+1]:
      if x[i+2] == y[i+2]:
        flag = 1

if flag == 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
xy = [map(int, input().split()) for _ in range(5)]
x, y = [list(i) for i in zip(*xy)]
flag = 0
for i in range(N-2):
  if x[i] == y[i]:
    if x[i+1] == y[i+1]:
      if x[i+2] == y[i+2]:
        flag = 1

if flag == 1:
  print('Yes')
else:
  print('No')
Problem p02627 (python)

Fixed submission:
i = input()
 
if i == i.upper():
  print("A")
else:
  print("a")

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

if i = i.upper():
  print("A")
else:
  print("a")
Problem p02699 (python)

Fixed submission:
list = list(map(int, input().split()))
S = list[0]
W = list[1]
if W >= S: print("unsafe")
else: print("safe")

Buggy submission (verdict: Runtime Error):
S = input()
L = len(S)
N = 0

for i in range(L - 3):
    for j in range(4,L - i+1):
        P = int(S[i:i + j])
        if P % 3 == 0:
            if P % 2019 == 0: N += 1

print(N)

Buggy submission (verdict: Runtime Error):
list = map(int, input().split())
S = list[0]
W = list[1]
if W >= S: print("unsafe")
else: print("safe")

Buggy submission (verdict: Runtime Error):
list = map(int, input().split())
S = list[0]
W = list[1]
if W => S: print("unsafe")
else: print("safe")

Buggy submission (verdict: Runtime Error):
list = map(int, input().split())
S = list[0]
W = list[1]
if W >= S: print("unsafe")
else: print("safe")
Problem p02753 (python)

Fixed submission:
S=list(input())

if len(set(S))==1:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1

a=[]
b=[]
c=[]
"""
if int(Amin)==Amin:
    p=Amin
else:
    p=int(Amin)+1

if int(Bmin)==Bmin:
    q=Bmin
else:
    q=int(Bmin)+1
"""
p=int(Amin+1)
q=int(Bmin+1)
while p<=Amax:
    a.append(p)
    p+=1
while q<=Bmax:
    b.append(q)
    q+=1
for i in range(len(a)):
    if a[i] in b:
        c.append(a[i])
for i in range(len(b)):
    if b[i] in a:
        c.append(b[i])
if len(c)==0:
  print(-1)
else:
  print(min(c))
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
if a!=1 and b!=1:
    print(1)
elif a!=2 and b!=2:
    print(2)
elif a!=3 and b!=3:
    print(3)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a!=1 and b!=1:
    print(1)
elif a!=2 and b!=1:
    print(2)
else a!=3 and b!=3:
    print(3)
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int,input().split())
c=a*b/fractions.gcd(a,b)
print(int(c))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
c=a*b/gcd(a,b)
print(c)
Problem p03013 (python)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7
ans=1

dp=[0]*(n+1)
dp[0]=1
dp[1]=1
for i in range(2,n+1):
    dp[i]=dp[i-1]+dp[i-2]
    dp[i]%=mod
if m==0:
    ans=dp[n]
else:
    begin=0
    end=a[0]-1
    for i in range(m):
        end=a[i]-1
        ans*=dp[end-begin]
        
        if(i+1<m and a[i+1]==a[i]+1):
            ans=0
            break
            
        else:
            begin=end+2

    ans*=dp[n-a[m-1]-1]

print(ans%mod)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7
ans=1

dp=[0]*(n+1)
dp[0]=1
dp[1]=1
for i in range(2,n+1):
    dp[i]=dp[i-1]+dp[i-2]
    dp[i]%=mod

begin=0
end=a[0]-1
for i in range(m):
    end=a[i]-1
    ans*=dp[end-begin]
    
    if(i+1<m and a[i+1]==a[i]+1):
        ans=0
        break
        
    else:
        begin=end+2

ans*=dp[n-a[m-1]-1]

print(ans%mod)
Problem p03018 (python)

Fixed submission:
def give(list):
    i=0
    count=0
    count1=0
    while i<len(list)-2:
        if list[i]=='A':
            count1+=1
            if list[i]=='A' and list[i+1]=='B' and list[i+2]=='C':
                list[i+2]='A'
                
                i+=2
                count+=count1
                count1-=1
                
            else:
                i+=1
        else:
            count1=0
            i+=1
    return count
s=list(input())
print(give(s))

Buggy submission (verdict: Runtime Error):
def check(list,a,b,c,d):
    if c==d:
        return False
    i=a
    counter1=0
    while i<b:
        if list[i]=='#':
            counter1+=1
        else:
            counter1=0
        if counter1>=2:
            return False
        i+=1
    counter1=0
    check2,counter2=0,0
    i+=1
    while i<min(c,d):
        if list[i]=='#':
            counter1+=1
            counter2=0
        else:
            counter2+=1
            counter1=0
        if counter1>=2:
            return False
        if counter2>=3:
            check2+=1
        i+=1
    i+=1
    counter1=0
    while i<max(c,d):
        if list[i]=='#':
            counter1+=1
        else:
            counter1=0
        if counter1>=2:
            return False
        i+=1
    if d>c:
        return True
    else:
        if check2>=1:
            return True
        else:
            return False
m=list(map(int,input().strip().split()))
l=list(input())
if check(l,m[1],m[2],m[3],m[4]):
    print('Yes')
else:
    print('No')
Problem p02879 (python)

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

if a>=10 or b>=10:
  print("-1")
else:
  print(a*b)

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

for i in range(1,10):
  for s in range(1,10):
    if i*s==n:
      print("Yes")
      exit()
print("No")
Problem p03208 (python)

Fixed submission:
N,K = map(int,input().split())
tree = sorted([int(input())for i in range(N)])
d = 10**18  


for i in range(N-K+1):
  d = min(d,tree[i+K-1]-tree[i])
print(d)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
tree = sorted([int(input())for i in range(N)])
d = 10**18  

for i in range(N-K+1):
  d = min(d,tree[i+2]-tree[i])
if d>0:
  print(d)
else:
  print(d)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
tree = sorted([int(input())for i in range(N)])
d = 10**18  

for i in range(N-K+1):
  d = min(d,tree[i+2]-tree[i])
print(d)
Problem p02547 (python)

Fixed submission:
n = int(input())
t = []
i = 0
for _ in range(n):
    x, y = map(int, input().split())
    if x == y:
        i += 1
    else:
        i = 0
    t.append(i)
if(len(list(filter(lambda x: x >= 3, t))) == 0):
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
t = []
i = 0
for _ in range(n):
    x, y = map(int, input().split())
    if x == y:
        i += 1
    else:
        i = 0
    t.append(i)
if(len(filter(lambda x: x >= 3, t)) == 0):
    print("No")
else:
    print("Yes")
Problem p03315 (python)

Fixed submission:
S=[1 if x=="+" else -1 for x in input()]

print(sum(S))

Buggy submission (verdict: Runtime Error):
print(sum([1 if x=="+" else 01 for x in input()]))
Problem p03041 (python)

Fixed submission:
N,K = map(int,input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = []
S[K-1] = S[K-1].lower()
print(S)
Problem p02546 (python)

Fixed submission:
n=input()
if n[-1]!='s':
	print(n+'s')
elif n[-1]=='s':
	print(n+'es')

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

if n[-1]!='s':

	print(n+'s')elif n[-1]=='s':

	print(n+'es')
Problem p02547 (python)

Fixed submission:
n=int(input())
count=0
counts=[]
z=[]
for i in range(n):
	x,y=list(map(int,input().split()))
	z.append([x,y])
z.append([-14,-20])
for i in z:
	if i[0]==i[1]:
		count+=1
	else:
		counts.append(count)
		count=0
if max(counts)>=3:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
count=0
counts=[]
for i in range(n):
	i,j=list(map(int,input().split()))
	if i==j:
		count+=1
	else:
		counts.append(count)
		count=0
if max(counts)>=3:
	print('Yes')
else:
	print('No')
Problem p02570 (python)

Fixed submission:
d, t, s=list(map(int,input().split()))
x=s*t
if x>=d:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
d, t, s=list(map(int,input().split()))

x=s*t

if x>=d:

	print('Yes')else:

	print('No')
Problem p02547 (python)

Fixed submission:
n = int(input())
total = 0

for i in range(n):
  a,b = map(int, input().split())
  if a == b:
    total += 1
    if total == 3:
      break
  else:
    total = 0
if total == 3:
  print('Yes')
else:
  print('No')

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

for i in range(n):
  a,b = map(int,split().input())
  if a == b:
    total += 1
    if total == 3:
      break
  else:
    total = 0
if total == 3:
  print('Yes')
else:
  print('No')