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

Fixed submission:
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, K = map(int, input().split())

for i in range(1,K+1):
  if N-K+1 < i:
    print(0)
    continue
  blue = cmb(K-1, i-1)
  red = cmb(N-K+1, i)
  print((blue * red) % (10**9+7))

Buggy submission (verdict: Runtime Error):
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, K = map(int, input().split())

for i in range(1,K+1):
  blue = cmb(K-1, i-1)
  red = cmb(N-K+1, i)
  print((blue * red) % (10**9+7))
Problem p03013 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
L = set([int(input()) - 1 for _ in range(M)])
ans = [0] * N

if 0 not in L:
    ans[0] = 1
    
if N > 1 and 1 not in L:
    ans[1] = ans[0] + 1

for i in range(2, N):
    if i in L:
        continue
    
    if ans[i - 2] != 0 or ans[i - 1] != 0:
        ans[i] = ans[i - 2] + ans[i - 1]
        
print(ans[-1] % (1000000007))

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

N, M = map(int, input().split())
L = set([int(input()) - 1 for _ in range(M)])
ans = [0] * N

if 0 not in L:
    ans[0] = 1
    
if 1 not in L:
    ans[1] = ans[0] + 1

for i in range(2, N):
    if i in L:
        continue
    
    if ans[i - 2] != 0 or ans[i - 1] != 0:
        ans[i] = ans[i - 2] + ans[i - 1]
        
print(ans[-1] % (1000000007))
Problem p03107 (python)

Fixed submission:
import sys
input = sys.stdin.readline

s = list(input())
l = {
    "0": 0,
    "1": 0,
}

for v in s:
    if l.get(v):
        l[v] += 1
    else:
        l[v] = 1
        
print(min(l["0"], l["1"]) * 2)

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

s = list(input())
l = {}

for v in s:
    if l.get(v):
        l[v] += 1
    else:
        l[v] = 1
        
print(min(l["0"], l["1"]) * 2)

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

s = list(input().replace("¥n", ""))
l = {
    "0": 0,
    "1": 0
}

for v in s:
    l[v] += 1
        
print(min(l["0"], l["1"]) * 2)
Problem p02659 (python)

Fixed submission:
import math
from decimal import Decimal
num = list(map(str,input().split(" ")))
print(math.floor(Decimal(num[1]) * Decimal(num[0])))

Buggy submission (verdict: Runtime Error):
a = float(input())
b = float(input())
print(int(a*(b*100))/100)
Problem p02689 (python)

Fixed submission:
import collections

def solve(height, road):
    graph = collections.defaultdict(set)
    for a, b in road:
        graph[a].add(b)
        graph[b].add(a)
    ans = 0
    no_good = set()
    for k in graph:
        for nei in graph[k]:
            if height[nei-1] >= height[k-1]:
                no_good.add(k)
    return len(height) -  len(no_good)

obs, k = map(int, input().split())
height = list(map(int, input().split()))
road = []
for _ in range(k):
    r = list(map(int, input().split()))
    road.append(r)
print(solve(height, road))

Buggy submission (verdict: Runtime Error):
def solve(height, road):
    graph = collections.defaultdict(set)
    for a, b in road:
        graph[a].add(b)
        graph[b].add(a)
    ans = 0
    no_good = set()
    for k in graph:
        for nei in graph[k]:
            if height[nei-1] >= height[k-1]:
                no_good.add(k)
    return len(height) -  len(no_good)

obs, k = map(int, input().split())
height = list(map(int, input().split()))
road = []
for _ in range(k):
    r = list(map(int, input().split()))
    road.append(r)
print(solve(height, road))
Problem p02951 (python)

Fixed submission:
a, b, c = [int(x) for x in input().strip().split()]

water = c - (a - b)
if water < 0:
    print(0)
else:
    print(water)

Buggy submission (verdict: Runtime Error):
a, b, c = input().splita, b, c = [int(x) for x in input().strip().split()]

