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

Fixed submission:
D, T, S = (int(d) for d in input().split())

if T * S >= D:
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
D, T, S = (int(d) for d in input().split())

if T * s >= D:
    print("Yes")

else:
    print("No")
Problem p02781 (python)

Fixed submission:

def factorial(a):
    r = 1
    for i in range(a):
        r *= i+1
    return r

def combinations(a, b):
    if a>=0 and b>=0 and a >= b:
        return pow(9, b) * factorial(a) // factorial(b) // factorial(a-b)
    else:
        return 0

def count(m, a, b):
    # return the count of numbers in range [0, m x 10^a] with b non zero digitals
    ## the count of numbers in range [0, m x 10^a) with b non zero digitals
    r = combinations(a-1, b) + (m-1) * combinations(a-1, b-1)
    if b == 1:
        ## m x 10^a
        r += 1
    return r

def COUNT(N,K):
    digit = list(map(int, str(N)))
    M = len(digit)
    C = count(digit[0], M, K)
    if len(digit) > 1:
        N_ = int("".join(map(str, digit[1:])))
    else:
        N_ = 0
    return C, N_
    

N = int(input())
K = int(input())

C = 0
while (N>0) and (K>0):
    c, N = COUNT(N, K)
    C+= c
    K-= 1

print(C)

Buggy submission (verdict: Runtime Error):
    r = 1
    for i in range(a):
        r *= i+1
    return r

def combinations(a, b):
    if a>=0 and b>=0 and a >= b:
        return pow(9, b) * factorial(a) // factorial(b) // factorial(a-b)
    else:
        return 0

def count(m, a, b):
    # return the count of numbers in range [0, m x 10^a] with b non zero digitals
    ## the count of numbers in range [0, m x 10^a) with b non zero digitals
    r = combinations(a-1, b) + (m-1) * combinations(a-1, b-1)
    if b == 1:
        ## m x 10^a
        r += 1
    return r

N = int(input())
K = int(input())

digit = list(map(int, str(N)))
M = len(digit)

C = 0
if M >= K:
    for i in range(K):
        C += count(digit[i], M-i, K-i)

print(C)

Buggy submission (verdict: Runtime Error):
def factorial(a):
    r = 1
    for i in range(a):
        r *= i+1
    return r

def combinations(a, b):
    if a>=0 and b>=0 and a >= b:
        return pow(9, b) * factorial(a) // factorial(b) // factorial(a-b)
    else:
        return 0

def count(m, a, b):
    # return the count of numbers in range [0, m x 10^a] with b non zero digitals
    ## the count of numbers in range [0, m x 10^a) with b non zero digitals
    r = combinations(a-1, b) + (m-1) * combinations(a-1, b-1)
    if b == 1:
        ## m x 10^a
        r += 1
    return r

N = int(input())
K = int(input())

digit = list(map(int, str(N)))
M = len(digit)

C = 0
for i in range(K):
    C += count(digit[i], M-i, K-i)

print(C)
Problem p02847 (python)

Fixed submission:
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WED":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]

Buggy submission (verdict: Runtime Error):

import numpy as np
N, K  = map(int, raw_input().split())
A = np.array(map(int, raw_input().split()))

A_cumsum = np.empty(N+1, dtype=int)
A_cumsum[0] = 0
A_cumsum[1:] = np.cumsum(A)
ans = 0
for i in xrange(1, K):
    seq_sum = A_cumsum[i:] - A_cumsum[:-i]
    ans += np.sum(seq_sum%K==1)
    
print ans

Buggy submission (verdict: Runtime Error):
A, B, X = map(int, raw_input().split())

def price(i, A, B):
    Dig = len(str(i))
    return A * i + B * Dig

l = 0
r = 10**9 + 1

while (r-l) > 1:
    c = (r+l)/2
    Pri = price(c, A, B)
    if Pri <= X:
        l = c
    else:
        r = c

print l

Buggy submission (verdict: Runtime Error):

A, B, X = map(int, raw_input().split())

def price(i, A, B):
    Dig = len(str(i))
    return A * i + B * Dig

l = 0
r = 10**9 + 1

while (r-l) > 1:
    c = (r+l)/2
    Pri = price(c, A, B)
    if Pri <= X:
        l = c
    else:
        r = c

Buggy submission (verdict: Runtime Error):
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WEN":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]
Problem p02873 (python)

Fixed submission:

S  = raw_input()
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)

Buggy submission (verdict: Runtime Error):

S  <>= raw_input()
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)

