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

Fixed submission:
import sys

def main():
    input = sys.stdin.readline
    MOD = 10**9 + 7
    N, M = map(int, input().split())
    A = [int(input()) for _ in range(M)]
    is_safe = [True] * (N+2)
    for a in A:
        is_safe[a+1] = False

    dp = [0] * (N+2)
    dp[1] = 1
    for i in range(2, N+2):
        if is_safe[i]:
            dp[i] = dp[i-1] + dp[i-2]
            dp[i] %= MOD
        else:
            dp[i] = 0

    return dp[N+1]


if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
def resolve():
    # 整数 1 つ
    n, m = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    Route = [0] * (n+1)
    Route[0] = 1
    for i in range(n):
        if i+1 not in A:
            Route[i+1] += Route[i]
            Route[i+1] %= 10**9 + 7
        if i+2 not in A and i+2 <= n:
            Route[i+2] += Route[i]
            Route[i+2] %= 10**9 + 7

    print(Route[n+1])


resolve()
Problem p02753 (python)

Fixed submission:
s = input()
if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "AAA" or s === "BBB":
    print("no")
else:
    print("yes")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "AAA" or s === "BBB":
    print("no")
else:
    print("yes")

Buggy submission (verdict: Runtime Error):

s = input()
if s == "AAA" or s === "BBB":
    print("no")
else:
    print("yes")

Buggy submission (verdict: Runtime Error):

S = input()
if S[0] == S[1] and S[1]== S[2] == :
    print("no")
else:
    print("yes")

Buggy submission (verdict: Runtime Error):
//入力部分以外わからなかった。

S = input()
if S[0] == S[1] == S[2] == :
    print("no")
else:
    print("yes")

Buggy submission (verdict: Runtime Error):
S = input()
if S[0] == S[1] == S[2] == S[3]:
    print("no")
else:
    print("yes")
Problem p02759 (python)

Fixed submission:
n = int(input())
print((n+1) // 2)

Buggy submission (verdict: Runtime Error):
n = input()
paper = 0
if n % 2 == 0:
    paper = n / 2
else:
    paper = n / 2 + 1
print(paper)

Buggy submission (verdict: Runtime Error):
n = input()
paper = 0
if n % 2 == 0:
    paper = n / 2
else:
    paper = n / 2 + 1
print(paper)
Problem p02771 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b and a!=c:
  print('Yes')
elif a==c and a!=b:
  print('Yes')
elif b==c and b!=a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a ,b ,c = map(int(input().spilt()))
if a == b and a !=c:
    print("Yes")
elif b == c and b != c:
    print("Yes")
elif c == a and c != b:
    pritn("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a ,b ,c = int(input().spilt())
if a == b and a !=c:
    print("Yes")
elif b == c and b != c:
    print("Yes")
elif c == a and c != b:
    pritn("Yes")
else:
    print("No")
Problem p02777 (python)

Fixed submission:
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())
 
if u == s:
  print(a-1,b)
else:
  print(a,b-1)

Buggy submission (verdict: Runtime Error):
#入力部分　ここまでは誰でもできる
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())

if u == s:
  print(a-1,b)
else
  print(a,b-1)
Problem p02785 (python)

Fixed submission:
#入力部
n,k = map(int,input().split())
h = list(map(int,input().split()))

#攻撃:hを1減らす　必殺技:hをすべて減らす制限　k回
#hを降順にソート
h.sort(reverse = True)
#nがkより小さい時全部に必殺技が使えるから0
if n <= k:
    print(0)
#体力が多い順に必殺技を使用して残った体力の合計を出力
else:
    for i in range(k):
        h[i] = 0
    print(sum(h))

Buggy submission (verdict: Runtime Error):
#入力部
n,k = map(int,input().split())
h = list(map(int,input().split()))

#攻撃:hを1減らす　必殺技:hをすべて減らす制限　k回
#hを降順にソート
h.sort(reverse = True)
#nがkより小さい時全部に必殺技が使えるから0
if n <= k:
    print(0)
