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

Fixed submission:
import numpy as np

A ,B ,C, D = map(int,raw_input().split())


a=A*B
c=C*D


if a<c:
    print c
else:
    print a

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


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

city = raw_input()

ci = city.split(" ")

path = []

for i in range(len(ci)-1):
    z = int(ci[i+1])-int(ci[i])
    path.append(z)

costa = []

def binary_encode(i, num_digits):
    return np.array([i >> d & 1 for d in range(num_digits)])

for i in range(2**len(path)):
    pc = binary_encode(i,len(path))
    cost =0
    for z in range(len(pc)):
        if pc[z] == 0:
            cost = cost + A *path[z]
        else:
            cost = cost + B

    costa.append(cost)

print min(costa)

Buggy submission (verdict: Runtime Error):

import numpy as np


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

city = raw_input()

ci = city.split(" ")

path = []

for i in range(len(ci)-1):
    z = int(ci[i+1])-int(ci[i])
    path.append(z)

costa = []

def binary_encode(i, num_digits):
    return np.array([i >> d & 1 for d in range(num_digits)])

for i in range(2**len(path)):
    pc = binary_encode(i,len(path))
    cost =0
    for z in range(len(pc)):
        if pc[z] == 0:
            cost = cost + A *path[z]
        else:
            cost = cost + B

    costa.append(cost)

print min(costa)
~
Problem p03828 (python)

Fixed submission:
import math

def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff


def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

N = int(raw_input())

s = math.factorial(N)
x = divisor_num(s)
z = 1000000007

if x > z:
    ans = x%z
else:
    ans = x


print ans

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

def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff


def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

N = int(raw_input())

s = factorial(N)

print divisor_num(s)
Problem p03962 (python)

Fixed submission:
line = input().split()
l = list(map(int, line))
a = l[0]
b = l[1]
c = l[2]

if a == b and b == c:
    print (1)
elif ( a == b and b != c ) or (a != b and b == c) or (a == c and a != b):
    print (2)
else:
    print (3)

Buggy submission (verdict: Runtime Error):
line = input.split()
l = list(map(int, line))
a = l[0]
b = l[1]
c = l[2]

print (a)
print (b)
print (c)
Problem p03970 (python)

Fixed submission:
s = input()

standard = 'CODEFESTIVAL2016'

count = 0
for i in range(16):
    if s[i] != standard[i]:
        count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
l = input().split()
s = input()
 
n = int(l[0])
a = int(l[1])
b = int(l[2])
 
count = 0
countt = 0
for i in s:
    if i == 'a':
        if count < a+b:
            count = count + 1
            print('Yes')
        else:
            print('No')
    if i == 'b':
        if (count < a+b) and (countt < b):
            count = count + 1
            countt = countt + 1
            print('Yes')
        else:
            print('No')
    if i == 'c':
        print('No')
Problem p03799 (python)

