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

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

a=[]
b=[]
c=[]
d=[]

max_= 0

def dfs(A):
  global max_
  ans = 0
  last = A[-1]
  if len(A) == n+1:
    for i in range(q):
      if A[b[i]]-A[a[i]] == c[i]:
        ans += d[i]
    max_ = max(max_, ans)
    return
  for i in range(last, m+1):
    dfs(A+[i])  


for i in range(q):
  aa,bb,cc,dd = map(int, input().split())
  a.append(aa)
  b.append(bb)
  c.append(cc)
  d.append(dd)
  
dfs([1])

print(max_)

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

a=[]
b=[]
c=[]
d=[]

max_= 0

def dfs(A):
  global max_
  ans = 0
  last = A[-1]
  if len(A) == n+1:
    for i in range(n):
      if A[b[i]]-A[a[i]] == c[i]:
        ans += d[i]
    max_ = max(max_, ans)
    return
  for i in range(last, m+1):
    dfs(A+[i])  


for i in range(q):
  aa,bb,cc,dd = map(int, input().split())
  a.append(aa)
  b.append(bb)
  c.append(cc)
  d.append(dd)
  
dfs([1])

print(max_)

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

a=[]
b=[]
c=[]
d=[]

max_= 0

def dfs(A):
  global max_
  ans = 0
  last = A[-1]
  if len(A) == n+1:
    for i in range(n):
      if A[b[i]]-A[a[i]] == c[i]:
        ans += d[i]
    max_ = max(max_, ans)
    return
  for i in range(last, m+1):
    dfs(A+[i])  


for i in range(q):
  aa,bb,cc,dd = map(int, input().split())
  a.append(aa)
  b.append(bb)
  c.append(cc)
  d.append(dd)
  
dfs([1])

print(max_)
Problem p02819 (python)

Fixed submission:
import math

x = int(input())

def is_prime(n):
  for i in range(2, int(math.sqrt(n))):
    if(n%i==0):
      return False
  return True

for i in range(x, x+100):
  if is_prime(i):
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
import math

x = int(input())

def is_prime(n):
  for i in range(int(math.sqrt(n))):
    if(n%i==0):
      return False
  return True

for i in range(x, x+100):
  if is_prime(i):
    print(i)
    exit()

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

if(a<k):
  k -= a
  a = 0
else:
  tmp = k
  k -= a
  a -= tmp
  
if(b<k):
  b = 0
else:
  b -= k

print("{0} {1}".format(a,b))
Problem p02623 (python)

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

Asums = [0] * (N + 1)
for i, a in enumerate(A):
    Asums[i+1] = Asums[i] + a

Bsums = [0] * (M + 1)
for i, b in enumerate(B):
    Bsums[i+1] = Bsums[i] + b

ans = 0
for anum in range(N + 1):
    t = Asums[anum]
    if K < t:
        break
    bnum = bisect.bisect_right(Bsums, K - t) - 1
    ans = max(ans, anum + bnum)
print(ans)

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

t = 0
anum = 0
for a in A:
    if K < t + a:
        break
    t += a
    anum += 1

bnum = 0
for b in B:
    if K < t + b:
        break
    t + b
    bnum += 1

ans = anum + bnum

for i in range(bnum, M):
    while K < t + B[i]:
        t -= A[anum-1]
        anum -= 1
    t += B[i]
    bnum += 1
    ans = max(ans, anum + bnum)

print(ans)

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.reverse()
B.reverse()

ans = 0
total_time = 0
while A or B:
    if not A:
        t = B.pop()
    elif not B:
        t = A.pop()
    else:
        if A[-1] < B[-1]:
            t = A.pop()
        elif B[-1] < A[-1]:
            t = B.pop()
        else:
            if A[-2] < B[-2]:
                t = A.pop()
            else:
                t = B.pop()
    total_time += t
    if total_time <= K:
        ans += 1
    else:
        break
print(ans)
Problem p02836 (python)