#体力が多い順に必殺技を使用して残った体力の合計を出力
else:
    for i in range(k):
        s[i] = 0
print(sum(s))
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
ans = 6 - a -b
print(ans)

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

Fixed submission:
a,b = map(int,input().split())
#最大公約数
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
#最小公倍数
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import numpy as np
a,b = map(int,input().split())
lcm = np.lcm(a,b)
print(lcm)

Buggy submission (verdict: Runtime Error):
import numpy as np
a,b = map(int,input().split())
print(np.lcm(a,b))
Problem p02847 (python)

Fixed submission:
s = input()
ans = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(ans[s])

Buggy submission (verdict: Runtime Error):
s = input()
if s == "SUN":
    print(7)
elif s == "MON":
    pritn(6)
elif s == "TUE":
    print(5)
elif s == "WEd":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
else:
    print(1)
Problem p02987 (python)

Fixed submission:
s = list(input())
s.sort()
ans = "No"
if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
s.sort()
ans = "No"
if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        ans = "Yes"
print(ans)
Problem p03307 (python)

Fixed submission:
import fractions
n = int(input())
print(int(2*n / fractions.gcd(2,n)))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
print(int(2*n / math.gcd(2,n)))
Problem p03835 (python)

Fixed submission:
K,S = map(int,input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - (x + y)
        if  0 <= z <= K:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
K,S = map(int,input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - (x + y)
        if  0 <= z <= k:
            ans += 1
print(ans)
Problem p02771 (python)

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

if not a==b==c:
  if a==b or b==c or c==a:
  	print("Yes")
  else:
    print("No")
else:
  print("No")

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

if a=b or b=c or c=a and not a=b=c:
  print("Yes")
else:
  print("No")
Problem p02860 (python)

Fixed submission:
n=int(input())
a=input()

if n%2==1:
  print("No")
  exit()
else:
  count=0
  m=n//2
  for i in range(m):
    if a[i]==a[i+m]:
      count+=1
    else:
      count=0

if count==m:
  print("Yes")
else:
  print("No")

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

if n%2==1:
  print("No")
else:
  count=0
  m=n//2
  for i in range(m):
    if a[i]==a[i+m]:
      count+=1
    else:
      count=0

if count==m:
  print("Yes")
else:
  print("No")
Problem p02879 (python)

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

if len(a)>=2 or len(b)>=2:
  print(-1)
else:
  a=int(a)
  b=int(b)
  print(a*b)

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

if len(a)>=2 or len(b)>=2:
  print(-1)
else:
  print(a*b)

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

if len(a)>=2 or len(b)>=2:
  print("-1")
else:
  print(a*b)
Problem p03805 (python)

Fixed submission:
from itertools import permutations
n,m=map(int,input().split())
s=[set(map(int,input().split())) for _ in range(m)]

ans=0
x=[i for i in range(2,n+1)]
cand=permutations(x)
for i in cand:
  crnt=1
  for nxt in i:
    if set([crnt,nxt]) in s:
      crnt=nxt
    else:
      break
  else:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import permutations
n,m=map(int,input().split())
s=[set(map(int,input().split())) for _ in range(n)]

ans=0
x=[i for i in range(2,n+1)]
cand=permutations(x)
for i in cand:
  crnt=1
  for nxt in i:
    if set([crnt,nxt]) in s:
      crnt=nxt
    else:
      break
  else:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
n,m=map(int,input().split())
s=[set(map(int,input().split())) for _ in range(n)]

ans=0
x=[i for i in range(2,n+1)]
cand=itertools.permutations(x)
for i in cand:
  crnt=1
  for nxt in i:
    if set([crnt,nxt]) in s:
      crnt=nxt
    else:
      break
  else:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
n,m=map(int,input().split())
s=[set(map(int,input().split())) for _ in range(n)]

ans=0
x=[i for i in range(2,n+1)]
print(x)
cand=itertools.permutations(x)
print(cand)
for i in cand:
  crnt=1
  for nxt in i:
    if set([crnt,nxt]) in s:
      crnt=nxt
    else:
      break
  else:
    ans+=1
print(ans)
Problem p02623 (python)

Fixed submission:
def main():
    n, m, k = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    sum_A = [A[0]]
    sum_B = [B[0]]

    for i in range(n - 1):
        sum_A.append(sum_A[i] + A[i + 1])

    for i in range(m - 1):
        sum_B.append(sum_B[i] + B[i + 1])

    R = []

    b = m - 1
    flag = False
    while b > -1:
        if sum_B[b] <= k:
            R.append(b + 1)
            flag = True
            break
        else:
            b -= 1

    if not flag:
        R.append(0)

    for i in range(n):
        a = sum_A[i]

        flag = False
        while b > -1:
            if sum_B[b] <= k - a:
                R.append(i + 1 + b + 1)
                flag = True
                break
            else:
                b -= 1

        if not flag:
            if 0 <= k - a:
                R.append(i + 1)
            else:
                R.append(0)

    print(max(R))
    # while k > 0 and (a < n or b < m):
    #     if a == n:
    #         time = B[b]
    #     elif b == m:
    #         time = A[a]
    #     else:
    #         time = min(A[a], B[b])

    #     if k - time < 0:
    #         break

    #     r += 1
    #     k -= time
    #     print(k)

    #     if a == n:
    #         b += 1
    #     elif b == m:
    #         a += 1
    #     else:
    #         if A[a] >= B[b]:
    #             b += 1
    #         else:
    #             a += 1

    # print(r)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def read(k, a, b, n, m, A, B, r):
    if not (k > 0 and (a < n or b < m)):
        return r
        
    if a == n:
        time = B[b]
    elif b == m:
        time = A[a]
    else:
        time = min(A[a], B[b])

    if k - time < 0:
        return r

    r += 1
    k -= time

    if a == n:
        b += 1
        return read(k, a, b, n, m, A, B, r)
    elif b == m:
        a += 1
        return read(k, a, b, n, m, A, B, r)
    else:
        if A[a] > B[b]:
            b += 1
            return read(k, a, b, n, m, A, B, r)
        elif A[a] < B[b]:
            a += 1
            return read(k, a, b, n, m, A, B, r)
        else:
            return max(read(k, a + 1, b, n, m, A, B, r),
                       read(k, a, b + 1, n, m, A, B, r))


def main():
    n, m, k = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    r = 0
    a = 0
    b = 0
    print(read(k, a, b, n, m, A, B, r))
    # while k > 0 and (a < n or b < m):
    #     if a == n:
    #         time = B[b]
    #     elif b == m:
    #         time = A[a]
    #     else:
    #         time = min(A[a], B[b])

    #     if k - time < 0:
    #         break

    #     r += 1
    #     k -= time
    #     print(k)

    #     if a == n:
    #         b += 1
    #     elif b == m:
    #         a += 1
    #     else:
    #         if A[a] >= B[b]:
    #             b += 1
    #         else:
    #             a += 1

    # print(r)


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

Fixed submission:
A = int(input())
B = int(input())

if A == 1 and B== 2:
    print(3)
if A == 1 and B== 3:
    print(2)
if A == 2 and B== 1:
    print(3)
if A == 2 and B== 3:
    print(1)
if A == 3 and B== 1:
    print(2)
if A == 3 and B== 2:
    print(1)

Buggy submission (verdict: Runtime Error):
A=int(inpur())
B=int(inpur())
print(6-A-B)
Problem p02831 (python)

Fixed submission:
import fractions

def lcm(x, y):
    ans  =(x * y) // fractions.gcd(x, y)
    return ans

A,B=map(int,input().split())

print(lcm(A,B))

Buggy submission (verdict: Runtime Error):
import math

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

A,B=map(int,input().split())

print(lcm(A,B))
Problem p03805 (python)

Fixed submission:

def dfs(node, paths, visited, n):
  # 全て訪問済みだったら全部を訪問できる経路として1を返す
  if not False in visited:
    return 1

  count = 0

  for nn in paths[node]:
    # 既に訪問済みなら処理をしない
    if(visited[nn]):
      continue

    visited[nn] = True
    count += dfs(nn, paths, visited, n)
    visited[nn] = False

  return count

def main():
  N, M = list(map(int, input().split()))
  paths = [[] for i in range(N)]
  visited = [False] * N

  for i in range(M):
    a, b = list(map(int, input().split()))
    paths[a-1].append(b-1)
    paths[b-1].append(a-1)

  visited[0] = True
  print(dfs(0, paths, visited, N))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def dfs(node, paths, visited, n):
  # 全て訪問済みだったら全部を訪問できる経路として1を返す
  if not False in visited:
    return 1

  count = 0

  for nn in paths[node]:
    # 既に訪問済みなら処理をしない
    if(visited[nn]):
      continue

    visited[nn] = True
    count += dfs(nn, paths, visited, n)
    visited[nn] = False

  return count

def main():
  N, M = list(map(int, input().split()))
  paths = [[] for i in range(M)]
  visited = [False] * M

  for i in range(M):
    a, b = list(map(int, input().split()))
    paths[a-1].append(b-1)
    paths[b-1].append(a-1)

  visited[0] = True
  print(dfs(0, paths, visited, N))


if __name__ == "__main__":
    main()
Problem p02831 (python)

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

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

Fixed submission:
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)

pos = 0
for b, c in BC:
    end = (pos + b) if pos + b <= n else n
    for i in range(pos, end):
        if A[i] < c:
            A[i] = c
        else:
            break
    pos = i + 1
    if pos >= n:
        break

print(sum(A))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)
pos = 0
for b, c in BC:
    for i in range(pos, pos + b):
        if A[i] < c:
            A[i] = c
        else:
            break
    pos = i + 1
    if pos >= n:
        break