water = c - (a - b)
if water < 0:
    print(0)
else:
    print(water)
Problem p02970 (python)

Fixed submission:
import math

nd = [int(x) for x in input().strip().split()]
n = nd[0]
d = nd[1]

inspectors = math.ceil(n / (2 * d + 1))
print(inspectors)

Buggy submission (verdict: Runtime Error):
import math

nd = input().strip().split()
n = nd[0]
d = nd[1]

inspectors = math.ceil(n / (2 * d + 1))
print(inspectors)
Problem p02753 (python)

Fixed submission:
s = str(input())

def solve():
    if s =="AAA" or s == "BBB":
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    solve()

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

NumberOfRotations = int(n/(a+b))
surplus = n%(a+b)

ans = 0

if NumberOfRotations == 0:
    if a > n:
        print(surplus)
        exit
    else:
        print(a)
        exit

ans = a*NumberOfRotations
if a > n - ((a+b)*NumberOfRotations):
    print(ans+surplus)
else:
    print(ans+a)

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

NumberOfRotations = int(n/(a+b))
surplus = n%(a+b)

ans = 0

if NumberOfRotations == 0:
    if a > n:
        print(surplus)
    else:
        print(a)
else:
    ans = a*NumberOfRotations
    if a > n - ((a+b)*NumberOfRotations):
        print(ans+surplus)
    else:
        print(ans+a)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal


def main():
    A, B = map(Decimal, input().split())

    print(int(A*B))


if __name__ == "__main__":
    main()

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


def main():
    A, B = map(Decimalt,input().split())

    print(int(A*B))
    return

if __name__ == '__main__':
    main()

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

def main():
    x,y = map(Decimalt,input().split())
    print(int(x*y))

if __name__ == '__main__':
    main()

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

x,y = map(Decimalt,input().split())
print(int(x*y))
Problem p02948 (python)

Fixed submission:
N, M = map(int, input().split())
AB = [[] for _ in range(M + 10)]
ans = 0
for _ in range(N):
  a, b = map(int, input().split())
  if a > M:
    continue
  AB[a].append(b)
import heapq
reward = []
heapq.heapify(reward)
for i in range(1, M + 1):
  for item in AB[i]:
    heapq.heappush(reward, -item)
  if reward:
    ans -= heapq.heappop(reward)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
AB = [[] for _ in range(M + 10)]
ans = 0
for _ in range(N):
  a, b = map(int, input().split())
  if a > m:
    continue
  AB[a].append(b)
import heapq
reward = []
heapq.heapify(reward)
for i in range(1, M + 1):
  for item in AB[i]:
    heapq.heappush(reward, -item)
  if reward:
    ans -= heapq.heappop(reward)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split(' '))
AB = [[] for _ in range(M + 10)]
ans = 0
for _ in range(N):
  a, b = map(int, input().split())
  AB[a].append(b)
import heapq
reward = []
heapq.heapify(reward)
for i in range(1, M + 1):
  for item in AB[i]:
    heapq.heappush(reward, -item)
  if reward:
    ans -= heapq.heappop(reward)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split(' '))
AB = [[] for _ in range(N + 10)]
ans = 0
for _ in range(N):
  a, b = map(int, input().split())
  AB[a].append(b)
import heapq
reward = []
heapq.heapify(reward)
for i in range(1, M + 1):
  for item in AB[i]:
    heapq.heappush(reward, -item)
  if reward:
    ans -= heapq.heappop(reward)
print(ans)
Problem p02990 (python)

Fixed submission:
import math
def comb(n, r):
  if n - r < 0:
    return 0
  else:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
MOD = 10**9 + 7
N, K = map(int, input().split(' '))
red = N - K
for i in range(K):
  res = comb(red + 1, i + 1) * comb(K - 1, i)
  res %= MOD
  print(res)