Buggy submission (verdict: Runtime Error):
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)
Problem p02897 (python)

Fixed submission:
N = int(raw_input())

P = 1.0*((N-1)/2 +1) / N
print "{:12.10f}".format(P)

Buggy submission (verdict: Runtime Error):
A, B = map(int, raw_input().split())

divisor = []

for i in xrange(2, min(A,B)):
    if A % i == 0 and B % i == 0:
        divisor.append(i)
        A /= i
        B /= i
        while (A%i == 0) or (B%i == 0):
            A /= i
            B /= i
    
print len(divisor)+1
Problem p02954 (python)

Fixed submission:
S = raw_input()
N = len(S)

ans = [0 for _ in xrange(N)]
for i in xrange(0,N-1):
    if S[i] == "R" and S[i+1] == "L":
        # Positon of "RL"
        ans[i] = 1
        ans[i+1] = 1
        # Search the Left wind
        j = 1
        while (i-j) >=0 and S[i-j] == "R":
            if j %2 == 1:
                ans[i+1] += 1
            else:
                ans[i] += 1
            j += 1
        # Search the right wind
        j = 2
        while (i+j) <N and S[i+j] == "L":
            if j %2 == 1:
                ans[i+1] += 1
            else:
                ans[i] += 1
            j += 1
        
print " ".join([str(i) for i in ans])

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

S = raw_input()
N = len(S)
T = np.zeros([N,N], dtype=bool)
for i in xrange(0, N):
    if (i-1)>=0 and S[i-1] == "R":
        T[i, i-1] = True
    if (i+1) <N and S[i+1] == "L":
        T[i, i+1] = True
    
Even = np.ones(N, dtype=int) # Last even times status
Stat = np.ones(N, dtype=int) # Current status

for i in xrange(1, 1000):
    Stat = np.dot(T, Stat)
    if i % 2 == 0:
        if np.all(Stat == Even):
            break
        else:
            Even = Stat

print " ".join([str(i) for i in Stat])
Problem p03045 (python)

Fixed submission:
'''input
100000 1
1 100000 100
'''
import sys
sys.setrecursionlimit(100100)
N, M = [int(x) for x in input().split()]

vien = [[] for _ in range(N)]

for _ in range(M):
	a, b, w = [int(x) for x in input().split()]
	a -= 1
	b -= 1
	w = w & 1
	vien[a].append(b)
	vien[b].append(a)

been = [False]*N
ats = 0
def dfs(x):
	been[x] = True
	for u in vien[x]:
		if not been[u]:
			dfs(u)


for i in range(N):
	if been[i]: continue

	ats += 1
	dfs(i)

print(ats)

Buggy submission (verdict: Runtime Error):
'''input
100000 1
1 100000 100
'''

N, M = [int(x) for x in input().split()]

vien = [[] for _ in range(N)]

for _ in range(M):
	a, b, w = [int(x) for x in input().split()]
	a -= 1
	b -= 1
	w = w & 1
	vien[a].append(b)
	vien[b].append(a)

been = [False]*N
ats = 0
def dfs(x):
	been[x] = True
	for u in vien[x]:
		if not been[u]:
			dfs(u)


for i in range(N):
	if been[i]: continue

	ats += 1
	dfs(i)

print(ats)
Problem p02624 (python)

Fixed submission:
N = int(input())
ans = 0

for i in range(1, N+1):
    j = N // i
    ans += int(j * (j+1) * i / 2)
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

def divisors_count(n):
    #lower_divisors , upper_divisors = [], []
    i = 1
    c = 0
    while i*i <= n:
        if n % i == 0:
            #lower_divisors.append(i)
            c += 1
            if i != n // i:
                #upper_divisors.append(n//i)
                c += 1
        i += 1
    #return lower_divisors + upper_divisors[::-1]
    return c

N = int(input())
ans = 0
for i in range(1, N+1):
    ans += i * divisors_count(i)
print(ans)
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if w >= s:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
s, w = map(int, input())
if w >= s:
    print('unsafe')