Fixed submission:
S = input()
ans = 0
for i in range(len(S) // 2):
    if S[i] != S[-1-i]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
ans = 0
for i in range(len(S) // 2):
    if S[i] != S[-1-i]:
        ans += 1
print(ans)
Problem p03013 (python)

Fixed submission:
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
ans = 0
if N == 1:
    ans = 1
else:
    counts = [0] * (N + 1)
    if ok[1]:
        counts[1] = 1
    if ok[2]:
        counts[2] = counts[1] + 1
    for s in range(3, N + 1):
        if ok[s]:
            count = counts[s-1] + counts[s-2]
            count %= 1000000007
            counts[s] = count
    ans = counts[N]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False

dp = [0] * (N + 1)
if ok[1]:
    dp[1] = 1
if ok[2]:
    dp[2] = 2
for s in range(3, N + 1):
    if ok[s]:
        dp[s] = dp[s-1] + dp[s-2]
        dp[s] %= 1000000007
    else:
        dp[s] = 0

print(dp[N])

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False

dp = [0] * (N + 1)
dp[1] = 1
dp[2] = 2
for s in range(3, N + 1):
    if ok[s]:
        dp[s] = dp[s-1] + dp[s-2]
        dp[s] %= 1000000007
    else:
        dp[s] = 0

print(dp[N])

Buggy submission (verdict: Runtime Error):
import sys
from functools import lru_cache
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
sys.setrecursionlimit(N + 10000)
@lru_cache(maxsize=None)
def f(s):
    if not ok[s]:
        return 0
    if s in (0, 1, 2):
        return s
    count = f(s - 1) + f(s - 2)
    count %= 1000000007
    return count

ans = f(N)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from functools import lru_cache
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
sys.setrecursionlimit(N + 100)
@lru_cache(maxsize=None)
def f(s):
    if not ok[s]:
        return 0
    if s in (0, 1, 2):
        return s
    count = f(s - 1) + f(s - 2)
    count %= 1000000007
    return count

ans = f(N)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from functools import lru_cache
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False

@lru_cache(maxsize=None)
def f(s):
    if not ok[s]:
        return 0
    if s in (0, 1, 2):
        return s
    count = f(s - 1) + f(s - 2)
    count %= 1000000007
    return count

ans = f(N)
print(ans)
Problem p02571 (python)

Fixed submission:
s = input()
t = input()
if t in s:
    print(0)
else:
    ans = len(t)
    for i in range(len(s) - len(t) + 1):
        cnt = 0
        k = i
        l = 0
        while l < len(t) and k < len(s):
            if s[k] != t[l]:
                cnt += 1 
            k += 1
            l += 1    
        ans = min(ans, cnt)
    print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
if t in s:
    print(0)
else:
    ans = len(t)
    for i in range(len(t)):
        for j in range(len(s)):
            if t[i] == s[j]:
                if ((len(t) - i) <= (len(s) - j)) and i <= j:
                    k = i + 1
                    l = j + 1
                    cnt1 = 0
                    while k < len(t):
                        if t[k] != s[l]:
                            cnt1 += 1
                        k += 1
                        l += 1
                    k = i - 1
                    l = j - 1
                    cnt2 = 0
                    while k >= 0:
                        if t[k] != s[l]:
                            cnt2 += 1
                        k -= 1
                        l -= 1
                    ans = min(ans, cnt1 + cnt2)  
                else:
                  if (len(t) - i) > (len(s) - j)):
                    break
               
    print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
if t in s:
  print(0)
else:
  ans = 1000
  for i in range(len(t)):
    for j in range(len(s)):
      if t[i] == s[j]:
        if len(t) - i >= len(s) - j and i <= j:
        	k = i
        	l = j
            cnt1 = 0
            while k < len(t):
            	if t[k] != s[l]:
                  cnt1 += 1
                k += 1
                l += 1
            k = i
        	l = j
            cnt2 = 0
            while k >= 0:
            	if t[k] != s[l]:
                  cnt2 += 1
                k -= 1
                l -= 1
            ans = min(ans, cnt1 + cnt2)    
        else:
          break
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
if t in s:
  print(0)
else:
  ans = 1000
  for i in range(len(t)):
    for j in range(len(s)):
      if t[i] == s[j]:
        k = i
        l = j
        while k < len(t):
          if t[k] != s[l]:
            break
          k += 1
          l += 1
        ans = min(ans, len(t) - k)

print(ans)
Problem p02881 (python)

Fixed submission:
n = int(input())
 
s = list()
for i in range(1, int(n**0.5 + 1)):
    if n % i == 0:
        s.append(int(i + n/i))
print(min(s)-2)

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

s = list()
for i in range(1, int(n**0.5 + 1)):
    if n % i == 0:
        s.append(int(i + n/i))
print(min(s)-2
Problem p03137 (python)

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

ans = 0
if n < m:
    xli.sort()
    wli = list()
    for i in range(len(xli)-1):
        wli.append(xli[i+1]-xli[i])
    sortWli = list(reversed(sorted(wli)))
    su = 0
    for i in range(n-1):
        su += sortWli[i]
    ans = xli[-1] - xli[0] - su
print(ans)

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

ans = 0
if n < m:
    xli.sort()
    wli = list()
    for i in range(len(xli)-1):
        wli.append(xli[i+1]-xli[i])
    sortWli = list(reversed(sorted(wli)))
    su = 0
    for i in range(n-1):
        su += sortWli[i]
    ans = xli[-1] - xli[0] - su
print(ans
Problem p02572 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]

sum1 = 0
sum2 = 0

for _ in a:
  sum1 += _
  sum2 += (_*_)
sum1 = (sum1 * sum1)
print(((sum1 - sum2)//2)%1000000007)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

sum1 = 0
sum2 = 0

for _ in a:
  sum1 += _
  sum2 += (a*a)
sum1 = (sum1 * sum1)
print(sum1 - sum2)
Problem p02571 (python)

Fixed submission:
s = input()
t = input()

result = []
for i in range(len(s)-len(t)+1):
    tmp = 0
    for j in range(i,len(t)+i):
        if s[j] == t[j-i]:

            tmp += 1
    result.append(tmp)

print(len(t)-max(result))

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

result = []
for i in range(len(s)-len(t)):
    tmp = 0
    for j in range(i,len(t)+i):
        if s[j] == t[j-i]:

            tmp += 1
    result.append(tmp)

print(len(t)-max(result))
Problem p02624 (python)

Fixed submission:
#D
n = int(input())

ans = 0
for i in range(1,n+1):
    tmp = n // i
    ans += tmp * (i + n//i * i) // 2
    
print(ans)

Buggy submission (verdict: Runtime Error):
#D
import sys
sys.setrecursionlimit(10**7)
import sympy
n = int(input())

from functools import lru_cache

@lru_cache(maxsize=None)
def s(n,gokei):
    if n == 1:
        return gokei+1
    out = len(sympy.divisors(n))*n
    gokei += out
    return s(n-1,gokei)

print(s(n,0))

Buggy submission (verdict: Runtime Error):
#D
import sympy
n = int(input())

from functools import lru_cache

@lru_cache
def s(n,gokei):
    if n == 1:
        return gokei+1
    out = len(sympy.divisors(n))*n
    gokei += out
    return s(n-1,gokei)

print(s(n,0))
Problem p02629 (python)

Fixed submission:
n = int(input())
ans = ""
while n > 0:
    n -= 1
    ans += chr(ord('a') + n%26)
    #print(ans)
    n = n // 26
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
#C
import bisect
alphabet = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
cnt = 0
amari = []

#下処理
niroku = [1]
for i in range(1,15):
    a = niroku[-1]
    niroku.append(a + 26**i)

idx = bisect.bisect_left(niroku, n)

n = n - niroku[idx-1] + 1
z_cnt = idx-1
#print(n)
while n // 26 > 0:
    n_before = n
    amari.append(str(n%26))
    a = n % 26
    n = n // 26
    cnt += 1
#print(a)
#print(n)
#print(cnt)

if int("".join(amari)) != 0: 
    amari.append(str(n))
amari.reverse()
#print(amari)
result = []

for i in range(len(amari)):
    result.append(alphabet[int(amari[i])-1])

for i in range(z_cnt):
    result[i] = "z"

print("".join(result))
Problem p02659 (python)

Fixed submission:
#C
from decimal import *
import math
a,b = map(Decimal,input().split())

print(math.floor(a*b))

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

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

def lcm(a,b):
    import math
    return (a*b) // fractions.gcd(a,b)

print(lcm(a,b))

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

def lcm(a,b):
    return (a*b)//math.gcd(a,b)

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

Fixed submission:
#D
n,k = map(int,input().split())

MOD = 10 ** 9 + 7

from operator import mul
from functools import reduce

def nCr(n,r):
    if n < r:
        return 0
    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 % MOD



for i in range(1,k+1):
    a1 = nCr(n-k+1,i)
    a2 = nCr(k-1,i-1)
    print(a1*a2 % MOD)

Buggy submission (verdict: Runtime Error):
#D
n,k = map(int,input().split())

MOD = 10 ** 9 + 7

from operator import mul
from functools import reduce

def nCr(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 % MOD



for i in range(1,k+1):
    a1 = nCr(n-k+1,i)
    if i > 1:
        a2 = nCr(k-1,i-1)
    else:
        a2 = 1
    print(a1*a2 % MOD)

Buggy submission (verdict: Runtime Error):
#D
n,k = map(int,input().split())

MOD = 10 ** 9 + 7

from operator import mul
from functools import reduce

def nCr(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



for i in range(1,k+1):
    a1 = nCr(n-k+1,i)
    if i > 1:
        a2 = nCr(k-1,i-1)
    else:
        a2 = 1
    print(a1*a2 % MOD)
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for _ in range(m)])
MOD = 1000000007
dp = [0] * (n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0
    
for i in range(2,n+1):
    if i in a:
        continue
        
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= MOD
        
print(dp[n])

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

dp = [0] * (n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0
    
for i in range(2,n+1):
    if i in a:
        pass
    else:
        dp[i] = dp[i-1] + dp[i-2]
        
print(dp[n]%MOD)

Buggy submission (verdict: Runtime Error):
#### C
from functools import reduce
from operator import mul
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
MOD = 10 ** 9 + 7
def fib(n):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return fib(n-1) + fib(n-2)
   
a.append(n+1)
cnt = []
prev = 0
for i in a:
    tmp = fib(i+1-prev)
    cnt.append(tmp)
    prev = i+1
    
print(reduce(mul,cnt)%MOD)
Problem p03038 (python)

Fixed submission:
#D
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = []
for i in range(m):
    b,c = map(int,input().split())
    bc.append((b,c))
bc.sort(key=lambda x:-x[1])
heapq.heapify(a)
for i in range(m):
    b,c = bc[i][0],bc[i][1]
    for j in range(b):
        p = heapq.heappop(a)
        if c > p:
            heapq.heappush(a,c)
        else:
            heapq.heappush(a,p)
            break
            
            
print(sum(a))

Buggy submission (verdict: Runtime Error):
#D
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
heapq.heapify(a)
tmp = 0
for i in range(m):
    b,c = map(int,input().split())
    for j in range(b):
        if c >= tmp
            p = heapq.heappop(a)
            if c > p:
                heapq.heappush(a,c)
            else:
                heapq.heappush(a,p)
                tmp = p
                break
            
        tmp = p
            
print(sum(a))

Buggy submission (verdict: Runtime Error):
#D
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
heapq.heapify(a)
tmp = 0
for i in range(m):
    b,c = map(int,input().split())
    for j in range(b):
        if c >= tmp
            p = heapq.heappop(a)
            if c > p:
                heapq.heappush(a,c)
            else:
                heapq.heappush(a,p)
                tmp = p
                break
            
            tmp = p
            
print(sum(a))
Problem p03053 (python)

Fixed submission:
from collections import deque

H, W = map(int, input().split())
grid = [input() for i in range(H)]

# 初期の黒('#')の位置からの距離
dist = [[-1]*W for _ in range(H)]

# '#'の位置をキューに追加（＝今回はこれが複数あるので、複数スタートとなる）
black_cells = deque()
for h in range(H):
    for w in range(W):
        if grid[h][w] == '#':
            black_cells.append((h, w))
            dist[h][w] = 0

def bfs(black_cells, dist):
    """
    BFSを用いて、全マス目を黒くする回数を求める

    Args:
        black_cells: 「開始時の黒マス」の座標が入ったキュー（複数座標あり）
        dist: 「開始時の黒マス」からの距離の入ったリスト  [[-1, -1, 0], ...]
        　　　（白マスの初期値は0）

    Returns:
        g: 操作を繰り返した数
    """
    d = 0
    while black_cells:
        # キューとして使うのでpop()ではなくpopleft()
        h, w = black_cells.popleft()
        d = dist[h][w]
        for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:  # セルが白('.')であるのと同義
                dist[new_h][new_w] = d+1
                black_cells.append((new_h, new_w))
    return d

d = bfs(black_cells, dist)
print(d)

Buggy submission (verdict: Runtime Error):
#AGC033-A-Darker and Darker
from collections import deque

h,w = map(int,input().split())
grid = [input() for i in range(h)]

#初期の黒('#')の位置からの距離
dist = [[-1]*w for _ in range(h)]

p = deque()
d = 0
for i in range(h):
    for j in range(w):
        if grid[i][j] == '#':
            p.append((i,j))
            dist[i][j] = 0

while p:
    x,y = p.popleft()
    d = dist[y][x]
    for dy,dx in ((1,0),(0,1),(-1,0),(0,-1)):
        if 0<= x+dx < w and 0<= y+dy < h and dist[y+dy][x+dx] == -1:
            dist[y+dy][x+dx] = d+1
            p.append((y+dy,x+dx))

    
print(d)

Buggy submission (verdict: Runtime Error):
#AGC033-A-Darker and Darker
from collections import deque

h,w = map(int,input().split())
grid = [input() for i in range(h)]

#初期の黒('#')の位置からの距離
dist = [[-1]*w for _ in range(h)]

p = deque()
p.append((0,0))
d = 0
for i in range(h):
    for j in range(w):
        if grid[i][j] == '#':
            p.append((i,j))
            dist[i][j] = 0

while p:
    x,y = p.pop()
    d = dist[x][y]
    for dx,dy in (1,0),(0,1),(-1,0),(0,-1):
        if 0<= x+dx < w and 0<= y+dy < h and dist[y+dy][x+dx] == -1:
            dist[y+dy][x+dx] = d+1
            p.appendleft((x+dx,y+dy))

#distの最大値を出力
m = []
for i in range(h):
    m.append(max(dist[i]))
    
print(max(m))
Problem p03017 (python)

Fixed submission:
import bisect,copy,heapq,itertools,string
from collections import *
from math import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, a, b, c, d = MAP()
s = 'a' + input()

flag = 0
for i in range(min(a,b)+1,max(c,d)):
        if (a < i < c or b < i < d) and s[i] == s[i-1] == '#':
                print("No")
                exit()       
        elif max(a,b) <= i <= min(c,d) and s[i-1] == s[i] == s[i+1] == '.':
                flag = 1

if c > d and flag == 0:
        print("No")
else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
import bisect,copy,heapq,itertools,string
from collections import *
from math import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, a, b, c, d = MAP()
s = input()

flag = 0
for i in range(min(a,b)+1,max(c,d)):
        if (a < i < c or b < i < d) and s[i] == s[i-1] == '#':
                print("No")
                exit()       
        elif max(a,b) <= i <= min(c,d) and s[i-1] == s[i] == s[i+1] == '.':
                flag = 1

if c > d and flag == 0:
        print("No")
else:
        print("Yes")
Problem p02659 (python)

Fixed submission:
a,b = input().split()
a = int(a)
b = b[:-3] + b[-2:]
b = int(b)
print(a*b//100)

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

Fixed submission:
words = list(input())
if words[2] == words[3] and words[4]== words[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
words = list(input())
if words[3] == words[4] and words[5]== words[6]:
    print("Yes")
else:
    print("No")
Problem p02753 (python)

Fixed submission:
S = list(input())
if S[0] == S[1] == S[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S = list(input())
if S[0] == S[1] == S[2]:
  print("Yes)
else:
  print("No")
Problem p02773 (python)

Fixed submission:
N = int(input())
dic = {}
for i in range(1,N+1):
    key = input()
    if key not in dic:
        dic[key] = 1
    else:
        dic[key] += 1
lis = []
for key,val in dic.items():
    lis.append([val,key])
lis.sort(reverse = True)

lis2 = []
fnum = lis[0][0]

for j in range(0,len(lis)): 
    if lis[j][0] == fnum:
        lis2.append(lis[j][1])
    else:
        break
lis2.sort()
for k in lis2:
    print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
dic = {}
for i in range(1,N+1):
    key = input()
    if key not in dic:
        dic[key] = 1
    else:
        dic[key] += 1
lis = []
for key,val in dic.items():
    lis.append([val,key])
lis.sort(reverse = True)

lis2 = []
fnum = lis[0][0]
j = 0
while lis[j][0] == fnum:
    lis2.append(lis[j][1])
    j += 1
lis2.sort()
for k in lis2:
    print(k)
Problem p02777 (python)

Fixed submission:
S,T = input().split()
A,B = map(int,input().split())
U = input()
if U == S:
        print(A-1,B)
else:
        print(A,B-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N+1):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")
Problem p02779 (python)

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
lis.sort()
judge = 0
for i in range(1,N):
    if lis[i-1] == lis[i]:
        judge = 1
if judge == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N+1):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")