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

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


n = int(input())
l = list(map(int, input().split()))
num = 0
for i in range(len(l)):
    num = gcd(num, l[i])

print(num)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
l = list(map(int, input().split()))
gcd = l[0]
for i in range(len(l) - 1):
    gcd = math.gcd(gcd, l[i + 1])

print(gcd)
Problem p03137 (python)

Fixed submission:
n, m = tuple(map(int, input().split()))
x = list(map(int, input().split()))
x = sorted(x)

diff = []

for i in range(len(x) - 1):
    diff.append(x[i + 1] - x[i])

diff = sorted(diff)

diff_sum = 0
diff_len = m - 1

for i in range(diff_len - (n - 1)):
    diff_sum += diff[i]

print(diff_sum)

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

diff = []
for i in range(len(list) - 1):
    diff.append(list[i] - list[i+1])

abs_diff = []
for i in range(len(diff)):
    abs_diff.append(abs(diff[i]))

abs_diff = sorted(abs_diff)

if abs_diff != []:
    for _ in range(n - 1):
        abs_diff.pop(abs_diff.index(max(abs_diff)))

print(sum(abs_diff))

Buggy submission (verdict: Runtime Error):
n, m = tuple(map(int, input().split()))
list = list(map(int, input().split()))
list = sorted(list)
list2 = list.copy()

list.pop(-1)
list2.pop(0)

diff = []
for i in range(len(list)):
    diff.append(list[i] - list2[i])

abs_diff = []
for i in range(len(diff)):
    abs_diff.append(abs(diff[i]))

abs_diff = sorted(abs_diff)

if abs_diff != []:
    for _ in range(n - 1):
        abs_diff.pop(abs_diff.index(max(abs_diff)))

print(sum(abs_diff))
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 1:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
x = int(input())
if x = 1:
  print(0)
else:
  print(1)
Problem p02627 (python)

Fixed submission:
def test(a):
	if a.isupper():
		print('A')
	else:
		print('a')

        
test(input())

Buggy submission (verdict: Runtime Error):

def test(a):
	if tmp.isupper():
		return 'A'
	else:
		return 'a'
      
test(input())

Buggy submission (verdict: Runtime Error):
tmp = input()
if tmp.isupper():
  print 'A'
else:
  print'a'
Problem p02552 (python)

Fixed submission:
x=int(input())
if x==0:
    print('1')
else:
    print('0')

Buggy submission (verdict: Runtime Error):
x=int(input())
if x==0:
    print('1')