Fixed submission:
def solve(s, c):
    """rv = min(Sr, Cr//2), where
       Sr = S + a
       Cr = C - 2a  # a>=0, a is number of (2c->S) conversions
       thus
       rv = max(min(S + a, C//2 - a) for a in range(0, C//2))
       if a >=0, optimum is Sr == Cr//2, thus
                            S + a == Cr//2 - a
                            a = (C//2 - S) / 2
    """
    a = (c / 2 - s) / 2
    if a < 0:
        a = 0
    al = int(a)
    ar = int(a) + 1
    return max(min(s + a, c//2 - a) for a in (al, ar))


if __name__ == "__main__":
    import sys
    S, C = map(int, sys.stdin.readline().split())
    print(solve(S, C))


def test_solve():
    assert solve(1, 2) == 1
    assert solve(0, 4) == 1
    assert solve(0, 1) == 0


def test_atcode():
    assert solve(1, 6) == 2
    assert solve(12345, 678901) == 175897

Buggy submission (verdict: Runtime Error):
def solve(s, c):
    """rv = min(Sr, Cr//2), where
       Sr = S + a
       Cr = C - 2a  # a>=0, a is number of (2c->S) conversions
       thus
       rv = max(min(S + a, C//2 - a) for a in range(0, C//2))
       if a >=0, optimum is Sr == Cr//2, thus
                            S + a == Cr//2 - a
                            a = (C//2 - S) / 2
    """
    a = (c / 2 - s) / 2
    if a < 0:
        a = 0
    al = int(a)
    ar = int(a) + 1
    return max(min(s + a, c//2 - a) for a in (al, ar))


if __name__ == "__main__":
    import sys
    S, C = sys.stdin.readline().split()
    print(solve(s, c))


def test_solve():
    assert solve(1, 2) == 1
    assert solve(0, 4) == 1
    assert solve(0, 1) == 0


def test_atcode():
    assert solve(1, 6) == 2
    assert solve(12345, 678901) == 175897
Problem p03796 (python)

Fixed submission:
N=int(input())
r = 10**9+7
power=1
for i in range(N):
    power=power*(i+1)%r
print(power)

Buggy submission (verdict: Runtime Error):
N=int(input())
r = 10**9+7
power=1
for i in range(n):
    power=power*(i+1)%r
print(power)
Problem p04012 (python)

Fixed submission:
import collections

for v in collections.Counter(input()).values():
    if v % 2 != 0:
        print("No")
        break
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import string
import sys

w = raw_input()
for c in string.ascii_lowercase:
    if w.count(c) % 2 == 1:
        print("No")
        sys.exit()
print("Yes")
Problem p03962 (python)

Fixed submission:
#coding:utf-8
a,b,c=list(map(int,input().split()))

if a==b and b==c:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
N,K=map(int,input().split())
print(K*(K-1)**(N-1))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
N,K=list(map(int,input().split()))
print(K*(K-1)**(N-1))
Problem p03796 (python)

Fixed submission:
multi = 1
N = int(raw_input())
for var in range(1,N + 1):
  multi = multi * var
  if multi > 1000000007:
    multi = multi % 1000000007
print multi

Buggy submission (verdict: Runtime Error):
m = 1
for var in range(int(raw_input) + 1):
  m = m * var + 1
print(m%1000000000*+7)

Buggy submission (verdict: Runtime Error):
m = 1
for var in range(int(raw_input) + 1):
 m = m * var + 1
print(m%1000000000*+7)
Problem p03795 (python)

Fixed submission:
n = int(input())
x = 800 * n
y = (n // 15) * 200
print(x-y)

Buggy submission (verdict: Runtime Error):
s,c = map(int,input().split())
if c/2 <= s:
	print(c//2)
else:
	print(s + (c-s*2)//4)
Problem p03797 (python)

Fixed submission:
s,c = map(int,input().split())
if c/2 <= s:
	print(c//2)
else:
	print(s + (c-s*2)//4)

Buggy submission (verdict: Runtime Error):
s,c = map(int,input())
if c/2 <= s:
	print(c//2)
else:
	print(s + (c-s*2)//4)
Problem p03795 (python)

Fixed submission:
# coding: utf-8
# Here your code !
N=int(input())
x=800*N
y=(N//15)*200

print(x-y)

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

numbers=input().rstrip().split(" ")

num=0
s=int(numbers[0])
c=int(numbers[1])

while c>=2:
    if s>=1 and c>=2:
        num+=1
        s-=1
        c-=2
    
    elif  c>=2:
        s+=1
        c-=2

print(num)
Problem p03845 (python)

Fixed submission:
def execute(n, tn, m, pxm):
    result = []
    for px in pxm:
        cp = tn[:]
        cp[px[0] - 1] = px[1]
        result.append(sum(cp))
    return result


if __name__ == '__main__':
    n = int(input())
    tn = list(map(int, input().split()))
    m = int(input())
    pxm = []
    for _ in range(m):
        p, x = map(int, input().split())
        pxm.append([p, x])
    result = execute(n, tn, m, pxm)
    print("\n".join(map(str, result)))

Buggy submission (verdict: Runtime Error):
def execute(n, tn, m, pxm):
    result = []
    for px in pxm:
        cp = tn[:]
        cp[px[0] - 1] = px[1]
        result.append(sum(cp))
    return result


if __name__ == '__main__':
    n = int(input())
    tn = map(int, input().split())
    m = int(input())
    pxm = []
    for _ in range(m):
        p, x = map(int, input().split())
        pxm.append([p, x])
    print(execute(n, tn, m, pxm))
Problem p03795 (python)

Fixed submission:
n = int(raw_input())

x = n * 800
y = (n / 15) * 200

print x-y

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

x = n * 800
y = (n / 15) * 200

print x-y

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

x = n * 800
y = (n % 15) * 200

print x-y
Problem p03796 (python)

Fixed submission:
import math
 
n = int(raw_input())
mod = pow(10,9) + 7
ans = 1
for i in xrange(1,n+1):
  ans = (ans*i)%mod
 
print ans

Buggy submission (verdict: Runtime Error):
s,c = map(int, raw_input().split())
 
scc = 0
if s*2 <= c:
  scc = s
  c -= s*2
else:
  scc = c/2
print  scc + c/4

Buggy submission (verdict: Runtime Error):
import math

n = int(raw_input())

print '{:d}'.format(math.factorial(n) % (math.pow(10,9) + 7))

Buggy submission (verdict: Runtime Error):
import math

n = int(raw_input())

print math.factorial(n) % (math.pow(10,9) + 7)
Problem p03795 (python)

Fixed submission:
N = int(input())

x = N * 800
y = N // 15 * 200

print(x-y)

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

if n >= m//2:
	ans = m//2
else:
	ans = n + (m - 2 * n) // 4

print(ans)
Problem p03844 (python)

Fixed submission:
a,op,b=map(str,raw_input().split())
a=int(a)
b=int(b)
#op = str(op)
if op=='+':
    print a+b
elif op=='-':
    print a-b

Buggy submission (verdict: Runtime Error):
a,op,b=raw_input().split()
if op=='+':
    print a+b
else op=='-':
    print a-b
Problem p03813 (python)

Fixed submission:
#coding: UTF-8
X=int(input())
if X<1200:
    print("ABC")
else:
    print("ARC")

Buggy submission (verdict: Runtime Error):
#coding: UTF-8
N=int(input())
lis=list(map(int, input().split()))
kind_dict={}
for i in lis:
    if i in kind_dict:
        kind_dict[i]+=1
    else:
        kind_dict[i]=1
kindn=len(kind_dict)
out=0
for i in kind_dict:
    if kind_dict[i]%2==0:
        out+=1
if out%2==0:
    print(kindn)
else:
    print(kindn-1)
Problem p03815 (python)

Fixed submission:
#coding: UTF-8
import math
x=int(input())
sho=x//11
amari=x%11
if amari==0:
    print(sho*2)
elif amari<=6:
    print(sho*2+1)
else:
    print(sho*2+2)

Buggy submission (verdict: Runtime Error):
#coding: UTF-8
import math
x=int(input())
sho=x//11
amari=x%11
if amari==0:
    print(sho*2)
elif amari<==6:
    print(sho*2+1)
else:
    print(sho*2+2)
Problem p03826 (python)

Fixed submission:
#coding: UTF-8
A, B, C, D = map(int, input().split())
a1 = A*B
a2 = C*D
if a1 >= a2:
    print(a1)
else:
    print(a2)

Buggy submission (verdict: Runtime Error):
#coding: UTF-8
N, A, B=map(int, input().split())
lis=list(map(int,input().split()))
#print(lis)
out=0
for i in range(0,N-1):
    d=lis[i+1]-lis[i]
    if d*A < (B-A):
        out=out+d*A
    else:
        out=out+B
print(out)

Buggy submission (verdict: Runtime Error):
#coding: UTF-8
A, B, C, D = map(int, input().split())
a1 = A*B
a2 = C*D
if a1 >= a2:
    print(a1)
else:
    print(a2)
Problem p03829 (python)

Fixed submission:
#coding: UTF-8
N, A, B=map(int, input().split())
lis=list(map(int,input().split()))
#print(lis)
out=0
for i in range(0,N-1):
    d=(lis[i+1]-lis[i])*A
    if d < B:
        out=out+d
    else:
        out=out+B
print(out)

Buggy submission (verdict: Runtime Error):
coding: UTF-8
N, A, B=map(int, input().split())
lis=list(map(int,input().split()))
#print(lis)
out=0
for i in range(0,N-1):
    d=lis[i+1]-lis[i]
    if d*A < B:
        out=out+d*A
    else:
        out=out+B
print(out)
Problem p03827 (python)

Fixed submission:
N = int(input())
S = input()
a = 0
sum_a = 0

for i in range(N):
  if S[i]=="I":
    sum_a += 1 
    a = max (a , sum_a)
  else:
    sum_a -= 1
print(a)

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

for i in range(N):
  if S[i]=="I":
    sum_a += 1 
    a = max (a , sum_a)
  else:
    sum_a- = 1
print(a)
Problem p04029 (python)

Fixed submission:
number = int(input())
answer = 0

for i in range(number+1):
  answer = answer + i
print(answer)

Buggy submission (verdict: Runtime Error):
number = input()
answer = 0

for i in range(number):
  number = number+1
  answer = answer + number
  
print(answer)

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

for i in range(number):
  number = number+1
  answer = answer + number
  
print(answer)

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

for i in range(number):
  number = number+1

print(number)
Problem p04032 (python)

Fixed submission:
a=input()
for i in range(0,len(a)-1):
	if a[i]==a[i+1]:
		print(i+1,i+2)
		exit()
	elif i<len(a)-2:
		if a[i]==a[i+2]:
			print(i+1,i+3)
			exit()
print(-1,-1)

Buggy submission (verdict: Runtime Error):
a=input()
for i in range(0,len(a)-1):
	if a[i]==a[i+1]:
		print(i+1,i+2)
		exit()
	elif i<len(a)-1:
		if a[i]==a[i+2]:
			print(i+1,i+3)
			exit()
print(-1,-1)
Problem p03797 (python)

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

if N < M//2:
    scc_min = max(1, N)
else:
    scc_min = M//2
scc_max = N + M//2

while scc_min < scc_max:
    scc = (scc_min + scc_max) // 2
    excess_c = M - scc*2
    if scc_min + 1 == scc_max:
        break
    if excess_c > 0 and excess_c//2 + N >= scc:
        scc_min = scc
    else:
        scc_max = scc - 1

excess_c = M - scc_max*2
if excess_c > 0 and excess_c//2 + N >= scc_max:
    print(scc_max)
else:
    print(scc_min)

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

for scc in range(M//2, -1, -1):
    excess_c = M - scc*2
    if excess_c//2 + N >= scc:
        print(scc)
        sys.exit(0)

print(0)
Problem p04034 (python)

Fixed submission:
n, l = (int(s) for s in input().strip().split(' '))
an = []
for a in range(0,l):
    an.append(input().strip().split())
box=[[1,0] for i in range(n)]
box[0][1] = 1
for move in an:
    box[int(move[0])-1][0] -= 1
    box[int(move[1])-1][0]+=1
    if box[int(move[0])-1][1] == 1:
        box[int(move[1])-1][1]= 1
    if box[int(move[0])-1][0]==0:
        box[int(move[0])-1][1]=0
print(str(sum([s[1] for s in box])))

Buggy submission (verdict: Runtime Error):
    n, l = (int(s) for s in input().strip().split(' '))
    an = []
for a in range(0,l):
    an.append(input().strip().split())

box=[[1,0] for i in range(n)]
box[0][1] = 1
for move in an:
    box[int(move[0])-1][0] -= 1
    box[int(move[1])-1][0]+=1
    if box[int(move[0])-1][1] == 1:
        box[int(move[1])-1][1]= 1
    if box[int(move[0])-1][0]==0:
        box[int(move[0])-1][1]=0
print(str(sum([s[1] for s in box])))
Problem p03992 (python)

Fixed submission:
l = raw_input()
print(l[:4]+" "+l[4:])

Buggy submission (verdict: Runtime Error):
#import ascii
#def ctoi(ch):
#	return ch - 97

def itoc(i):
	return chr(i+97)
s = raw_input()
s = map(lambda x: ord(x) - 97, s)
K = input()
N = len(s)
#print("s", s)
for i in range(N):
	if s[i] + K <= 25:
		pass
	elif s[i] != 0:
		K = K - (25 - s[i]) - 1
		s[i] = 0
	else:
		pass
	if K == 0:
		break
#print(s)
#print(K)

for i in range(N-1, -1, -1):
	if s[i] + K <= 25:
		s[i] = s[i] + K
		K = 0
		break
	else:
		K = K - (26 - s[i])
		s[i] = 0
#print(K)
tmp = [itoc(item) for item in s]
print("".join(tmp))
Problem p03827 (python)

Fixed submission:
l=[]
x=0
l.append(x)
n=int(input())
s=input()
for i in s:
  if(i=='I'):
      x=x+1
      l.append(x)
  if(i=='D'):
      x=x-1
      l.append(x)
print(max(l))

Buggy submission (verdict: Runtime Error):
l=[]
x=0
l.append(x)
n=int(input())
s=input()
for i in s:
  if(i=='I'):
      x++
      l.append(x)
  if(i=='D'):
      x--
      l.append(x)
print(max(l))

Buggy submission (verdict: Runtime Error):
l=[]
x=0
l.append(x)
n=int(input())
s=input()
for i in s:
  if(i=='I'):
    x++
    l.append(x)
  if(i=='D'):
    x--
    l.append(x)
print(max(l))
Problem p03828 (python)

Fixed submission:
import math
n=int(input())
prime=[]


def expFactor(n, p): 
    x = p 
    exponent = 0
    while n // x > 0: 
      
        exponent += n // x 
        x *= p 
    return exponent 

ans=1

if(n>=2):
    prime.append(2)
for i in range(3,n+1):
    countt=0
    for j in range (1,int(math.sqrt(i))+1):
        if(i%j==0):
            countt+=1
    if(countt==1):
        prime.append(i)
#print(prime)
for i in prime:
    ans*=(expFactor(n,i)+1)
print(ans%(1000000007))

Buggy submission (verdict: Runtime Error):
import math 

n=int(input())
l={}
  
# A function to print all prime factors of  
# a given number n 
def primeFactors(n): 
      
    # Print the number of two's that divide n 
    while n % 2 == 0: 
        if('2' in l):
            l['2']+=1
        else:
            l['2']=1
        n = n / 2
          
    # n must be odd at this point 
    # so a skip of 2 ( i = i + 2) can be used 
    for i in range(3,int(math.sqrt(n))+1,2): 
          
        # while i divides n , print i ad divide n 
        while n % i== 0:
            if(i in l):
                l[i]+=1
            else:
                l[i]=1
            n = n / i 
              
    # Condition if n is a prime 
    # number greater than 2 
    if n > 2: 
        if(n in l):
            l[n]+=1
        else:
            l[n]=1
        
primeFactors(math.factorial(n))
#print(l)
k=1
for i in l:
    k=k*(l[i]+1)
print(k)
Problem p03844 (python)

Fixed submission:
st=input()
print(eval(st))

Buggy submission (verdict: Runtime Error):
n=int(input())
numbb=input().split(' ')
numb=[]
for i in numbb:
    numb.append(int(i))
numb=sorted(numb)
#print(numb)
if(n==len(numb)):
    if(n%2!=0):
        temp=[]
        temp.append(0)
        strt=2
        for i in range(0,int(n/2)):
            temp.append(strt)
            temp.append(strt)
            strt+=2
        if(temp==numb):
            #print(temp,numb)
            print(pow(2,len(set(numb))-1)%((10**9)+7))
        else:
            print(0)
    if(n%2==0):
        temp=[]
        strt=1
        for i in range(0,int(n/2)):
            temp.append(strt)
            temp.append(strt)
            strt+=2
        if(temp==numb):
            #print(temp,numb)
            #print(pow(2,len(set(numb))))
            print((pow(2,len(set(numb)))%((10**9)+7)))
        else:
            print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
numbb=input().split(' ')
numb=[]
for i in numbb:
    numb.append(int(i))
numb=sorted(numb)
#print(numb)
if(n==len(numb)):
    if(n%2!=0):
        temp=[]
        temp.append(0)
        strt=2
        for i in range(0,int(n/2)):
            temp.append(strt)
            temp.append(strt)
            strt+=2
        if(temp==numb):
            #print(temp,numb)
            print(((pow(2,len(set(numb))-1)%((10**9)+7))))
        else:
            print(0)
    if(n%2==0):
        temp=[]
        strt=1
        for i in range(0,int(n/2)):
            temp.append(strt)
            temp.append(strt)
            strt+=2
        if(temp==numb):
            #print(temp,numb)
            #print(pow(2,len(set(numb))))
            print(((pow(2,len(set(numb)))%((10**9)+7))))
        else:
            print(0)
Problem p04043 (python)

Fixed submission:
ans = [5,5,7]
a = sorted(list(map(int, input().split())))
if a == ans:
    print("YES")
else:
    print("NO")

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

for i in range(10*n - n):
    c = str(n+i)
    
    for j in a:
        if j in c:
            break
    
    else:
        ans = c
        break
        
print(ans)
Problem p04045 (python)

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

for i in range(10*n - n):
    c = str(n+i)
    
    for j in a:
        if j in c:
            break
    
    else:
        ans = c
        break
        
print(ans)

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

for i in range(10*n - n):
    c = str(n+i)
    
    for j in a:
        if j in c:
            break
    
    else:
        ans = c
        break
        
print(ans)

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

n = int(n)

for i in range(10000-n):
    c = str(n+i)
    
    for j in a:
        if j in c:
            break
    
    else:
        ans = c
        break
        
print(ans)
Problem p04043 (python)

Fixed submission:
haiku = input().split()

haiku = sorted(list(map(int, haiku)))

if [5, 5, 7] == haiku:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
num_list = input().split(" ")

num_list = map(num_list, int)

sorted_list = num_list.sorted()
 
if sorted_list == [5, 5, 7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
num_list = int(input().split(" "))

sorted_list = num_list.sorted()

if sorted_list == [5, 5, 7]:
  print("YES")
else:
  print("NO")
Problem p03827 (python)

Fixed submission:
n = int(input())
s = input()
x = 0
c = 0
for i in range(n):
    if s[i] == "I":
        c += 1
    else:
        c -= 1
    x = max(x,c)
print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
x = 0
c = 0
for i in range(n):
    if s[i] = "I":
        c += 1
    else:
        c -= 1
    x = max(x,c)
print(x)
Problem p03836 (python)

Fixed submission:
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy
a = iter([dx, dy, dx, dy+1, dx+1, dy+1, dx+1, dy+1,])
w = "R"*next(a) + "U"*next(a) + "L"*next(a) + "D"*next(a) + "R"*next(a) + "U"*next(a) + "L" + "U" + "L"*next(a) + "D"*next(a) + "R"
print(w)

Buggy submission (verdict: Runtime Error):
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy
a = iter[dx, dy, dx, dy+1, dx+1, dy+1, dx+1, dy+1,]
w = "R"*next(a) + "U"*next(a) + "L"*next(a) + "D"*next(a) + "R"*next(a) + "U"*next(a) + "L" + "U" + "L"*next(a) + "D"*next(a) + "R"
print(w)
Problem p03846 (python)

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())))
if n % 2 == 0:
  if a == sorted(2*[2*x+1 for x in range(int(n/2))]):
    print((2**int(n/2))%1000000007)
  else:
    print(0)
else:
  if a == sorted(list(2*[2*x for x in range(n//2+1)])[1:]):
    print((2**(n//2))%1000000007)
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())))
if n % 2 == 0:
  if a == sorted(2*[2*x+1 for x in range(n/2)]):
    print(2**(n/2))
  else:
    print(0)
else:
  if a == sorted(list(2*[2*x for x in range(n//2+1)])[1:]):
    print(2**(n//2))
  else:
    print(0)
Problem p03943 (python)

Fixed submission:
candy = input()
x = candy.split()
y = [0,0,0]
for i in range(3):
    y[i] = int(x[i])
i = 0
for v in y:
    if max(y) == v and y[(i+1)%3] + y[(i+2)%3] == v:
            print('Yes')
            break
    i = i+1
if i >= 3:
    print('No')

Buggy submission (verdict: Runtime Error):
candy = int(input())
x = candy.split()
i = 0
for v in x
    if max(x) == v and (i+1)%3 + (i+2)%3 = v:
            print('YES')
            break
    i ++
if i >= 2
    print('NO')