print(sum(A))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)

pos = 0
for b, c in BC:
    for i in range(pos, pos + b):
        if A[i] <= c:
            A[i] = c
        else:
            break
    pos = i + 1
    if pos >= n:
        break

print(sum(A))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)
pos = 0
for b, c in BC:
    for i in range(pos, pos + b):
        if A[i] <= c:
            A[i] = c
        else:
            break
    pos = i + 1

print(sum(A))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)
pos = 0
for b, c in BC:
    for i in range(pos, pos + b):
        if A[i] < c:
            A[i] = c
        else:
            break
    pos = i + 1

print(sum(A))
Problem p03705 (python)

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

ans = 0
if n >= 2 and a <= b:
    lst_min = a * (n - 1) + b
    lst_max = a + b * (n - 1)
    
    ans = lst_max - lst_min + 1

elif n == 1 and a == b:
    ans = 1

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations_with_replacement

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

ans = 0
if n >= 2 and a <= b:
    cmbs = combinations_with_replacement([i for i in range(a, b + 1)], n - 2)
    D = [sum([a] + list(c) + [b]) for c in cmbs]
    ans = len(set(D))
    
elif n == 1 and a == b:
    ans = 1

print(ans)
Problem p02659 (python)

Fixed submission:
import math
a,b = map(str, input().split())
a = int(a)
b = b.replace(".","")
if len(b) == 2:
    b = b + '0'