else:
    print('0
Problem p02659 (python)

Fixed submission:
a, b = map(int, input().replace(".","").split())
print(a*b//100)

Buggy submission (verdict: Runtime Error):
from decimal import decimal
a, b = map(decimal, input().split())
print(a*b)
Problem p02693 (python)

Fixed submission:
k = int(input())
a, b = map(int,input().split())
n = 1
ans = "NG"
while (k*n) <= b:
    if (k*n) >= a and (k*n) <= b:
        ans = "OK"
        break
    n += 1
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = map(int,input().split())
n = 1
flag = True
while (k*n) <= b:
    if (k*n) >= a and (k*n) <= b:
        ans = "OK"
        break
    else:
        ans = "NG"
    n += 1
print(ans)
Problem p02572 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = [0]
ans = 0
MOD = 1000000007
for i in range(0, n, 1):
    s.append((s[i] + a[i]) % MOD)

for i in range(0, n, 1):
    ans += ((s[n] - s[i + 1]) * a[i]) % MOD

print(ans % MOD)

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


def mo(v):
    return v % 1000000007


n = int(input())
a = mo(np.array(list(map(int, input().split()))))
s = 0
for i in range(0, n - 1, 1):
    for j in range(i + 1, n, 1):
        s += mo(a[i] * a[j])
print(mo(s))
Problem p02552 (python)

Fixed submission:
x = int(input())

if x == 1:
    print('0')
else:
    print('1')

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

if x = 1:
    print("0")
else:
    print("1")
Problem p02596 (python)

Fixed submission:
K = int(input())

if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

i = 0
ai = 0
while True:
    ai = (ai * 10 + 7) % K
    i += 1
    if ai == 0:
        break
print(i)

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

t = 7
for i in range(K):
    if t % K == 0:
        print(i + 1)
        break
    t = (t * 10 + 7) % K
    else:
        print(-1)
Problem p02570 (python)

Fixed submission:
D, T, S = map(int, input().split())

time = D/S

if time > T:
    print("No")
else: print("Yes")

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main() {
    //入力を受け取る
    int D, T, S;
    cin >> D >> T >> S;

    //高橋君の移動時間を計算する
    double time = (double)D / S;

    //Tとtimeの大小関係に応じて出力をする
    if (T >= time) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

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


Sum = 0
mod_n = 10.0E8 +7

for i in range(N-1):
    for j in range(i+1,N):
        if j == len(A):
            break
        else:
            Sum +=  A[i]*A[j]
        


# for i in A:
#     Sum -= i**2

# Sum = int(Sum/2)
print(Sum)


print(int(Sum % mod_n))
Problem p02693 (python)

Fixed submission:
k = int(input().strip())
a, b = input().strip().split()
a = int(a)
b = int(b)
c = 0
for i in range(1,1001):
    if i*k <= b and i*k >= a:
        print("OK")
        c = 1
        break
if c == 0:
    print("NG")

Buggy submission (verdict: Runtime Error):
import math
a,b,n=(int(x) for x in input().split())
k =0
for x in range(0,n+1):
    c = math.floor((a*x)/b)-a*math.floor(x/b)
    if c  > k:
        k = c
print(k)
Problem p02723 (python)

Fixed submission:
a = input()
b = []
for z in a:
  b.append(z)
if b[2]==b[3]:
  if b[4]==b[5]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
b = []
for z in a:
  b.apppend(z)
if b[2]==b[3]:
  if b[4]==b[5]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
for z in a:
  if a[3]==a[4] & a[5]==a[6] :
    print("Yes")
  else :
    print("No")
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
H = list(S)
P = len(H)
oo = []
ll = []
if P%2 == 0:
  for a in range (0,int(N/2)):
    oo.append(H[int(a)])
    ll.append(H[int(a+N/2)])
  if oo == ll :
    print("Yes")
  else :
    print("No")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
H = list(S)
P = len(H)
oo = []
ll = []
if P%2 == 0:
  for a in range (0,N/2):
    oo.append(H(a))
    ll.append(H(a+N/2))
    if oo == ll :
      print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
H = list(S)
P = len(H)
oo = []
ll = []
if P%2 == 0:
  for a in range (0,N/2):
    oo.append(a)
    ll.append(a+N/2)
    if oo == ll :
      print("Yes")
else :
  print("No")
Problem p02570 (python)

Fixed submission:
D, T, S = map(int, input().split())

TS = T * S

if D <= TS:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int ,input().split()))
MOD = 10**9+7

sum = 0
for i in range (N):
    sum += A[i]

ans = 0
for i in range(N):
    sum -= A[i]
    ans += (A[i] * sum) % MOD

ans = ans % MOD
print(ans)
Problem p02571 (python)

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

ans = len(T)
l = len(T)
for m in range (len(S)-l+1):
    diff = 0
    for i in range (l):
        if S[m+i] != T[i]:
            diff+=1
    ans = min(ans, diff)

print(ans)

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

l = len(T)
for i in range (l):
    if T[:l-i] in S:
        ans = i
        break
    if T[i:] in S:
        ans = i
        break

print(ans)
Problem p02598 (python)

Fixed submission:
import math

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

left = 0
right = max(A)

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += A[i] // mid - 1
        if A[i] % mid != 0: jk += 1
    if jk <= K:
        right = mid
    else:
        left = mid

print(right)

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

A.sort(reverse=True)

left = 0
right = A[0]

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += math.ceil( A[i] / mid)
    if jk < K:
        right = mid
    else:
        left = mid

print(right)
Problem p02580 (python)

Fixed submission:
h,w,m=map(int,input().split())
item=[list(map(int,input().split())) for i in range(m)]
row=[0]*h
col=[0]*w
for i in range(m):
    x,y=item[i]
    row[x-1]+=1
    col[y-1]+=1
mr,mc=max(row),max(col)
xr=set([i for i in range(h) if row[i]==mr])
xc=set([i for i in range(w) if col[i]==mc])
check=len(xr)*len(xc)
for i in range(m):
    r,c=item[i]
    if r-1 in xr and c-1 in xc:
        check-=1
print(mr+mc if check>0 else mr+mc-1)

Buggy submission (verdict: Runtime Error):
H, W, M = map(int, input().split())

h = [0] * W
w = [0] * H
Mem = []
for _ in range(M):
  i, j = map(int, input().split())
  Mem.append((i, j))
  h[i-1] += 1
  w[j-1] += 1

h_idx = h.index(max(h))
w_idx = w.index(max(w))

ans = max(h) + max(w)
if (h_idx + 1, w_idx + 1) in Mem:
  ans -= 1

print(ans)

Buggy submission (verdict: Runtime Error):
H, W, M = map(int, input().split())

B = [[0] * W for _ in range(H)]

for _ in range(M):
  i, j = map(int, input().split())
  B[i-1][j-1] = 1

ans = 0
  
for i in range(H):
  for j in range(W):

    tmp = sum(B[i])
    tmp -= B[i][j]
    for h in range(H):
      tmp += B[h][j]
      
    ans = max(ans, tmp)

print(ans)
Problem p02577 (python)

Fixed submission:
N = input()
rank = len(N) - 1
i = 0
while(len(N) != 0):
    a = N[0]
    N = N[1:]
    a = int(a)
    i += a
if (i % 9 == 0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
i = 0
while(N >= 1):
    i += N % 10
    N = int(N/10)
if (i % 9 == 0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
i = 0
while(N >= 1):
    i += N % 10
    N = int(N/10)
if (i % 9 == 0):
    print("Yes")
else:
    print("No")
Problem p02594 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
C = list(input())
N1 = int(N/2)
C1 = C[0:N1]
C2 = C[N1:N]
count = 0
if (C1.count('W') == C2.count('R')):   #左右対象のとき
    count = C1.count('W')
elif(C1.count('R') == C2.count('W')):
    count = C.count('W')
print(count)
Problem p02847 (python)

Fixed submission:
s=input()
days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
index = days.index(s)
print(6 - index + 1)
#map(int,input().split())
#list(map(int,input().split()))

Buggy submission (verdict: Runtime Error):
import sys
a,b,x = map(int,input().split())
limit = 10**9
ans = 0
for d in range(1,10):
  n = (x - (b * d)) // a
  #if n <= limit and len(str(n)) == d:
    #ans = max(ans,n)
  #elif n > limit:
    #ans = limit
  # nが求まることとxが求まることは別物
  if 10**(d - 1) <= n < 10**d:
    ans = n
  elif n >= 10**d:
    # なぜ10**9-1は条件を満たすといいきれる？
    ans = 10**d-1
if x>=a*limit + b*10:
  ans = limit
print(ans)
Problem p02862 (python)

Fixed submission:
from operator import mul
from functools import reduce
import sys
x,y = map(float,input().split())
m = (2*x - y)/3
n = (y - m)/2
if not (m.is_integer() and n.is_integer()):
  print(0)
  sys.exit()
if n < 0 or m < 0:
  print(0)
  sys.exit()
m = int(m)
n = int(n)
mod = 10**9 + 7
def cmb(h, r):
    if h - r < r: r = h - r
    if r == 0: return 1
    if r == 1: return h
    r = int(r)

    humerator = [h - r + k + 1 for k in range(r)]
    dehominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = dehominator[p - 1]
        if pivot > 1:
            offset = (h - r) % p
            for k in range(p-1,r,p):
                k = int(k)
                offset = int(offset)
                humerator[k - offset] /= pivot
                dehominator[k] /= pivot

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

    return result
if (x + y) % 3 != 0:
  print(0)
else:
  print(cmb(n + m,n)%mod)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
x,y = map(float,input().split())
m = (2*x - y)/3
n = (y - m)/2
if (x + y) % 3 != 0:
  print(0)
else:
  print(comb(n + m,n,exact=True)%(10**9+7))
Problem p02881 (python)

Fixed submission:
import sys
from collections import deque
import math


# ans = 0
n = int(input())
#h = math.ceil(n/2)
dists = []
h = math.ceil(math.sqrt(n))
# i <= jとする
for i in range(1,h + 1):
    if n % i != 0:
      continue
    j = int(n / i)
    dists.append(i + j - 2)
print(min(dists))


# h = math.ceil(n/2)
# board1 = [[0]*h/2 for _ in range(h/2)]
# board2 = [[0]*h/2 for _ in range(h/2)]
# for i in range(1,h/2 + 1):
#   for j in range(1,h/2 + 1):
#     board1[i - 1][j - 1] = i * j
# for i in range(h/2 + 1,h + 1):
#   for j in range(h/2 + 1,h + 1):
#     board2[i - (h/2 + 1)][j - (h/2 + 1)] = i * j
# sx = 1
# sy = 1
# gx = 0
# gy = 0
# dist1 = [[-1]*h/2 for _ in range(h/2)]
# dist2 = [[-1]*h/2 for _ in range(h/2)]
# que = deque([(sy - 1,sx - 1)])
# dist1[sy - 1][sx - 1] = 0
# while que:
#   y,x = que.popleft()
#   if board1[y][x] == n:
#     ans = dist1[y][x]
#     break
#   for y1,x1 in [(y + 1,x),(y, x + 1)]:
#     if y1 < 0 or x1 < 0 or x1 >= h/2:
#       continue
#     if y1 >= h/2:
#       sy = y1
#       sx = x1
#       gy = y
#       gx = x
#       break
#     if dist1[y1][x1] != -1:
#       continue
#     if dist1[y1][x1] == -1:
#       dist1[y1][x1] = dist1[y][x] + 1
#       que.append((y1,x1))
# que = deque([sy,sx])
# dist2[sy][sx] = 0
# while que:
#   y,x = que.popleft()
#   if board2[y][x] == n:
#     ans = dist1[gy][gx] + dist2[y][x]
#     break
#   for y1,x1 in [(y + 1,x),(y, x + 1)]:
#     if y1 < 0 or x1 < 0 or x1 >= h/2:
#       continue
#     if y1 >= h/2:
#       sy = y1
#       sx = x1
#       break
#     if dist2[y1][x1] != -1:
#       continue
#     if dist2[y1][x1] == -1:
#       dist2[y1][x1] = dist2[y][x] + 1
#       que.append((y1,x1))
# print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
import math
ans = 0
n = int(input())
h = math.ceil(n/2)
board = [[0]*h for _ in range(h)]
for i in range(1,h + 1):
  for j in range(1,h + 1):
    board[i - 1][j - 1] = i * j
sx = 1
sy = 1
dist = [[-1]*h for _ in range(h)]
que = deque([(sy - 1,sx - 1)])
dist[sy - 1][sx - 1] = 0
while que:
  y,x = que.popleft()
  if board[y][x] == n:
    ans = dist[y][x]
    break
  for y1,x1 in [(y + 1,x),(y, x + 1)]:
    if y1 < 0 or x1 < 0 or y1 >= h or x1 >= h:
      continue
    if dist[y1][x1] != -1:
      continue
    dist[y1][x1] = dist[y][x] + 1
    que.append((y1,x1))
print(ans)
Problem p03017 (python)

Fixed submission:
N,A,B,C,D = map(int,input().split())
S = list(input())
#pre = S[B - 2]
ans = "Yes"
is_reversed = False
flag = False
# cnt = 0
# max_cnt = 0
if D < C:
  is_reversed = True

for i in range(A,max(C,D) -1):
  if S[i] == S[i + 1] == "#":
    ans = "No"
if is_reversed == True:
  for i in range(B - 2,D - 1):
    if S[i] == S[i + 1] == S[i + 2] == ".":
      flag = True
    # if S[i] == ".":
    #   cnt += 1
    # elif S[i] == "#":
    #   cnt = 0
    # max_cnt = max(max_cnt,cnt)
    # pre = S[i]
  # if is_reversed == True and max_cnt < 3:
  #   ans = "No"
  if flag == False:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
N,A,B,C,D = map(int,input().split())
S = list(input())
ans = "Yes"
is_reversed = False
flag = False

if D < C:
  is_reversed = True

for i in range(A,max(C,D) -1):
  if S[i] == S[i + 1] == "#":
    ans = "No"
if is_reversed == True:
  for i in range(B - 2,D - 1):
    if S[i] == S[i + 1] == S[i + 2] == ".":
 
  if flag == False:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
N,A,B,C,D = map(int,input().split())
S = list(input())
ans = "Yes"
is_reversed = False
flag = False
if D < C:
  is_reversed = True
for i in range(A,max(C,D) -1):
  if S[i] == S[i + 1] == "#":
    ans = "No"
for i in range(B - 2,D - 1):
  if S[i] == S[i + 1] == S[i + 2] == ".":
    flag = True

if is_reversed == True and flag == False:
  ans = "No"
print(ans)
Problem p02629 (python)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    ans = ''
    for i in range(1, 20):
        if n <= 26**i:
            n -= 1
            for j in range(i):
                ans += chr((n % 26) + ord('a'))
                n //= 26
            print(ans[::-1])
            return
        else:
            n -= 26**i

if __name__ == '__main__':
    main()

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

def main():
    n = int(input())
    l = list(itertools.accumulate(list(26**i for i in range(1,12))))
    c = list('abcdefghijklmnopqrstuvwxyz')
    for i in range(11):
        if n <= l[i]:
            ans = ['']*(i+1)
            break
    if i == 0:
        print(c[n-1])
    else:
        n -= l[i-1]
        for j in range(i+1):
            tmp = n // (26**(i-j))
            if j == i:
                tmp -= 1
            ans[j] = c[tmp]
            n -= ((26**(i-j)) * tmp)
        print(''.join(ans))

if __name__ == '__main__':
    main()
Problem p02701 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    list.append(s)
    #if not s in list:
        #list.append(s)

#print(list)
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C, D = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

while(1):
    C = C-B
    if C <= 0:
        print("Yes")
        break
    A = A-D
    if A <= 0:
        print("No")
        break
Problem p03207 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
list = [int(input()) for i in range(N)]

list=sorted(list)
list.reverse()
#print(list)

ans = 0

for i, l in enumerate(list):
    if i==0:
        ans = l/2
    else:
        ans = ans + l

print(int(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
list = [int(input()) for i in range(N)]

list=sorted(list)
list.reverse()
#print(list)

ans = 0

for i, l in enumerate(list):
    if i==0:
        ans = l/2
    else:
        ans = ans + l

print(int(ans)
Problem p02699 (python)

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

if b-a>=0:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = list(input())
M = [0]
S = 0
K = 1
ans = 0

for i in range(len(N)):
    S += int(N[-i-1])*K
    S %= 2019

    K *= 10
    K %= 2019
    M.append(S)

P = Counter(M)
for i in range(2020):ans+=P[i]*(P[i]-1)//2
print(ans)
Problem p02577 (python)

Fixed submission:
N = int(input())
if N % 9 == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
if Base_10_to_n(int(input()), 9)[-1] == '0':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def Base_10_to_9(X):
    if (int(X/9)):
        return Base_10_to_9(int(X/9))+str(X%9)
    return str(X%9)
if Base_10_to_9(int(input()))[-1] == '0':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def Base_10_to_9(X):
    if (int(X/9)):
        return Base_10_to_9(int(X/9))+str(X%9)
    return str(X%9)
if Base_10_to_9(int(input()))[-1] == '0':
    print('Yes')
else:
    print('No')
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
for i in range(len(S)):
    for j in range(i + 5, i + 6):
        if int(S[i:j]) % 2019 == 0:
            count += 1
print(count)
Problem p02707 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
A = [0] * N
for x in L:
    A[x - 1] += 1

print(*A, sep = '\n')

Buggy submission (verdict: Runtime Error):
#3
N = int(input())
L = list(map(int, imput().split()))
A = [0] * N
for x in L:
    A[x - 1] += 1

print(*A, sep = '¥n)
Problem p02711 (python)

Fixed submission:
N = int(input())
a1 = N % 10
a2 = ((N % 100) - a1) / 10
a3 = N // 100
if a1 == 7 or a2 == 7 or a3 ==7:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = input()
ans = 'No'
for i in range(len(N)):
    if N[i] == 7:
        global ans
        ans = 'Yes'
        break
    else:
        continue
print(ans)
Problem p02570 (python)

Fixed submission:
d, t, s = map(int, input().split())

ans = 'Yes' if d/s <= t else 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



from collections import defaultdict
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



import sys
from collections import defaultdict
input = sys.stdin.readline
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)
Problem p02659 (python)

Fixed submission:
from fractions import Fraction
a, b = map(Fraction, input().split())

print(int(a*b))

Buggy submission (verdict: Runtime Error):
a, b = map(float, input().split())
print(((a*(100*b))//100)

Buggy submission (verdict: Runtime Error):
a, b = map(float, input().split())
print(((a*(100*b))/100)
Problem p02847 (python)

Fixed submission:
d = dict(zip( ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'], '6543217'))
s = input()
print(d[s])

Buggy submission (verdict: Runtime Error):
d = dict(zip( ['MON', 'TUE', 'WED', 'THUR', 'FRI', 'SAT', 'SUN'], '6543217'))
s = input()
print(d[s])
Problem p02753 (python)

Fixed submission:
S= input()

if 'A' in S and 'B' in S:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

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

num1 = n // (a + b) * a
num2 = n % (a + b)

if num2 < a:
    print(num1 + num2)
else:
    print(num1)
Problem p02759 (python)

Fixed submission:
import math

n = int(input())

print(math.ceil(n / 2))

Buggy submission (verdict: Runtime Error):
a = []
for i in range(3):
    a1, a2, a3 = map(int, input().split())
    a.append(a1)
    a.append(a2)
    a.append(a3)

l = [0]*9
n = int(input())

for i in range(n):
    b = int(input())
    for k in range(9):
        if a[k] == b:
            l[k] += 1
 
if l[0] == 1 and l[1] == 1 and l[2] == 1:
    print('Yes')
elif l[3] == 1 and l[4] == 1 and l[5] == 1:
    print('Yes')
elif l[6] == 1 and l[7] == 1 and l[8] == 1:
    print('Yes')
elif l[0] == 1 and l[3] == 1 and l[6] == 1:
    print('Yes')
elif l[1] == 1 and l[4] == 1 and l[7] == 1:
    print('Yes')
elif l[2] == 1 and l[5] == 1 and l[8] == 1:
    print('Yes')
elif l[0] == 1 and l[4] == 1 and l[8] == 1:
    print('Yes')
elif l[2] == 1 and l[4] == 1 and l[6] == 1:
    print('Yes')
else:
    print('No')