else:
    print('safe')
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
print(n*(n-1)//2 + m*(m-1)//2)

Buggy submission (verdict: Runtime Error):
import math
def combinations(n ,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
n, m = map(int, input().split())
print(combinations(n, 2) + combinations(m , 2))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

n, m = map(int, input().split())
print(comb(n, 2, exact=True) + comb(m , 2, exact=True))
Problem p02659 (python)

Fixed submission:
from decimal import *

a,b = map(Decimal,input().split())

print(int(a*b))

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

a = int(a)
b = int(b *100)
c = int(a*b)
print(c//100)
Problem p02688 (python)

Fixed submission:
N,K = map(int,input().split())

ans = [0 for i in range(N)]

for i in range(K):
  d = int(input())
  List=list(map(int,input().split()))
  for j in List:
    ans[j-1] += 1
    
cnt = 0

for i in ans:
  if i == 0:
    cnt += 1
    
print(cnt)

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

d = int(input())
ans = [0 for i in range(N)]

for i in range(d):
  List=list(map(int,input().split()))
  for j in List:
    ans[j-1] += 1
    
print(ans.count(0))
Problem p02726 (python)

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

ans = [0 for i in range(N+1)]

for i in range(1,N+1):
  for j in range(i+1,N+1):
    if i < X :
      if j < X:
        a = j - i
        ans[a] += 1
      elif j >= X and j < Y:
        a = j - i
        b = (X-i) + 1 + (Y-j)
        c = min(a,b)
        ans[c] += 1
      else:
        a =  (X-i)+ 1 + (j - Y)
        ans[a] += 1
        
    elif i >= X and i < Y:
      if j < Y:
        a = j - i
        b = (i-X) + 1 + (Y-j)
        c = min(a,b)
        ans[c] += 1
      else:
        a = j -i
        b =  (i-X) + 1 + (j - Y)
        c = min(a,b)
        ans[c] += 1
        
    else:
      a = j - i
      ans[a] += 1
        
for i in range(1,N):
  print(int(ans[i]))

Buggy submission (verdict: Runtime Error):
import bisect
X,Y,A,B,C=map(int,input().split())

AList=list(map(int,input().split()))
BList=list(map(int,input().split()))
CList=list(map(int,input().split()))

AList.sort(reverse=True)
BList.sort(reverse=True)
CList.sort(reverse=True)

alist = AList[0:X] + BList[0:Y] + CList
alist.sort(reverse=True)

print(int(sum(alist[:X+Y])))
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()

l = len(S)
if l % 2 == 1:
  print("No")
else:
  if S[0:int(N/2)] == S[int(N/2):int(N)]:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

l = len(S)
if l % 2 == 1:
  print("No")
else:
  if S[0:N/2] == S[N/2+1:N]:
    print("Yes")
  else:
    print("No")
Problem p02912 (python)

Fixed submission:
import heapq

N,M = map(int, input().split())
List1=list(map(int,input().split()))
List=[]

for i in range(N):
  a = List1[i]
  List.append(-a)

heapq.heapify(List)

for i in range(M):
  a = (-heapq.heappop(List)) // 2
  heapq.heappush(List, -a)
  
print(int(-sum(List)))

Buggy submission (verdict: Runtime Error):
import heapq

N,M = map(int, input().split())
List=list(map(-int,input().split()))

heapq.heapify(List)

for i in range(M):
  a = (-heapq.heappop(List)) // 2
  heapq.heappush(List, -a)
  
print(int(sum(List)))
Problem p02948 (python)

Fixed submission:
import heapq
N, M = map(int, input().split())
jobs = {m:[] for m in range(1,M+1) }

for i in range(N):
  hi,yen = map(int, input().split())
  if hi <= M:
    jobs[hi].append(yen)
  
q = []
ans = 0
for i in range(1,M+1):
  for j in jobs[i]:
    heapq.heappush(q, -j)
  if len(q) > 0:
    a = heapq.heappop(q)
    ans += -a  
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq
N, M = map(int, input().split())
jobs = {m:[] for m in range(1,M+1) }

for i in range(N):
  hi,yen = map(int, input().split())
  jobs[hi].append(yen)
  
q = []
ans = 0
for i in range(1,M+1):
  for j in jobs[i]:
    heapq.heappush(q, -j)
  if len(q) > 0:
    a = heapq.heappop(q)
    ans += -a  
print(ans)
Problem p02959 (python)

Fixed submission:
N = int(input())

A = list(map(int,input().split()))
B = list(map(int,input().split()))
cnt = 0

A.append(0)
A.append(0)

ai = A[0]
ai2 = A[1]

for i in range(N):

  bi = B[i]
  
  if ai <= bi:
    cnt += ai
    
    if ai2 <= (bi - ai):
      cnt += ai2
      ai = max(0, ai2-(bi - ai))
      ai2 = A[i+2]
    else:
      cnt += (bi - ai)
      ai = max(0, ai2-(bi - ai))
      ai2 = A[i+2]
      
  else:
    cnt += bi
    ai = A[i+1]
    ai2 = A[i+2]
  
print(int(cnt))

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

A = list(map(int,input().split()))
B = list(map(int,input().split()))
cnt = 0

ai = A[0]
ai2 = A[1]

for i in range(N):

  bi = B[i]
  
  if ai <= bi:
    cnt += ai
    
    if ai2 <= (bi - ai):
      cnt += ai2
      ai = max(0, ai2-(bi - ai))
      ai2 = A[i+2]
    else:
      cnt += (bi - ai)
      ai = max(0, ai2-(bi - ai))
      ai2 = A[i+2]
      
  else:
    cnt += bi
    ai = A[i+1]
    ai2 = A[i+2]
  
print(int(cnt))
Problem p02989 (python)

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

List.sort()

a = List[int(N/2-1)]
b = List[N//2]

print(int(b-a))

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

List.sort()

a = List[N/2-1]
b = List[N/2]

print(int(b-a))
Problem p03077 (python)

Fixed submission:
import math

N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

print( math.ceil( N / min(A,B,C,D,E) ) +4 )

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

t1 = math.floor(N / A)
B = (t1 -1 ) * B
N = max(N % A,N-B)

t2 = math.floor(N / B)
C = (t2 -1 ) * C
N = max(N % B,N-C)

t3 = math.floor(N / C)
D = (t3 -1 ) * D
N = max(N % C,N-D)

t4 = math.floor(N / D)
E = (t4 -1 ) * E
N = max(N % D,N-E)

t5 = math.floor(N / E)

print(int(t1+t2+t3+t4+t5))
Problem p03326 (python)

Fixed submission:
N,M = map(int,input().split())
arr1 = []
arr2 = []
arr3 = []
arr4 = []
arr5 = []
arr6 = []
arr7 = []
arr8 = []

for i in range(N):
  a,b,c = map(int,input().split())
  arr1.append(int(a+b+c))
  arr2.append(int(a-b+c))
  arr3.append(int(a+b-c))
  arr4.append(int(a-b-c))
  arr5.append(int(-a+b+c))
  arr6.append(int(-a-b+c))
  arr7.append(int(-a+b-c))
  arr8.append(int(-a-b-c))

arr1.sort(reverse=True)
arr2.sort(reverse=True)
arr3.sort(reverse=True)
arr4.sort(reverse=True)
arr5.sort(reverse=True)
arr6.sort(reverse=True)
arr7.sort(reverse=True)
arr8.sort(reverse=True)

print(max(sum(arr1[:M]),sum(arr2[:M]),sum(arr3[:M]),sum(arr4[:M]),sum(arr5[:M]),sum(arr6[:M]),sum(arr7[:M]),sum(arr8[:M])))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().spkit())
arr = []

for i in range(N):
  a,b,c = map(int,input().spkit())
  arr.append(int(a+b+c))

arr.sort(reverse=True)

print(int(sum(arr[:M])))
Problem p03329 (python)

Fixed submission:
from functools import lru_cache

@lru_cache(maxsize=1000)
def fx(n):
  if n == 0:
    return 0
  if n == 1:
    return 1
  arr = []
  cnt = 0
  
  if n < 6:
    b = fx(n-1)+1
    arr.append(b)
  while n-6**cnt >= 0:
    cnt += 1
  if cnt > 1:
    
    x = n-(6**(cnt-1))
    b = fx(x)+1
    arr.append(b)

  cnt = 0
  while n-9**cnt >= 0:
    cnt += 1
  if cnt > 1:
    x = n-(9**(cnt-1))
    b = fx(x)+1
    arr.append(b)
  
  return min(arr)
  
N = int(input())
print(fx(N))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache

@lru_cache(maxsize=1000)
def fx(n):
  if n == 0:
    return 0
  if n == 1:
    return 1
  arr = []
  a = n
  cnt = 1
  b = fx(n-1)+1
  arr.append(b)
  while n-6**cnt >= 0:
    x = n-(6**cnt)
    b = fx(x)+1
    arr.append(b)
    cnt += 1
  cnt = 1
  while n-9**cnt >= 0:
    x = n-(9**cnt)
    b = fx(x)+1
    arr.append(b)
    cnt += 1
  return min(arr)
  
N = int(input())
print(fx(N))
Problem p02622 (python)

Fixed submission:
s = input()
t = input()
ans=0
cnt=0
for check in s:
    if t[cnt] == check:
        cnt+=1
    else:
        ans+=1
        cnt+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans=0,cnt=0
for check in s:
    if t[cnt] == check:
        cnt+=1
    else:
        ans+=1
        cnt+=1
print(ans)
Problem p02627 (python)

Fixed submission:
c=input()
if c.isupper():
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
#define STR 10
int main(){
    char a;
    scanf("%c",&a);
    if(isupper(a)==0){
        printf("a");
    }else{
        printf("A");
    }
    return 0;
}
Problem p03036 (python)

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

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

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

for i in range(10):
  x = r*x-d
  print(x)
Problem p03041 (python)

Fixed submission:
N,K = map(int,input().split())
S = list(input())
if S[K-1] == "A":
  S[K-1] = "a"
  STR = "".join(S)
  print(STR)
elif S[K-1] == "B":
  S[K-1] = "b"
  STR = "".join(S)
  print(STR)
else:
  S[K-1] = "c"
  STR = "".join(S)
  print(STR)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = list(input())
if S[K] == "A":
  S[K] = "a"
  STR = "".join(S)
  print(STR)
elif S[K] == "B":
  S[K] = "b"
  STR = "".join(S)
  print(STR)
else:
  S[K] = "c"
  STR = "".join(S)
  print(STR)
Problem p03042 (python)

Fixed submission:
s = str(input())
mae = int(s[:2])
usiro = int(s[2:])
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
s = str(input())
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
s = input()
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
s = list(str(1234))
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
S = list(str())
pat1 = "YYMM"
pat2 = "MMYY"
pat3 = "AMBIGOUS"
pat4 = "NA"
mae =int(S[0] + S[1])
usiro = int(S[2] + S[3])
print(mae)
print(usiro)
if mae >= 13:
    if usiro >= 13:
        print(pat4)
    elif usiro != 0:
        print(pat1)
elif mae != 0:
    if usiro == 0:
        print(pat2)
    else:
        print(pat1)
else:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
  sys.exit()

if s[0://2] == s[n//2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
r = input()
r1 = 1

print( r**2 )
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
	if s[0:n//2] == s[n//2:]:
  		print("Yes")
	else:
  		print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:s/2] == s[s/2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = [ input() for i in range(2)]
n = int(a[0])
s = a[0]
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = [ input() for i in range(n)]
n = int(a[0])
s = a[0]
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")
Problem p03775 (python)

Fixed submission:
import math

N = int(input())

min_f = len(str(N))
for a in range(1, int(math.sqrt(N)) + 1):
  if N % a != 0:
    continue
  b = int(N / a)
  f = max(len(str(a)), len(str(b)))
  if min_f > f:
    min_f = f

print(min_f)

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

min_f = len(N)
for a in range(1, N):
  if N % a != 0:
    continue
  b = int(N / a)
  f = max(len(str(a)), len(str(b)))
  if min_f > f:
    min_f = f
  if a**2 > N:
    break

print(min_f)
Problem p02552 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
x=int(sys.argv)

print ([0 if i==1 else 1 for i in x])
Problem p02829 (python)

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

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

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if (A == 1 and B == 2) or (A == 2 and B == 1):
    print(3)
elif (A == 1 and B == 3) or (A == 3 and B == 1):
    print(2)
elif (A == 2 and B == 3) or (A == 3) and B == 2):
    print(1)
Problem p02879 (python)

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

if a < 10 and b < 10:
    print(a * b)
else:
    print(-1)

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

if a < 10 and b < 10:
    print(a * b)
else:
    print(-1)
Problem p02552 (python)

Fixed submission:
def conj(n):
  if n==0:return 1
  return 0
print(conj(int(input())))

Buggy submission (verdict: Runtime Error):
def conj(n):
  if n==0:return 1
  return 0

print(conj(int(input()))
Problem p02596 (python)

Fixed submission:
K = int(input())
x = 7 % K
num_list = []

for count in range(1, K + 1):
  if x == 0:
    print(count)
    break
  x = (x * 10 + 7) % K

else: print(-1)

Buggy submission (verdict: Runtime Error):
K = int(input())
if K % 2 == 0 or K % 5 == 0: print(-1)
else:
  count = 1
  while True:
    num = 7 / 9 * (10 ** count - 1)
    if num % K == 0:
      print(count)
      break
    count += 1
Problem p02659 (python)

Fixed submission:
import math
from decimal import *

a,b = input().split()

a = int(a)
b = Decimal(b)

print(math.floor(a * b))

Buggy submission (verdict: Runtime Error):
import math

x = int(input())
y = double(input())

z = math.floor(x * y)
print(z)