b = int(b)
ans = a*b
if len(str(ans)) <= 2:
    print(math.floor(ans/100))
else:
    print(int(str(ans)[:-2]))

Buggy submission (verdict: Runtime Error):
import math
a,b = map(str, input().split())
a = int(a)
b = b.replace(".","")
if len(b) == 2:
    b = b + '0'
b = int(b)
ans = a*b
if ans == 0:
    print(0)
else:
    print(int(str(ans)[:-2]))

Buggy submission (verdict: Runtime Error):
import math
a,b = map(str, input().split())
a = int(a)
b = b.replace(".","")
if len(b) == 2:
    b = b + '0'
b = int(b)
ans = a*b
print(int(str(ans)[:-2]))
Problem p03745 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 1
re = 0

for i in range(2,N,1):
    #print(re)
    if re == 0:
        if A[i-2] >= A[i-1] >= A[i]:
            re = 0
            if A[i-1] == A[i]:
                A[i-1] = A[i-2]
            
        elif A[i-2] <= A[i-1] <= A[i]:
            re = 0
            if A[i-1] == A[i]:
                A[i-1] = A[i-2]
            
        else:
            ans +=1
            re = 1
    else:
        re = 0



print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ans = 1
re = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        dire = '<'
        break
    if A[i+1] < A[i]:
        dire = '>'
        break
    else:
        dire = '='
