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

Fixed submission:
print('ABC'+input())

Buggy submission (verdict: Runtime Error):
d={}
n,m = map(int,input().split())
for _ in range(m):
    i,j = map(int,input().split())
    if j in d:
        d[j].append(i)
    else:
        d[j]=[i]
flag=0
if n in d:
    for item in d[n]:
        if item in d and 1 in d[item]:
            flag=1
            break
print('POSSIBLE' if flag else 'IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
a=[1,2,4,8,16,32,64,128]
n=int(input())
i=0
while a[i]<=n:
    i+=1
print(a[i-1])

Buggy submission (verdict: Runtime Error):
a=[1,2,4,8,16,32,64,128]
n=int(input())
i=0
while a[i]<=n:
    i+=1
print(a[i-1] if i>0 else 0)

Buggy submission (verdict: Runtime Error):
    a=[1,2,4,8,16,32,64,128]
    n=int(input())
    i=0
    while a[i]<=n:
        i+=1
    print(a[i-1] if i>0 else 0)
Problem p03644 (python)

Fixed submission:
a=[0,1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64]
print(a[(int(input()))])

Buggy submission (verdict: Runtime Error):
a=[1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64]
print(a[(int(input()))])
Problem p03612 (python)

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
plen = len(p)

count = 0

for i in range(plen):
    if p[i] == i + 1:
        if p[i] == N:
            p[i - 1], p[i] = p[i], p[i - 1]
        else:
            p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
    
            
print(count)

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

count = 0

for i in range(plen):
    if p[i] == N - 1:
        p[i - 1], p[i] = p[i], p[i - 1]
        count += 1
    elif p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
            
print(count)

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

count = 0

for i in range(plen):
    if p[i] == N - 1:
        p[i], p[i - 1] = p[i - 1], p[i]
        count += 1
    elif p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
            
print(count)

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

count = 0
for i in range(1, plen):
    if p[i] == i :
        if p[i] == N:
            p[i -1], p[i] = p[i], p[i - 1]
            count += 1
            break
        else:
            p[i], p[i + 1] = p[i + 1], p[i]
            count += 1
print(count)

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

count = 0
for i in range(plen):
    if p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
print(count)

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

count = 0
for i in range(plen):
    if p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        count += 1
print(count)
Problem p03609 (python)

Fixed submission:
x, t = list(map(int, input().split()))
print(max((x - t), 0))

Buggy submission (verdict: Runtime Error):
print(max(int(input()) - int(input()), 0))
Problem p03680 (python)

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

cnt = 1
idx = 1
for i in range(n):
    if a[idx] == 2:
        print(cnt)
        break

    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)

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


btn2 = a.index(2)
cnt = 1
idx = 1
for i in range(n+1):
    if a[idx] == btn2:
        cnt += 1
        print(cnt)
        break

    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)

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


btn2 = a.index(2)
cnt = 1
idx = 1
for i in range(n):
    if a[idx] == btn2:
        if cnt != 1:
            cnt += 1
        print(cnt)
        break
    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)

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


btn2 = a.index(2)
cnt = 1
idx = 1
for i in range(n):
    if a[idx] == btn2:
        cnt += 1
        print(cnt)
        break
    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [0]
for i in range(1, n + 1):
    a.append(int(input()))


btn2 = a.index(2)
cnt = 1
idx = 1
for i in range(1, n + 1):
    if a[idx] == btn2:
        cnt += 1
        print(cnt)
        break
    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)
Problem p03681 (python)

Fixed submission:
"""
def factorial(x):
    if x == 0:
        return 1
    return x * fact(x - 1)
"""
from math import *
n, m = map(int, input().split())

dif = abs(n - m)
if dif >= 2:
    ans = 0
elif dif == 1:
    ans = factorial(n) * factorial(m) % (10**9 + 7)
else:
    ans = factorial(n) * factorial(m) * 2 % (10**9 + 7)

print(ans)

Buggy submission (verdict: Runtime Error):
def factorial(x):
    if x == 0:
        return 1
    return x * factorial(x - 1)

n, m = map(int, input().split())

dif = abs(n - m)
if dif >= 2:
    ans = 0