Buggy submission (verdict: Runtime Error):
import math
MOD = 10**9 + 7
comb = lambda n, r: math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N, K = map(int, input().split(' '))
red = N - K
for i in range(K):
  res = comb(red + 1, i + 1) * comb(K - 1, i)
  res %= MOD
  print(res)
Problem p02781 (python)

Fixed submission:
N = int(input())
K = int(input())
 
def keta1(n):
    s = str(n)
    return (len(s) - 1) * 9 + int(s[0])
 
def keta2(n):
    if n < 10:
      return 0
    s = str(n)
    cnt = [0] * 101
    for i in range(2, 101):
        cnt[i] = 9 * 9 * (i - 1)
    res = 0
    for i in range(len(s)):
        res += cnt[i]
    res += (int(s[0]) - 1) * keta1(10 ** (len(s) - 1) - 1) + keta1(int(s[1:]))
    return res
 
def keta3(n):
    s = str(n)
    cnt = [0] * 101
    for i in range(3, 101):
        cnt[i] = 9 * 9 * 9 * (i - 1) * (i - 2) // 2
    res = 0
    for i in range(len(s)):
        res += cnt[i]
    res += (int(s[0]) - 1) * keta2(10 ** (len(s) - 1) - 1) + keta2(int(s[1:]))
    return res
 
if K == 1:
    print(keta1(N))
elif K == 2:
    print(keta2(N))
elif K == 3:
    print(keta3(N))

Buggy submission (verdict: Runtime Error):
def keta1(n):
    s = str(n)
    return (len(s) - 1) * 9 + int(s[0])
 
def keta2(n):
    if n < 10:
      return 0
    s = str(n)
    cnt = [0] * 101
    for i in range(2, 101):
        cnt[i] = 9 * 9 * (i - 1)
    res = 0
    for i in range(len(s)):
        res += cnt[i]
    res += (int(s[0]) - 1) * keta1(10 ** (len(s) - 1) - 1) + keta1(int(s[1:]))
    return res
 
def keta3(n):
    s = str(n)
    cnt = [0] * 101
    for i in range(3, 101):
        cnt[i] = 9 * 9 * 9 * (i - 1) * (i - 2) // 2
    res = 0
    for i in range(len(s)):
        res += cnt[i]
    res += (int(s[0]) - 1) * keta2(10 ** (len(s) - 1) - 1) + keta2(int(s[1:]))
    return res
 
if K == 1:
    print(keta1(N))
elif K == 2:
    print(keta2(N))
elif K == 3:
    print(keta3(N))
Problem p02833 (python)

Fixed submission:
N = int(input())
 
if N % 2 > 0 or N < 10:
  print(0)
  exit()
else:
  #S = str(N)[::-1]
  ans = 0
  N = N // 10
  for i in range(50):
    ans += N
    N = N // 5
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n % 2 == 1:
	print(0)
	exit()
 
# 5の倍数で割り切れる回数
result = 0
i = 1
while True:
	result += inp_n // ((5 ** i) * 2)
	i += 1
	if inp_n < ((5 ** i) * 2): break
 
# 結果出力
print(result)
Problem p02859 (python)

Fixed submission:
r=int(input())
print(r**2)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())

#nCr and Mod
def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
mod = 10 ** 9 + 7

if (X+Y)%3 != 0:
      print(0)
      exit()
 
n,x,y=0,X,Y
while x != y*2:
      x-=1
      y-=2
      n+=1