if dire != '=':
    for i in range(2,N,1):
        #print()
        
        if re == 0:
            if dire == '>':

                if A[i] <= A[i-1] <= A[i-2]:
                    re = 0
                    dire =  '>'

                else:
                    ans += 1
                    re = 1
                    dire = '<'
            elif dire == '<':
                if A[i-2] <= A[i-1] <= A[i]:
                    re = 0
                    dire = '<'
                else:
                    ans += 1
                    dire = '>'
                    re = 1
        else:
            re = 0

            



print(ans)
Problem p02623 (python)

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

ruiA = [0]
ruiB = [0]
for i in range(N):
    ruiA.append(ruiA[-1] + A[i])
for i in range(M):
    ruiB.append(ruiB[-1] + B[i])

MAX = 0
j = M

for i in range(N+1):
    if ruiA[i] > K:
        break
    while ruiA[i] + ruiB[j] > K:
        j -= 1
    MAX = max(MAX, i+j)

print(MAX)

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

ruiA = [0]
ruiB = [0]
for i in range(N):
    ruiA.append(ruiA[-1] + A[i])
for i in range(M):
    ruiB.append(ruiB[-1] + B[i])

MAX = 0
i = 0
for j in range(M, -1, -1):
    if ruiA[i] + ruiB[j] <= K:
        MAX = max(MAX, i+j)
        best = j
    break
    
for i in range(1, N+1):
    for j in range(best, -1, -1):
        if ruiA[i] + ruiB[j] <= K:
            MAX = max(MAX, i+j)
        break


print(MAX)
Problem p02771 (python)

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

hoge = {a, b, c}

if len(hoge) == 2:
  print("Yes")
else:
  print("No")

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

hoge = {a, b, c}

if len(hoge) == 2:
  print(Yes)
else:
  print(No)
Problem p02773 (python)

Fixed submission:
N = int(input())
S = [input() for x in range(N)]
S.sort()

T = [[S[0]]]
for i in S[1:N]:
  if i == T[-1][-1]:
    T[-1].append(i)
  else:
    T.append([i])
T.sort(key=lambda x: len(x))
U = []

for i in T[::-1]:
  if len(i) == len(T[-1]):
    U.append(i[0])
  else:
    break

U.sort()
for x in U:
  print(x)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for x in range(N)]
S.sort()

T = [[S[0]]]
for i in S[1:N]:
  if i == T[-1][-1]:
    T[-1].append(i)
  else:
    T.append([i])
T.sort(key=lambda x: len(x))
U = []

U.append(T[-1][0])
c = -2
while len(T[-1]) == len(T[c]):
  U.append(T[c][0])
  c -= 1
  
U.sort()
for x in U:
  print(x)
Problem p03250 (python)

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

ans = A + B + C + 9 * max(A, B, C)

print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C = list(map(int, input().split()))
li = [A,B,C].sort()
ans = sum(li[:2]) + li[2] * 10