elif dif == 1:
    ans = factorial(n) * factorial(m) % (10**9 + 7)
else:
    ans = factorial(n) * factorial(m) * 2 % (10**9 + 7)

print(ans)

Buggy submission (verdict: Runtime Error):
def fact(x):
    if x == 0:
        return 1
    return x * fact(x - 1)

n, m = map(int, input().split())

dif = abs(n - m)
if dif >= 2:
    ans = 0
elif dif == 1:
    ans = fact(n) * fact(m) % (10**9 + 7)
else:
    ans = fact(n) * fact(m) * 2 % (10**9 + 7)

print(ans)
Problem p03737 (python)

Fixed submission:
a,b,c = input().split()
print(a[0].upper()+b[0].upper()+c[0].upper())

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
print(upper(a[0])+upper(b[0])+upper(c[0]))
Problem p03627 (python)

Fixed submission:
n = int(raw_input())

occ = {}
for i in map(int, raw_input().split()):
    if not i in occ:
        occ[i] = 0

    occ[i] += 1

found = 0
rect = 1

for i in sorted(occ, reverse=True):
    if occ[i] >= 4 and found < 1:
        found += 2
        rect *= i*i
    elif occ[i] >= 2:
        found += 1
        rect *= i

    if found == 2:
        print rect
        break
    
if found < 2:
    print 0

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

occ = {}
for i in map(int, raw_input().split()):
    if not i in occ:
        occ[i] = 0

    occ[i] += 1

found = 0
rect = 1

for i in sorted(occ, reverse=True):
    if occ[i] >= 4 and found < 1:
        found += 2
        rect *= i*i
    elif occ[i] => 2:
        found += 1
        rect *= i

    if found == 2:
        print rect
        break
    
if found < 2:
    print 0

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

occ = {}
for i in map(int, raw_input().split()):
    if not i in occ:
        occ[i] = 0

    occ[i] += 1

found = 0
rect = 1

for i in sorted(occ, reverse=True):
    if occ[i] >= 4:
        found += 2
        rect *= i*i
    elif occ[i] => 2:
        found += 1
        rect *= i

    if found == 2:
        print rect
        break
    
if found < 2:
    print 0
Problem p03613 (python)

Fixed submission:
n=int(raw_input())
a=[int(i) for i in raw_input().split(' ')]
res={}
for i in a:
    for p in (i,i-1,i+1):
            res[p]=res.get(p,0)+1
if len(res)>0:
    print  max(res.values())

Buggy submission (verdict: Runtime Error):
x=int(raw_input())
k=int(raw_input())
R=[int(i) for i in raw_input().split(' ')]
Q=int(raw_input())
RES=[]
for q in range(Q):
    RES.append((int(i) for i in raw_input().split(' ')))
tintervals=[[0,R[0],R[0]]]
if k>1:
    for ts in range(1,len(R)):
        tintervals.append([R[ts-1],R[ts],R[ts]-R[ts-1]])
for t, a in RES:
    for i,r in enumerate(tintervals):
        j=i%2+1
        if t>=r[0]:
            if t<=r[1]:
                a=max(a+((-1)**j)*(t-r[0]),0)
                a=min(a,x)
                print a
                break
            else:
                a=max(a+((-1)**j)*r[2],0)
                a=min(a,x)
    if t > tintervals[-1][1]:
        j=(i+1)%2+1
        a=max(a+((-1)**j)*(t-tintervals[-1][1]),0)
        a=min(a,x)
        print a
Problem p04048 (python)

