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

Fixed submission:
import fractions
from functools import reduce
n=int(input())
l=list(map(int,input().split()))
print(reduce(fractions.gcd,l))

Buggy submission (verdict: Runtime Error):
import functools
import math
n=int(input())
a=list(map(int,input().split()))
gcd=functools.reduce(math.gcd, a)
print(gcd)

Buggy submission (verdict: Runtime Error):
import functools
import math
n=int(input())
a=list(map(int,input().split()))
gcd = functools.reduce(math.gcd, a)
print(gcd)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
set(a)
v=a[-1]
a[-1]=a[-1]%a[-2]
a.sort()
l=a[-1]
i=1
while i<=n:
    while v!=l:
        v=a[-1]
        a[-1]=a[-1]%a[-(i+1)]
        a.sort()
        l=a[-1]
    if a[-1]==0 or a[-1]==1:
        break
    i+=1
if a[-1]==0:
    print(v)
else:
    print(a[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
v=a[-1]
a[-1]=a[-1]%a[-2]
a.sort()
l=a[-1]
while v!=l:
    a.sort()
    v=a[-1]
    a[-1]=a[-1]%a[-2]
    a.sort()
    l=a[-1]
if a[-1]==0:
    print(v)
else:
    print(a[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
if a.count(a[0])==n:
    print(a[0])
else:
    a.sort()
    v=a[-1]
    a[-1]=a[-1]%a[-2]
    a.sort()
    l=a[-1]
    while v!=l:
        a.sort()
        v = a[-1]
        a[-1] = a[-1] % a[-2]
        a.sort()
        l = a[-1]
    if min(a)==0:
        print(v)
    else:
        print(min(a))
Problem p03207 (python)

Fixed submission:
N = int(input())
sm,mx = 0,0
for i in range(N):
  P = int(input())
  sm += P
  mx = max(mx, P)

a = int(sm - mx / 2)
print(a)

Buggy submission (verdict: Runtime Error):
a =int(input())
m =0
for i in range(N):
  p=int(input())
  m=max(m,p)
a=int(sum(p)-m/2)
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = []
for i in range(N):
  p.append(int(input()))
  
print(int(sum(p)-max(p)/2)

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(N):
  p =int(input())
  
print(int(sum(p)-max(p)/2)

Buggy submission (verdict: Runtime Error):
N = int(input()), sum = 0, mx = 0
for i in range(N):
  P = int(input())
  sum += P
  mx = max(mx, P)

print(sum - mx / 2)

Buggy submission (verdict: Runtime Error):
N = int(input()), sum = 0, mx = 0
for i in range(n):
  P = int(input())
  sum += P
  mx = max(mx, P)

print(sum - mx / 2)
Problem p03242 (python)

Fixed submission:
n = input()
a = ""
for i in range(len(n)):
  if n[i]=="1":
    a +="9"
  else:
    a +="1"
print(a)

Buggy submission (verdict: Runtime Error):
n = input()
if n[0]=1:
  n[0]=9
else:
  n[0]=1
if n[1]=1:
  n[1]=9
else:
  n[1]=1
if n[2]=1:
  n[2]=9
else:
  n[2]=1

print(n)
Problem p03272 (python)

Fixed submission:
n,i=map(int,input().split())
print(n+1-i)

Buggy submission (verdict: Runtime Error):
n,i=map(int,input())
print(n+1-i)
Problem p03986 (python)

Fixed submission:
x=input()
l=[x[0]]
for i in range(1,len(x)):
    if l!=[]:
        if l[-1]=="S":
            h=1
        else:
            h=0
    l.append(x[i])
    if len(l)!=1:
        if l[-1]=="T":
            if h==1:
                l.pop(-1)
                l.pop(-1)
                if l!=[]:
                    h=(0 if l[-1]=="T" else 1)
                else:
                    h=0
            else:
                h=0
        else:
            h=0
print(len(l))

Buggy submission (verdict: Runtime Error):
x=input()
ans=len(x)
r=len(x)
if "ST" in x:
    x.remove("ST")
    ans-=2
while r!=len(x):
    r=len(x)
    if "ST" in x:
        x.remove("ST")
        ans-=2
print(ans)
Problem p02557 (python)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
AC = Counter(A)
BC = Counter(B)
for i in BC.keys():
    if i in AC and BC[i] + AC[i] > N:
        print("No")
        exit()
AL,AR = {},{} 
BL,BR = {},{}
for i in range(N):
    if not A[i] in AL:
        AL[A[i]] = i
    AR[A[i]] = i

for i in range(N):
    if not B[i] in BL:
        BL[B[i]] = i
    BR[B[i]] = i
can = [1]*(N)

for i in BL.keys():
    if not i in AL:
        continue
    s = (N+AL[i]-BR[i])%N
    e = (N+AR[i]-BL[i])%N
    if e<s:
        e += N
    # print(i,s,e)
    for j in range(s,e+1):
        can[j%N] = 0

if 1 in can:
    print("Yes")
    ind = can.index(1)
    print(* (B+B)[N-ind:2*N-ind])
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
AL,AR = {},{} 
BL,BR = {},{}
for i in range(N):
    if not A[i] in AL:
        AL[A[i]] = i
    AR[A[i]] = i

for i in range(N):
    if not B[i] in BL:
        BL[B[i]] = i
    BR[B[i]] = i
can = [1]*(N)

for i in BL.keys():
    if not i in AL:
        continue
    s = (N+AL[i]-BR[i])%N
    e = (N+AR[i]-BL[i])%N
    if e<s:
        e += N
    # print(i,s,e)
    for j in range(s,e+1):
        can[j%N] = 0

if 1 in can:
    print("Yes")
    ind = can.index(1)
    print(* (B+B)[N-ind:2*N-ind])
else:
    print(1/0)
Problem p02736 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

N = int(input())
A = list(map(int,input()))
X = 2 in A

while len(A) > 1:
    if len(A) % 2 == 1:
        for i in range(len(A)-1):
            A[i] = abs(A[i]-A[i+1])
        A.pop()
    B = []
    for i in range(len(A)//2):
        B.append(abs(A[i*2]-A[i*2+1]))
    A = B[:]

if X:
    A[0] %= 2
print(A[0])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

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

while len(A) > 1:
    if len(A) % 2 == 1:
        for i in range(len(A)-1):
            A[i] = abs(A[i]-A[i+1])
        A.pop()
    B = []
    for i in range(len(A)//2):
        B.append(abs(A[i*2]-A[i*2+1]))
    A = B[:]
if A[0] == 2:
    print(1/0)
print(A[0])
Problem p02762 (python)

Fixed submission:
class uni:
    def __init__(self,n):
        self.n = n
        self.pare = [i for i in range(n)]
        self.rank = [0]*n

    def find(self,x):
        if self.pare[x] == x:
            return x
        else:
            self.pare[x] = self.find(self.pare[x])
            return self.pare[x]

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.pare[x] = y
        else:
            self.pare[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def show(self):
        return self.pare


N, M, K = map(int,input().split())
size = [0]*N
count = [0]*N
side = [[]for i in range(N)]
union = uni(N)
for i in range(M):
    a,b = map(int,input().split())
    union.union(a-1,b-1)
    count[a-1] += 1
    count[b-1] += 1
for i in range(N):
    size[union.find(i)] += 1
for i in range(K):
    c,d = map(int,input().split())
    if union.pare[c-1] == union.pare[d-1]:
        count[c-1] += 1
        count[d-1] += 1
for i in range(N):
    print(size[union.pare[i]]-count[i]-1,end=" ")
print()

Buggy submission (verdict: Runtime Error):
class uni:
    def __init__(self,n):
        self.n = n
        self.pare = [i for i in range(n)]

    def find(self,x):
        if self.pare[x] == x:
            return x
        else:
            self.pare[x] = self.find(self.pare[x])
            return self.pare[x]

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        self.pare[x] = y

    def show(self):
        return self.pare


N, M, K = map(int,input().split())
size = [0]*N
count = [0]*N
side = [[]for i in range(N)]
union = uni(N)
for i in range(M):
    a,b = map(int,input().split())
    union.union(a-1,b-1)
    count[a-1] += 1
    count[b-1] += 1
for i in range(N):
    size[union.find(i)] += 1
for i in range(K):
    c,d = map(int,input().split())
    if union.pare[c-1] == union.pare[d-1]:
        count[c-1] += 1
        count[d-1] += 1
for i in range(N):
    print(size[union.pare[i]]-count[i]-1,end=" ")
print()
Problem p02793 (python)

Fixed submission:
def GCD(x,y):
    if y==0:
        return x
    return GCD(y,x%y)

def func(x):
    if x <= 1:
        return []
    for i in range(2,int(x**0.5)+1):
        if x%i == 0:
            count = 0
            while x%i==0:
                x //= i
                count += 1
            return [[i,count]]+func(x)
    return [[x,1]]
MOD = 10**9+7
N = int(input())
A = list(map(int,input().split()))
lcm = [0]*(10**6)
for i in A:
    for a,b in func(i):
        lcm[a] = max(lcm[a],b)
L = 1
for i in range(2,10**6):
    L *= pow(i,lcm[i],MOD)
    L %= MOD
ans = 0
for i in A:
    ans += L*pow(i,MOD-2,MOD)
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

MOD = 10**9+7
N = int(input())
A = list(map(int,input().split()))
lcm = 1
for i in A:
    lcm = (lcm*i)//gcd(lcm,i)
lcm %= MOD
for i in A:
    ans += lcm//i
    ans %= MOD
print(ans)
Problem p02863 (python)

Fixed submission:
N,T = map(int,input().split())
food = list(list(map(int,input().split()))for i in range(N))
DP = [[0]*(T) for i in range(N+1)]
for i in range(N):
    a,b = food[i]
    for j in range(min(a,T)):
        DP[i+1][j] = DP[i][j]
    for j in range(a,T):
        DP[i+1][j] = max(DP[i][j],DP[i][j-a]+b)
ans = 0
i = N
j = T-1
while i > 0 and j > 0:
    if DP[i][j] == DP[i][j-1]:
        j -= 1
    elif DP[i][j] == DP[i-1][j]:
        i -= 1
    else:
        food[i-1][1] = 0
        j -= food[i-1][0]
        i -= 1
food.sort(reverse=True,key= lambda x:x[1])
print(DP[-1][-1]+food[0][1])

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
food = list(list(map(int,input().split()))for i in range(N))
ans = 0
if T == 1:
    for _,i in food:
        ans = max(i,ans)
    print(ans)
    exit()
DP = [[0]*(T) for i in range(N+1)]
for i in range(N):
    a,b = food[i]
    for j in range(a):
        DP[i+1][j] = DP[i][j]
    for j in range(a,T):
        DP[i+1][j] = max(DP[i][j],DP[i][j-a]+b)
ans = 0
i = N
j = T-1
while i > 0 and j > 0:
    if DP[i][j] == DP[i][j-1]:
        j -= 1
    elif DP[i][j] == DP[i-1][j]:
        i -= 1
    else:
        food[i-1][1] = 0
        j -= food[i-1][0]
        i -= 1
food.sort(reverse=True,key= lambda x:x[1])
print(DP[-1][-1]+food[0][1])

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
food = list(list(map(int,input().split()))for i in range(N))
DP = [[0]*(T) for i in range(N+1)]
for i in range(N):
    a,b = food[i]
    for j in range(a):
        DP[i+1][j] = DP[i][j]
    for j in range(a,T):
        DP[i+1][j] = max(DP[i][j],DP[i][j-a]+b)
ans = 0
i = N
j = T-1
while i > 0 and j > 0:
    if DP[i][j] == DP[i][j-1]:
        j -= 1
    elif DP[i][j] == DP[i-1][j]:
        i -= 1
    else:
        food[i-1][1] = 0
        j -= food[i-1][0]
        i -= 1
food.sort(reverse=True,key= lambda x:x[1])
print(DP[-1][-1]+food[0][1])

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
food = list(list(map(int,input().split()))for i in range(N))
DP = [[0]*(T) for i in range(N+1)]
for i in range(N):
    a,b = food[i]
    for j in range(a):
        DP[i+1][j] = DP[i][j]
    for j in range(a,T):
        DP[i+1][j] = max(DP[i][j],DP[i][j-a]+b)
ans = 0
i = N
j = T-1
while i > 0 and j > 0:
    if DP[i][j] == DP[i][j-1]:
        j -= 1
    elif DP[i][j] == DP[i-1][j]:
        i -= 1
    else:
        food[i-1][1] = 0
        i -= 1
        j -= food[i][0]
food.sort(reverse=True,key= lambda x:x[1])
print(DP[-1][-1]+food[0][1])
Problem p02891 (python)

Fixed submission:
S = list(input())
K = int(input())
R = []
hoge = 1
for i in range(1,len(S)):
    if S[i] == S[i-1]:
        hoge += 1
    else:
        R.append(hoge)
        hoge = 1
R.append(hoge)
ans = 0
if len(R) == 1:
    print((R[0]*K)//2)
    exit()
if S[0] == S[-1]:
    ans += (K-1)*((R[0]+R[-1])//2) + R[0]//2 + R[-1]//2
    R[0],R[-1] = 0,0
for i in R:
    ans += (i//2)*K 
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
K = int(input())
R = []
hoge = 1
for i in range(1,len(S)):
    if S[i] == S[i-1]:
        hoge += 1
    else:
        R.append(S)
        hoge = 1
R.append(hoge)
ans = 0
if len(R) == 1:
    print((R[0]*K)//2)
    exit()
if S[0] == S[-1]:
    ans += (K-1)*((R[0]+R[-1])//2) + R[0]//2 + R[-1]//2
    R[0],R[-1] = 0,0
for i in R:
    ans += (i//2)*K 
print(ans)
Problem p02925 (python)

Fixed submission:
N = int(input())
A = list(list(map(int,input().split()))for _ in range(N))

c = [0]*(N)
p = []
for i in range(N):
    j = A[i][c[i]]-1
    if i == A[j][c[j]]-1 and i < j:
        p.append((i,j))
ans = 0
while p:
    q = []
    for i,j in p:
        c[i] += 1
        c[j] += 1
        if c[i] < N-1:
            k = A[i][c[i]]-1
            if A[k][c[k]]-1 == i:
                q.append((i,k))
        if c[j] < N-1:
            k = A[j][c[j]]-1
            if A[k][c[k]]-1 == j:
                q.append((j,k))
    ans += 1
    p = q[:]

if min(c) != N-1:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
input = sys.stdin.readline
N = int(input())
side = [[[]for _ in range(N)]for _ in range(N)] 
node = [[1]*N for i in range(N)]
for i in range(N):
    A = list(map(int,input().split()))
    for j in range(N-2):
        a,b = min(i,A[j]-1),max(i,A[j]-1)
        c,d = min(i,A[j+1]-1),max(i,A[j+1]-1)
        side[a][b].append([c,d])
        node[c][d] = 0
def DFS(x,y,l):
    if l > N**2:
        print(-1)
        exit()
    ret = l
    for i,j in side[x][y]:
        ret = max(ret, DFS(i,j,l+1))
    return ret


ans = 0
for i in range(N):
    for j in range(i+1,N):
        if node[i][j]:
            ans = max(DFS(i,j,1),ans)
if ans:
    print(ans)
else:
    print(-1)
Problem p02955 (python)

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
ans = 1
C = []
for i in range(1,int(S**0.5+1)):
    if S%i == 0:
        C.append(i)
        C.append(S//i)
for c in C:
    B = []
    for i in A:
        B.append(i%c)
    B.sort()
    hoge = 0
    sum_b = sum(B)
    for i in range(N):
        hoge += B[i]
        sum_b -= B[i]
        if hoge <= K and hoge == c*(N-i-1)-sum_b:
            ans = max(ans,c)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,K = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
ans = 1
C = []
for i in range(1,int(S**0.5+1)):
    if S%i == 0:
        C.append(i)
        C.append(S//i)
for c in C:
    B = np.array(A) % c
    B.sort()
    hoge = 0
    for i in range(N):
        hoge += B[i]
        if hoge <= K and hoge == -sum(B[i+1:]-c):
            ans = max(ans,c)
print(ans)
Problem p03108 (python)

Fixed submission:
N,M = map(int,input().split())
AB = list(list(map(int,input().split()))for i in range(M))
AB.reverse()
node = [[i,[i]]for i in range(N)]
ans = [(N*(N-1))//2]
for a,b in AB:
    a,b = min(node[a-1][0],node[b-1][0]),max(node[a-1][0],node[b-1][0])
    if a != b:
        ans.append(ans[-1]-len(node[a][1])*len(node[b][1]))
        for i in node[b][1]:
            node[i][0] = a
            node[i][1] = [i]
            node[a][1].append(i)
    else:
        ans.append(ans[-1])
ans.reverse()

for i in ans[1:]:
    print(i)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
bri = [[int(i) for i in input().split()]for i in range(M)]

def benri(x,con):
    #conにxが含まれていたらconを返す
    if x in con :
        return con
    else:
        con.append(x)
    #探索するよ
    for i in bri:
        if x in i:
            con=(benri(i[i[0]==x],con))
    return con

for i in range(1,M+1):
    bri.pop(0)
    #不便さを図るよ
    sima = []
    fuben = []
    for j in range(1,N+1):
        if not(j in sima):
            #simaからbenriを排除
            fubencount = 0
            AAA = benri(j,[])
            for k in AAA:
                sima.append(k)
            fuben.append(len(AAA))
    fubendo = 0
    
    f = int((N*(N-1))/2)
    for j in fuben:
        f -=int ((j*(j-1))/2)
    print(int(f))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
bri = [[int(i) for i in input().split()]for i in range(M)]

def benri(x,con):
    #conにxが含まれていたらconを返す
    if x in con :
        return con
    else:
        con.append(x)
    #探索するよ
    for i in bri:
        if x in i:
            con=(benri(i[i[0]==x],con))
    return con

for i in range(1,M+1):
    bri.pop(0)
    #不便さを図るよ
    sima = []
    fuben = []
    for j in range(1,N+1):
        if not(j in sima):
            #simaからbenriを排除
            fubencount = 0
            AAA = benri(j,[])
            for k in AAA:
                sima.append(k)
            fuben.append(len(AAA))
    fubendo = 0
    
    f = (N*(N-1))/2
    for j in fuben:
        f -= (j*(j-1))/2
    print(f)
Problem p03137 (python)

Fixed submission:
#入力
N,M = map(int,input().split())
X = [int(i) for i in input().split()]
#ソートする
X.sort()
if N>=M:
    print("0")
else:
    L = list()
    for i in range(M-1):
        L.append(X[i+1]-X[i])
    a=0 
    L.sort()
    for i in range(N-1):
        L.pop(-1)
    for i in L:
        a+=i
    print(a)

Buggy submission (verdict: Runtime Error):
#入力
N,M = map(int,input().split())
X = [int(i) for i in input().split()]
#ソートする
X.sort()

L = list()
for i in range(M-1):
    L.append(X[i+1]-X[i])
a=0
L.sort()
for i in range(N-1):
    L.pop(-1)
for i in L:
    a+=i
print(a)
Problem p02693 (python)

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

n = a//k
if a <= (n+1)*k <= b or a <= n * k <=b:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
import itertools

n, m, q = map(int, input().split())

nums = []
for _ in range(q):
    nums.append(list(map(int, input().split())))

total = 0

l = [1,2,3,4,5,6,7,8,9,10]
for v in itertools.combinations_with_replacement(l, n):
    scores = []
    for a,b,c,d in nums:
        if v[b-1]-v[a-1] == c:
            scores.append(d)
        else:
            scores.append(0)
    if total <= sum(scores):
        total = sum(scores)

print(total)
Problem p02729 (python)

Fixed submission:
from math import factorial
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, M = map(int, input().split())

if N - 2 >= 0:
    a = cmb(N,2)
else:
    a = 0


if M - 2 >= 0:
    b = cmb(M,2)
else:
    b = 0

print(int(a)+int(b))

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


def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


n = int(input())
nums = list(map(int, input().split()))
d = Counter(nums)
# for num in nums:
#     if not d.get(num):
#         d[num] = 1
#     else:
#         d[num] += 1

combination_d = {}

for num in nums:
    counter = 0
    if combination_d.get(num):
        print(combination_d[num])
        continue

    nums.count(num)

    for key in d.keys():
        if key == num:
            if d[key]-1 >= 2:
                counter += cmb(d[key]-1, 2)
        else:
            if d[key] >= 2:
                counter += cmb(d[key], 2)
    
    combination_d[num] = counter
    print(counter)
Problem p02773 (python)

Fixed submission:
import numpy as np

num = int(input())

words = []
for _ in range(num):
    words.append(input())

words = tuple(words)

d = {}
for word in words:
    if word in d:
        d[word] += 1
    else:
        d[word] =1


# keyをndarrayで取得
keys = np.array([a[0] for a in d.items()])

# valueをndarrayで取得
values = np.array([a[1] for a in d.items()])

# valueがmaxであるkeyを探してくる
keys_of_max_val = keys[values == values.max()]

keys_of_max_val.sort()

print('\n'.join(keys_of_max_val))

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

num = int(input())

words = []
for _ in range(num):
    words.append(input())

words = tuple(words)

d = {}
for word in words:
    if word in d:
        d[word] += 1
    else:
        d[word] =1


# keyをndarrayで取得
keys = np.array([a[0] for a in d.items()])

# valueをndarrayで取得
values = np.array([a[1] for a in d.items()])

# valueがmaxであるkeyを探してくる
keys_of_max_val = keys[values == values.max()]

keys_of_max_val.sort()

print('\n'.join(keys_of_max_val))
Problem p02594 (python)

Fixed submission:
tem = int(input())
if tem >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
tem = int.input()
if tem >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
tem = input()
if tem >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):

tem = input()
if tem >= 30:
  print("Yes")
else:
  Print("No")
Problem p02622 (python)

Fixed submission:
s = input()
t = input()
c = 0
 
for i in range(len(s)):
  if s[i] != t[i]:
    c += 1
 
print(str(c))

Buggy submission (verdict: Runtime Error):
s = input().split()
t = input().split()
c = 0

for i in rangea(len(s)):
  if s[i] != t[i]:
    c += 1

print(str(c))
Problem p02676 (python)

Fixed submission:
k = int(input())
s = input()
 
if len(s) <= k :
  print(s)
else:
  print(s[0:k]+"...")

Buggy submission (verdict: Runtime Error):
k = int(input())
s = input()
 
if len(s) < k :
  print(s)
else:
  print(substr(s,0,k)+"...")

Buggy submission (verdict: Runtime Error):
k = int(inpout())
s = input()

if len(s) < k :
  print(s)
else:
  print(substr(s,0,k)+"...")
Problem p02682 (python)

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

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

if k < a:
  print(str(k))
elif k < (a + b):
  print(str(a))
else:
  print(str(a - c)):
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if ((b//k)*k >= a):
  print("OK")
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a,b = [input() for i in range(2)]
if (b-a+1 >= k):
  print("OK")
else:
  print("NG")
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):

a = list.map(int,input().split())
if a[1] >= a[0]:
  print("unsafe")
else:
  print("safe")
Problem p02711 (python)

Fixed submission:
a = input()
if "7" in a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
if "7" in a:
  print(Yes)
else:
  print(No)
Problem p02729 (python)

Fixed submission:
a,b = map(int,input().split())
if (a != 0) and (b != 0):
    print(str(int(a*(a-1)/2 + b*(b-1)/2)))
elif (a == 0) and (b == 0):
    print("0")      
elif (a == 0) and (b != 0):
    print(str(int(b*(b-1)/2)))
else:
    print(str(int(a*(a-1)/2)))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a != 0) and (b != 0):
    print(str(int(a*(a-1)/2 + b*(b-1)/2)))
elif (a == 0) and (b == 0):
    print("0")      
elif (a == 0) and (b != 0):
    print(str(int(b*(b-1)/2)))
else:
    print(str(inr(a*(a-1)/2)))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a != 0) and (b != 0):
    print(str(int(a*(a-1)/2 + b*(b-1)/2)))
elif (a == 0) and (b == 0):
    print("0")      
elif (a == 0) and (b != 0):
    print(str(int((b*(b-1)/2)))
else:
    print(str(int((a*(a-1)/2)))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a >= 1) and (b >= 1):
    print(str(a*(a-1)/2 + b*(b-1)/2))
elif (a == 0) and (b == 0):
    print(str("0")
elif (a == 0):
    print(str(b*(b-1)/2))
else:
    print(str(a*(a-1)/2))