print(ans)
Problem p03252 (python)

Fixed submission:
from collections import Counter

S = list(input())
T = list(input())

Scount = Counter(S).values()
Tcount = Counter(T).values()



if sorted(Scount) == sorted(Tcount):
    ans = 'Yes' 
else:
    ans = 'No'

print(ans)

Buggy submission (verdict: Runtime Error):
from collctions import Counter

S = list(input())
T = list(input())

Scount = Counter(S).values()
Tcount = Counter(T).values()



if sorted(Scount) == sorted(Tcount):
    ans = 'Yes' 
else:
    ans = 'No'

print(ans)
Problem p03803 (python)

Fixed submission:
A, B = list(map(int, input().split()))
if A == B:
    ans = 'Draw'
elif A == 1:
    ans = 'Alice'
elif B == 1:
    ans = 'Bob'
else:
    ans = 'Alice' if A > B else 'Bob'

print(ans)

Buggy submission (verdict: Runtime Error):
A. B = list(map(int, input().split()))
if A == B:
    ans = 'Draw'
elif A == 1:
    ans = 'Alice'
elif B == 1:
    ans = 'Bob'
else:
    ans = 'Alice' if A > B else 'Bob'

print(ans)
Problem p02831 (python)

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

g = a*b/fractions.gcd(a,b)
print(int(g))

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

g = a*b/math.gcd(a,b)
print(g)
Problem p02847 (python)

Fixed submission:
s = input()
 
all_ = ['SUN','MON','TUE','WED','THU','FRI','SAT']
 
 
for i in range(7):
    if all_[i] == s:
        break
        
print(7-i)

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

all = ['SUN','MON','TUE','WED','THU','FRI','SAT']


for i range(7):
	if all[i] == s:
		c = i
        
print(7-i)
Problem p02891 (python)

Fixed submission:
import copy
S = list(input())
K = int(input())


a = S[0]
c = 0
S2 = copy.deepcopy(S)
for i in range(1, len(S)):
    if S2[i] == S2[i-1]:
        S2[i] = '1'
        c += 1

a = S[-1]
last = 0
for i in range(2, len(S)+1):
    last += 1
    if S[-i] != a:
        break

if all([e == S[0] for e in S[1:]]) == True:
    if len(S)%2==0:
        print(int(len(S)/2*K))
    else:
        print(int(len(S)//2*((K+1)//2)+(len(S)//2+1)*(K//2)))
elif S[0] == S[-1] and last % 2 == 1:
    c3 = 0
    S3 = copy.deepcopy(S)
    for i in range(2, len(S)):
        if S3[i] == S3[i-1]:
            S3[i] = '1'
            c3 += 1
    print(c + (c3+1)*(K-1))
else:
    print(c*K)

Buggy submission (verdict: Runtime Error):
import copy
S = list(input())
K = int(input())


a = S[0]
c = 0
S2 = copy.deepcopy(S)
for i in range(1,len(S)):
    if S[i] == S[i-1]:
        S[i] = '1'
        c += 1
if S[0] == S[-1]:
    c3 = 0
    S3 = copy.deepcopy(S)
    for i in range(2,len(S)+1):
        if S3[i] == S3[i-1]:
            S3[i] = '1'
            c3 += 1
    print(c + c3*(K-1))
else:
    print(c*K)

Buggy submission (verdict: Runtime Error):
import copy
S = list(input())
K = int(input())


a = S[0]
c = 0
S2 = copy.copy(S)
for i in range(1,len(S)):
    if S[i] == S[i-1]:
        S[i] = '1'
        c += 1
if S[0] == S[-1]:
    c3 = 0
    S3 = copy.copy(S)
    for i in range(2,len(S)+1):
        if S3[i] == S3[i-1]:
            S3[i] = '1'
            c3 += 1
    print(c + c3*(K-1))
else:
    print(c*K)