m=((X+Y)//3)-n

if n<0 or m<0:
    print(0)
    exit()

ans = nCr(n+m,n,mod)
print(ans)
Problem p02862 (python)

Fixed submission:
X,Y=map(int,input().split())

mod=10**9+7
def nCr(n, r, mod):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod

if (X+Y)%3 != 0:
      print(0)
      exit()
 
n=((2*X)-Y)//3

m=((X+Y)//3)-n

if n<0 or m<0:
    print(0)
    exit()

ans = nCr(n+m,n,mod)
print(ans)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())

mod=10**9+7
def nCr(n, r, mod):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod

if (X+Y)%3 != 0:
      print(0)
      exit()
 
x,y=X,Y
for i in range(0,x+1):
    if x==y*2 or (x==0 and y==0):
        n=i
        break
    else:
      x-=1
      y-=2

m=((X+Y)//3)-n

if n<0 or m<0:
    print(0)
    exit()

ans = nCr(n+m,n,mod)
print(ans)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())

mod=10**9+7
def nCr(n, r, mod):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod

if (X+Y)%3 != 0:
      print(0)
      exit()
 
x,y=X,Y
for i in range(x):
    if x==y*2:
        n=i
        break
    else:
      x-=1
      y-=2

m=((X+Y)//3)-n

if n<0 or m<0:
    print(0)
    exit()

ans = nCr(n+m,n,mod)
print(ans)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())

def cmb(nn, rr, mod):
    if ( rr<0 or rr>nn ):
        return 0
    rr = min(rr, nn-rr)
    return g1[nn] * g2[rr] * g2[nn-rr] % mod

if (X+Y)%3 != 0:
      print(0)
      exit()
 
if min(X,Y)*2<max(X,Y):
    print(0)
    exit()

n,x,y=0,X,Y
while x != y*2:
      x-=1
      y-=2
      n+=1
m=((X+Y)//3)-n

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = cmb(n+m,n,mod)
print(ans)

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())

if x==1 and y==2:
    print(1)
    exit()

c=0
while x>1 or y>1:
    if x==y*2:
        if c*y<10**9+7:
            L=[1]*y
            L[0]=0
            L2=[1]*y
            for i in range(c):
                L2[i+1]=L[i+1]+L2[i]
                print(L2[-1])
                exit()
        else:
            print(c*7%10**9+7)
            exit()
    x-=1
    y-=2
    c+=1
print(0)
Problem p02880 (python)

Fixed submission:
n=int(input())


for i in range(1,10):
      for j in range(1,10):
            if i*j==n:
                  print("Yes")
                  exit()
print("No")

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

flag=0
for i in range(1,10):
  if n%i==0:
    flag=1

if flag==1
  print("Yes")
else:
  print("No")
Problem p02933 (python)

Fixed submission:
a,s=int(input()),input()
print('red' if a<3200 else s)

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

if a<=3200:
  print('red')
  else:
    print(s)
Problem p02951 (python)

Fixed submission:
lis = list(map(int, input().split()))

if lis[2] - (lis[0] - lis[1]) > 0:
    print(lis[2] - (lis[0] - lis[1]))
else:
    print(0)

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

for i in range(N,1,-1):
    if lis_h[i - 1] < lis_h[i - 2]:
        lis_h[i - 2] -= 1
        if lis_h[i - 1] < lis_h[i - 2]:
            print("No")
            exit()
print("Yes")

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

for i in range(N,1,-1):
    if lis_h[i - 1] < lis_h[i - 2]:
        lis_h[i - 2] -= 1
        if lis_h[i - 1] < lis_h[i - 2]:
            print("No")
            exit()
print("Yes")

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

for i in range(N,1,-1):
    if lis_h[i - 1] < lis_h[i - 2]:
        lis_h[i - 2] += -1
        if lis_h[i - 1] < lis_h[i - 2]:
            print("No")
            exit()
print("Yes")
Problem p02959 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
for i in range(len(b)):
    c_i = 0
    c_i = min(a[i], b[i])
    c += c_i
    b[i] -= c_i
    c_i_1 = 0
    c_i_1 = min(a[i+1], b[i])
    c += c_i_1
    a[i+1] -= c_i_1
print(c)

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

c = 0
for i in range(n):
      ci = 0
      ci = min(a[i],b[i])
      c += ci
      b[i] -= ci
      ci1 = 0
      ci1 = min(a[i+1],b[i])
      c += ci1
      c[i+1] -= ci1

print(c)

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

ans = 0
for i in range(n):
      ans += min(L2[i],L1[i]+L1[i+1])
      L1[i+1] = max(0,L1[i+1] - max(0,(L2[i]-L1[i])))
print(c)
Problem p03012 (python)

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

accum = 0
ans = 10000
before = 10000
for i in range(n):
    accum += w[i]
    sa = abs(sum(w) - (accum*2))
    if sa < ans:
        ans = sa

print(ans)

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

m=[]
for i in range(1,n):
    m.append(sum(:i) - sum(i:))
print(min(m))
Problem p03013 (python)

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

ai=0
n1,n2=0,1
for i in range(1,n+1):
      if ai<m and i==A[ai]:
            ai+=1
            n1=n2
            n2=0
      else:
            tmp=n2
            n2=(n1+n2)%1000000007
            n1=tmp
print(n2)

Buggy submission (verdict: Runtime Error):
m = map(int, (input().split()))
a = {int(input()) for i in range(m)}
mod = 10 ** 9 + 7
 
x = 1 if 1 not in a else 0
dp = [1, x] + [0] * (n - 1)
 
for i in range(2, n + 1):
    if i in a:
        continue
    dp[i] = (dp[i - 1] + dp[i - 2])
 
print(dp[-1] % mod)
Problem p03036 (python)

Fixed submission:
r,d,x = map(int,input().split())

for i in range(10):
      ans = r*x-d
      print(ans)
      x = ans

Buggy submission (verdict: Runtime Error):
r,d,x=map(int,input().split())
print(x for _ in range(10) x=r*x-d)
Problem p03242 (python)

Fixed submission:
n=list(input())

for i in range(3):
      if n[i] == "1":
            n[i] = "9"
      elif n[i] == "9":
            n[i] = "1"

print("".join(n))

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

print(n.replace("1","x").replace("9","1"),replace("x","9"))
Problem p02831 (python)

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

for a in range(1,m+1):
    if (n*a)%m==0:
        print(n*a)
        exit()

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

import math

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

print(lcm(n,m))
Problem p03077 (python)

Fixed submission:

n=int(input())
l=[]
for i in range(5):
    l.append(int(input()))

m=min(l)

print(-(-n//int(m))+4)

Buggy submission (verdict: Runtime Error):

n=int(input())
l=[]
for i in range(5):
    l.append(int(input()))
#print(l)
m=min(l)
"print(m)

print(-(-n//int(m))+4)
Problem p02688 (python)

Fixed submission:
n,k=map(int,input().split())
ans=[1]*n
for i in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for i in range(d):
    ans[a[i]-1]=0
print(sum(ans))

Buggy submission (verdict: Runtime Error):
3 3
1
3
1
3
1
3
Problem p02753 (python)

Fixed submission:
# -*- coding: utf-8 -*-
#import math

# 整数の入力
station = input()

if(station[0] != station[1] or station[0] != station[2]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#import math

# 整数の入力
station = input()

if(station[0] != station[1] || station[0] != station[2]):
  print("No")
else:
  print("Yes")
Problem p02754 (python)

Fixed submission:
# -*- coding: utf-8 -*-

# 整数の入力
#a = int(input())

# スペース区切りの文字列の入力
st = input().split()
#商
div = int(st[0]) // (int(st[1]) + int(st[2]))
#余り
rem = int(st[0]) % (int(st[1]) + int(st[2]))

if(rem < int(st[1])):
  print(div * int(st[1]) + rem)
else:
  print(div * int(st[1]) + int(st[1]))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

# 整数の入力
#a = int(input())

# スペース区切りの文字列の入力
st = input().split()
#商
div = int(st[0]) // (int(st[1]) + int(st[2]))
#余り
rem = int(st[0]) % (int(st[1]) + int(st[2]))

if(rem < int(st[1])):
  print(div * int(st[1]) + rem)
else:
  print(div * int(st[1]) + st[1])
Problem p02777 (python)

Fixed submission:
# -*- coding: utf-8 -*-
#import math

# 整数の入力
#a = int(input())
# スペース区切りの文字列の入力
st = input().split()
st_list = []
st_list = [str(st) for st in st]

# スペース区切りの数値の入力
a, b = map(int, input().split())

# 文字列の入力
s = input()

# スペース区切りの文字列の入力
#a,b = map(input().split())

if(str(s) == st_list[0]):
  a = a-1
elif(str(s) == st_list[1]):
  b = b-1
# 出力

print(a,b)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

# 整数の入力
#a = int(input())
# スペース区切りの文字列の入力
st = input().split()
st_list = []
st_list = [int(st) for st in st]

# スペース区切りの数値の入力
a, b = map(int, input().split())

# 文字列の入力
s = input()

# スペース区切りの文字列の入力
#a,b = map(input().split())

if(str(s) == st_list[0]):
  a = a-1
elif(str(s) == st_list[1]):
  b = b-1
# 出力

print(a,b)
Problem p02790 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
#while True:
b, c = map(int, input().split())
#	if(b < 10 and c < 10):
#		break
# 文字列の入力
#s = input()
#連結
#aaa = str(b) + str(c)
#print(aaa)
aaa = ''
bbb = ''
for num in range(c):
	aaa += str(b)
	
for num in range(b):
	bbb += str(c)


#一桁取得
testa = aaa[0]
testb = bbb[0]

# 出力
if(testa < testb):
	print(aaa)
else:
	print(bbb)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
#s = input()
#連結
#aaa = str(b) + str(c)
#print(aaa)
aaa = ''
bbb = ''
for num in range(c):
	aaa += str(b)
	
for num in range(b):
	bbb += str(c)
#一桁目取得
testa = aaa[1]
testb = bbb[1]

# 出力
if(testa < testb):
	print(aaa)
else:
	print(bbb)
Problem p02629 (python)

Fixed submission:
N = int(input())
L = list("abcdefghijklmnopqrstuvwxyz")
a = 1
while N > 26**a:
    N = N - 26**a
    a += 1

pre = []
for i in reversed(range(1,a)):
    r = (N-1) // 26**i
    pre.append(r)
    N = int(N%(26**i))

ans = ''
for i in pre:
    ans += L[i]
print(ans+L[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list("abcdefghijklmnopqrstuvwxyz")
a = 1
while N > 26**a:
    N = N - 26**a
    a += 1

pre = []
for i in reversed(range(1,a)):
    r = N // 26**i
    pre.append(r)
    N = int(N%(26**i))

ans = ''
for i in pre:
    ans += L[i]
print(ans+L[N-1])
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(float, input().split()))
c = 1
for i in range(n):
    c = c * a[i]
print(float(c) / sum(a))
Problem p02629 (python)

Fixed submission:
# coding: utf-8
# Your code here!

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in range(12):
    c = (num-1) % 26
    ans += alf[c]
    num = (num-1) // 26
    if num < 1:
        break

print("".join(reversed(ans)))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in reversed(range(12)):
    if (num-num//26)//26**i >= 1:
        f = True

    if f:
        ans.append(alf[(num-i)//26**i-1])
        num = num % 26**i
print("".join(ans))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in reversed(range(12)):
    if (num-i*26)//26**i >= 1:
        f = True
    if f:
#            print((num-i)//26**i)
        ans.append(alf[(num-i)//26**i-1])
        num = num % 26**i
print("".join(ans))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

num = int(input())

qm = 1000000000000001

alf = [chr(i) for i in range(97, 97+26)]
#print(alf)

ans = []
f = False

for i in reversed(range(12)):
    if (num-i*26)//26**i >= 1:
        f = True
    if f:
#            print((num-i)//26**i)
        ans.append(alf[(num-i*26)//26**i-1])
        num = num % 26**i
print("".join(ans))