Fixed submission:
def f(a, b):
    if a * b == 0:
        return 0
    res = f(min(a, b), max(a, b) % min(a, b)) + 2 * min(a, b) * (max(a,b)//min(a, b))
    if(max(a, b) % min(a, b) == 0):
        res -= min(a, b)
    return res

n, x = map(int, input().split())
res = n + f(n - x, x)
print(res)

Buggy submission (verdict: Runtime Error):
'''def f(a, b):
    if a * b == 0:
        return 0
    res = f(min(a, b), max(a, b) % min(a, b)) + 2 * min(a, b) * (max(a,b)//min(a, b))
    if(max(a, b) % min(a, b) == 0):
        res -= 1
    return res'''
def f(a, b):
    if(a - b == 0):
        return a
    if(a * b == 0):
        return 0
    return 2 * min(a, b) + f(min(a, b), max(a,b) - min(a, b))

n, x = map(int, input().split())
res = n + f(n - x, x)
print(res)

Buggy submission (verdict: Runtime Error):
'''def f(a, b):
    if a * b == 0:
        return 0
    res = f(min(a, b), max(a, b) % min(a, b)) + 2 * min(a, b) * (max(a,b)//min(a, b))
    if(max(a, b) % min(a, b) == 0):
        res -= 1
    return res'''
def f(a, b):
    minn = min(a, b)
    maxx = max(a, b)
    if(a - b == 0):
        return a
    if(a * b == 0):
        return 0
    return 2 * minn + f(minn, maxx - minn)

n, x = map(int, input().split())
res = n + f(n - x, x)
print(res)
Problem p03992 (python)

Fixed submission:
s = raw_input()
print s[:4], s[4:]

Buggy submission (verdict: Runtime Error):
n = input()
a = map(int,raw_input().split())
print sum(i == a[a[i]-1]-1 for i in range(n)) / 2
Problem p03993 (python)

Fixed submission:
n = input()
a = map(int,raw_input().split())
print sum(i == a[a[i]-1]-1 for i in range(n)) / 2

Buggy submission (verdict: Runtime Error):
n = input()
a = map(int,raw_input.split())
print sum(i == a[a[i-1]]-1 for i in range(n)) / 2
Problem p03777 (python)

Fixed submission:
a=input()
if a[0] !=a[2]:
    print("D")
else:
    print("H")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
if a !=b:
    print("H")
else:
    print("D")
Problem p03633 (python)

Fixed submission:
import fractions
 
def lcm(a,b):
  return (a*b)//fractions.gcd(a,b)
 
N=int(input())
T=1
for i in range(N):
  T=lcm(T,int(input()))
print(T)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

N = int(input())
T = list(map(int, input().split()))
ans = 1

for i in range(0,N):
    ans = ans * T[i] / gcd(ans, T[i])
    
print(int(ans))
Problem p03623 (python)

Fixed submission:
x,a,b=map(int,input().split())
if abs(x-a) > abs(x-b):
	print("B")
else:
	print("A")

Buggy submission (verdict: Runtime Error):
x=input()
a,b=input().split()
x=int(x)
a=int(a)
b=int(b)
if abs(x-a)<abs(x-b):
   print("A")
else:
   print("B")

Buggy submission (verdict: Runtime Error):
x=input()
a,b=input().split()
x=int(x)
a=int()
b=int()
if abs(x-a)<abs(x-b):
   print("A")
else:
   print("B")
Problem p04044 (python)

Fixed submission:
N, L = map(int, raw_input().split())
l = []
for _ in range(N):
    l.append(raw_input().strip())
print "".join(sorted(l))

Buggy submission (verdict: Runtime Error):
N, L = raw_input().split()
l = []
for _ in range(N):
    l.append(raw_input().strip())
print "".join(sorted(l))
Problem p03624 (python)

Fixed submission:
S=list(set(input()))
S.sort()
import string
switch=True
A=list(string.ascii_lowercase)
for i in A:
    if not i in S:
        print(i)
        switch=False
        break
if switch:
    print("None")

Buggy submission (verdict: Runtime Error):
S=list(set(input()))
S.sort()
import string
A=string.ascii_lowercase
for i in range(len(A)):
    if not S[i]==A[i]:
        print(A[i])
        break

Buggy submission (verdict: Runtime Error):
S=list(set(input()))
S.sort()
import string
A=string.ascii_lowercase
for i in range(len(A)):
    if not S[i]==A[i]:
        print(A[i])
        break
Problem p03627 (python)

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
c = 0
i = 0
while(i < len(a)-1):
    if(a[i] == a[i+1]):
        del l[0]
        l.append(a[i])
        i += 1
        c += 1
    if(c >= 2 or i == len(a)-2):
        i = len(a)-1
        print(l[0] * l[1])
    i += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
c = 0
for j in range(len(a)-1):
    if(c => 2):
        print(l[0] * l[1])
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        c += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
c = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        c += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
c = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        count += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
count = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        count += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
count = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
        break
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        count += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
l = [0,0]
count = 0
for j in range(len(a)-1):
    if(count => 2):
        print(l[0] * l[1])
        exit()
    if(a[j] == a[j+1]):
        del l[0]
        l.append(a[j])
        j += 1
        count += 1
Problem p03729 (python)

Fixed submission:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
  print('YES')
 else:
  print('NO')
Problem p03795 (python)

Fixed submission:
import math
a = int(input())
print((a*800)-(math.floor(a/15)*200))

Buggy submission (verdict: Runtime Error):
a = int(input())
print((a*800)-(math.floor(a/15)*200))
Problem p03852 (python)

Fixed submission:
def main():
    print('vowel' if input() in 'aeiou' else 'consonant')

if __name__ == '__main__':
    main()

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


def main():
    print('vowel' if input() in 'aeiou' else 'consonant')

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

Fixed submission:
from fractions import gcd
from functools import reduce

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

N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
print(reduce(lcm, T))

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce

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

N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
print(reduce(lcm, T))
Problem p03951 (python)

Fixed submission:
N = int(input())

s = input()

t = input()

temp = N
flag = True
if s==t:
    print(N)
else:
    while(temp > 0 and flag):
        temps = s[N-temp:N]
        tempt = t[:temp]
        if(temps==tempt):
            flag = False
        else:
            temp -= 1

    print(N+N-temp)

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

s = input()

t = input()

temp = 0
flag = True

while(temp < N-1 & flag):
    temps = s[N-temp-1:N-1]
    tempt = t[:temp]
    if(temps==tempt):
        temp += 1
    else:
        flag = False

print(N+N-temp)
Problem p03992 (python)

Fixed submission:
s = input()
n = 4
for itm in range(n):
    print(s[itm],end='')

print("",end= " ")
for i in range(4,len(s)):
    print(s[i],end='')
print()

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

def main():
    s = list(input())
    n = int(input())
    A = []

    for c in s:
        if (ord('a') - ord(c)) % 26 <= n:
            A.append('a')
            n -= (ord('a') - ord(c)) % 26
        else:
            A.append(c)

    # print(''.join(*A))

    # for itm in A:
    #     print(itm,end = '')

    A[-1] = chr(ord(A[-1]) + n % 26)
    print(''.join(A))
if __name__ == '__main__':
    main()
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(input())
print((n-1) * (m-1))

Buggy submission (verdict: Runtime Error):
n, m =int(input())
print(n-1 * m-1)
Problem p03636 (python)

Fixed submission:
s=input()

print(s[0] + str(len(s)-2) + s[len(s)-1])

Buggy submission (verdict: Runtime Error):
s=input()
print(s[0] + int(len(s)-2) + s[-1])
Problem p04043 (python)

Fixed submission:
# -*- coding: utf-8-*-
a = []
a = list(map(int,input().split()))
if (a[0] + a[1] + a[2] == 17) and (7 in a) and (5 in a):   
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8-*-
strs = []
n,k = map(int,input().split())
hates = list(input().split())

give = n

while(True):
  stri = str(give)
  for hate in hates:
    if hate in stri:
      give = give + 1
      break
    else:
      print(give)
      exit()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8-*-
strs = []
n,k = map(int,input().split())
hates = list(input().split())

give = n

while(True):
  stri = str(give)
  for hate in hates:
    if hate in stri:
      give = give + 1
      break;
    else:
      print(give)
      exit()
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N>K:
    print(K*X+Y*(N-K))
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N = input(int(N))
K = input(int(K))
X = input(int(X))
Y = input(int(Y))
if N>K:
    print(K*X+Y(N-K))
else:
    print(N*X)
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
n, m=input().split()
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n, m=input().split()
print((n-1)*(m-1))
Problem p03636 (python)

Fixed submission:
S=input()
f=S[0]
l=S[-1]
m=len(S)-2
print(f+str(m)+l)

Buggy submission (verdict: Runtime Error):
S=input()
f=S[0]
l=S[-1]
m=len(S)-2
print(str(f+m+l))
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
n=input("east_west road:")
print(n)
m=input("north_south road:")
print(m)
block =(int(n)-1) * (int(m)-1)
print(block)

Buggy submission (verdict: Runtime Error):
n=input("east_west road:")
m=input("north_south road:")
block =(int(n)-1) * (int(m)-1)
print(block)

Buggy submission (verdict: Runtime Error):
n = input("east_west road:")
m =input("north_south road:")
block =(int(n)-1) * (int(m)-1)
print(block)
Problem p03693 (python)

Fixed submission:

raw = raw_input().split(" ")
num = int(raw[0]) * 100 + int(raw[1]) * 10 + int(raw[2])
if not (num % 4):
    print 'YES'
else:
    print 'NO'

Buggy submission (verdict: Runtime Error):
raw = raw_input().split(" ")
num = int(raw[0]) * 100 + int(raw[1]) * 10 + int(raw[2])
if not (num % 4):
    return 'YES'
else:
    return 'NO'

Buggy submission (verdict: Runtime Error):
raw = raw_input().split(" ")
num = raw[0] * 100 + raw[1] * 10 + raw[2]
if not (num % 4):
  return "Yes"
return "No"

Buggy submission (verdict: Runtime Error):
raw = raw_input().sprit(" ")
if not raw % 4:
    return "Yes"
return "No"

Buggy submission (verdict: Runtime Error):
raw = raw_input()
if raw %= 4:
    return "Yes"
return "No"
Problem p03694 (python)

Fixed submission:
num = int(raw_input())
law = raw_input().split(" ")
tmp = 0
raw = []
for i in law:
    raw.append(int(i))
for i in range(num):
    for j in range(i, num):
        div = abs(raw[i] - raw[j])
        if div >= tmp:
            tmp = div
print tmp

Buggy submission (verdict: Runtime Error):
raw = int(raw_input().split(""))
tmp = 1
for i in range(len(raw) - 1):
  div = abs(raw[i] - raw[i-1])
  if div >= tmp:
    tmp = div
print tmp
Problem p03635 (python)

Fixed submission:
n,m = map(int,raw_input().split())
print((n-1)*(m-1))

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

def gcd(a,b):
    while b!=0:
        t = b
        b=a%b
        a=t
    return a

i,j=0,0
good=True
while i<n-1:
    if (a[i]*a[i+1]) % 4 != 0:
        j = i+1
        while j<n-1 and gcd(a[i],a[j]) % 4 != 0:
            j+=1
        (a[i+1],a[j]) = a[j],a[i+1]
    if (a[i]*a[i+1]) % 4 != 0:
        good=False
    i+=1
if good:
    print(''.join(map(str,a)))
else:
    print("Yes")
Problem p03657 (python)

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

if int(b[0]) % 3 == 0:
  print("Possible")
elif int(b[1]) % 3 == 0:
  print("Possible")
elif (int(b[0]) + int(b[1])) % 3 == 0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
N, K = input().split()
l = input().split()
l = list(map(int, l))
l.sort(reverse=True)

sum = 0
for i in range(K):
  sum += l[i]

print(sum)
Problem p03658 (python)

Fixed submission:
N, K = input().split()
l = input().split()
l = list(map(int, l))
l.sort(reverse=True)

sum = 0
for i in range(int(K)):
  sum += l[i]

print(sum)

Buggy submission (verdict: Runtime Error):
N, K = input().split()
l = input().split()
l = list(map(int, l))
l.sort(reverse=True)

sum = 0
for i in range(K):
  sum += l[i]
Problem p03643 (python)

Fixed submission:
print("ABC" + input())

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
 
arr = []
i = 0
for i in range(M):
    append = arr.append
    t = list(map(int, input().split(" ")))
    append(t)
p1 = [x for x in arr if x[0] == 1]
p2 = [x for x in arr if x[1] == N]

ii = 0
iii = 0
r = 0
for ii in p1:
    for iii in p2:
        if iii[0] == ii[1]:
            r = 1
            break
 
if (r != 0):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem p03643 (python)

Fixed submission:
n=int(raw_input())
print "ABC"+str(n)

Buggy submission (verdict: Runtime Error):
n=int(raw_input())
print "ABC"+n