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

Fixed submission:
import collections

n=int(input())
v=list(map(int,input().split()))
count=0
vo=[]
ve=[]
for i in range(n):
    if i%2==0:
        ve.append(v[i])
    else:
        vo.append(v[i])
e=collections.Counter(ve)
o=collections.Counter(vo)

emax=e.most_common()[0][0]
omax=o.most_common()[0][0]

if emax==omax:
    if e.most_common()[0][1]==len(ve) and o.most_common()[0][1]==len(vo):
        count=n//2
    else:
        omax2 = o.most_common()[1][0]
        emax2 = e.most_common()[1][0]
        tempe = 0
        tempo = 0
        for i in range(n // 2):
            if ve[i] != emax2:
                tempe += 1
        for i in range(n // 2):
            if vo[i] != omax:
                tempe += 1
        for i in range(n // 2):
            if ve[i] != emax:
                tempo += 1
        for i in range(n // 2):
            if vo[i] != omax2:
                tempo += 1
        count = min(tempe, tempo)
else:
    for i in range(n // 2):
        if ve[i] != emax:
            count += 1
    for i in range(n // 2):
        if vo[i] != omax:
            count += 1

print(count)
print()

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
v=list(map(int,input().split()))
count=0
vo=[]
ve=[]
for i in range(n):
    if i%2==0:
        ve.append(v[i])
    else:
        vo.append(v[i])
e=collections.Counter(ve)
o=collections.Counter(vo)

emax=e.most_common()[0][0]
omax=o.most_common()[0][0]

if emax==omax:
    omax2 = o.most_common()[1][0]
    emax2 = e.most_common()[1][0]
    tempe=0
    tempo=0
    for i in range(n // 2):
        if ve[i] != emax2:
            tempe += 1
    for i in range(n // 2):
        if vo[i] != omax:
            tempe += 1
    for i in range(n // 2):
        if ve[i] != emax:
            tempo += 1
    for i in range(n // 2):
        if vo[i] != omax2:
            tempo += 1
    count=min(tempe,tempo)
else:
    for i in range(n // 2):
        if ve[i] != emax:
            count += 1
    for i in range(n // 2):
        if vo[i] != omax:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
v=list(map(int,input().split()))
count=0
vo=[]
ve=[]
for i in range(n):
    if i%2==0:
        ve.append(v[i])
    else:
        vo.append(v[i])
e=collections.Counter(ve)
o=collections.Counter(vo)

emax=e.most_common()[0][0]
emax2=e.most_common()[1][0]
omax=o.most_common()[0][0]
omax2=o.most_common()[1][0]

if emax==omax:
    tempe=0
    tempo=0
    for i in range(n // 2):
        if ve[i] != emax2:
            tempe += 1
    for i in range(n // 2):
        if vo[i] != omax:
            tempe += 1
    for i in range(n // 2):
        if ve[i] != emax:
            tempo += 1
    for i in range(n // 2):
        if vo[i] != omax2:
            tempo += 1
    count=min(tempe,tempo)
else:
    for i in range(n // 2):
        if ve[i] != emax:
            count += 1
    for i in range(n // 2):
        if vo[i] != omax:
            count += 1
    
print(count)
Problem p03285 (python)

Fixed submission:
n=int(input())
flag=0
for i in range(26):
    for j in  range(15):
        total=4*i+j*7
        if total==n:
            flag+=1
            break
if flag==0:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
flag=0
if i in range(26):
    if j in  range(15):
        total=4*i+j*7
        if total==n:
            flag+=1
            break
if flag==0:
    print('No')
else:
    print('Yes')
Problem p03316 (python)

Fixed submission:
n=input()
total=0
for i in range(len(n)):
    total=total+int(n[i])
if int(n)%total==0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=input()
total=0
for i in len(n):
    total=total+int(n[i])
if n%total==0:
    print('Yes')
else:
    print('No')
Problem p03470 (python)

Fixed submission:
n=int(input())
kagami=[]
for i in range(n):
    d=input()
    if d not in kagami:
        kagami.append(d)
print(len(kagami))

Buggy submission (verdict: Runtime Error):
n=input()
kagami=[]
for i in range(n):
    d=input()
    if d not in kagami:
        kagami.append(d)
print(len(kagami))
Problem p03495 (python)

Fixed submission:
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = collections.Counter(a)
ans = 0
t=cnt.most_common()
if len(t) <= k:
    print(0)
    exit()

for i in range(k):
    ans += t[i][1]
print(n - ans)

Buggy submission (verdict: Runtime Error):
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = collections.Counter(a)
ans = 0
t=cnt.most_common()
if len(t) <= k:
    print(0)
    exit()
if 
for i in range(k):
    ans += t[i][1]
print(n - ans)
Problem p03502 (python)

Fixed submission:
n=int(input())
total=0
leave=n
for i in reversed(range(0,len(str(n)))):
    total+=int(leave/(10**i))
    leave=n%(10**i)
if n%total==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
total=0
leave=0
for i in range(len(str(n))-1,0,-1):
    total+=int(n/(10**i))
    leave=n%(10**i)
if n%total==0:
    print("Yes")
else:
    print("No")
Problem p03759 (python)

Fixed submission:
x=list(input().split())
x1=int(x[0])
x2=int(x[1])
x3=int(x[2])
if (x2-x1)==(x3-x2):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
x=list(input().split())
x1=int(x[0])
y1=int(x[1])
x2=int(x[2])
if (x2-x1)==(x3-x2):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
x=list(input().split())
x1=int(x[0])
y1=int(x[1])
x2=int(x[2])
if x2-x1==x3-x2:
  print('YES')
else:
  print('NO')
Problem p03860 (python)

Fixed submission:
title=list(input().split())
word=list(title[1])
print('A'+word[0]+'C')

Buggy submission (verdict: Runtime Error):
title=list(input.split())
word=list(title[1])
print('A'+word[0]+'C')
Problem p03023 (python)

Fixed submission:
n = int(input())
print(180*(n-2))

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
print(180*(n-2))
Problem p03651 (python)

Fixed submission:
import random
import fractions

def solve(N, K, A):
    gcd = A[0]
    for x in A:
        gcd = fractions.gcd(gcd, x)
    if K % gcd == 0 and max(A) >= K:
        return 'POSSIBLE'
    else:
        return 'IMPOSSIBLE'

def solve2(N, K, A):
    mx = max(A)
    B = [False] * (mx + 1)
    for i in A:
        B[i] = True
    while True:
        update = False
        for i in range(mx + 1):
            if not B[i]:
                continue
            for j in range(i + 1, mx + 1):
                if not B[j]:
                    continue
                d = abs(i - j)
                if not B[d]:
                    update = True
                    B[d] = True
        if not update:
            break
    return 'POSSIBLE' if K <= mx and B[K] else 'IMPOSSIBLE'

#for i in range(100000):
#    N = random.randint(1, 5)
#    K = random.randint(1, 20)
#    A = [random.randint(1, 20) for i in range(N)]
#    if solve(N, K, A) != solve2(N, K, A):
#        print(N, K, A)
#        print(solve(N, K, A))
#        print(solve2(N, K, A))
#        break

N, K = map(int, input().split())
A = list(map(int, input().split()))
print(solve(N, K, A))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
mn = min(*A)
mx = max(*A)
f = True
for x in A:
    if x % mn != 0:
        f = False
        break
if (f == False or K % mn == 0) and mx >= K:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = input()
a = []
for i in range(q):
    a.append(list(map(int, input().split())))
lis = [[0, 0]]
count = 0
for i in range(n):
    if s[i] == 'A':
        if i+1 <= n-1 and s[i+1] == 'C':
            count += 1
    lis.append([i+1, count])
for i in range(q):
    l = a[i][0] - 1
    r = a[i][1] - 1
    print(lis[r][1] - lis[l][1])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
a = []
for i in range(q):
    a.append(list(map(int, input().split())))
lis = [[0, 0]]
count = 0
for i in range(n):
    if s[i] == 'A':
        if i + 1 != n - 1 and s[i+1] == 'C':
            count += 1
    lis.append([i+1, count])
for i in range(q):
    l = a[i][0] - 1
    r = a[i][1] - 1
    print(lis[r][1] - lis[l][1])
Problem p03089 (python)

Fixed submission:
n = int(input())
b = list(map(int, input().split()))
ans = []
while(len(b) != 1):
    count = 0
    for i in range(len(b) - 1, -1, -1):
        if b[i] == i + 1:
            b.pop(i)
            ans.append(i + 1)
            count = 0
            break
        else:
            count += 1
    if count == len(b):
        print(-1)
        exit()
if b[0] == 1:
    ans.append(1)
    ans = list(reversed(ans))
    for i in range(len(ans)):
        print(ans[i])
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(str, input().split()))
''.join(b)
ans = []
def dfs(b):
    if len(b) == 1:
        if int(b[0]) == 1:
            return True
    else:
        f = 0
        for j in range(len(b)):
            if int(b[j]) != i + 1:
                f = 1
                break
        if f == 0:
            for j in range(len(b)):
                ans.append(b[j])
            return True

        for i in range(len(b) - 1, -1, -1):
            if int(b[i]) == i + 1:
                if i == 0:
                    if dfs(b[1:]):
                        ans.append(i + 1)
                        return True
                else:
                    if dfs(b[:i] + b[i+1:]):
                        ans.append(i + 1)
                        return True
        return False
if dfs(b):
    ans.insert(0, 1)
    for i in range(len(ans)):
        print(ans[i])
else:
    print(-1)
Problem p03109 (python)

Fixed submission:
s = input()
s = s.split('/')

for i in range(len(s)):
	s[i] = int(s[i])

if s[0] >= 2019:
	if s[1] >= 5:
		print('TBD')
		exit()
	else:
		print('Heisei')
		exit()
else:
	print('Heisei')
	exit()

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    if(s > "2019/04/30"){
        cout << "TBD" << "\n";
    }
    else{
        cout << "Heisei" << "\n";
    }
}
Problem p03112 (python)

Fixed submission:
import bisect

a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    lis = []
    lis.append(x - min(s[idxs - 1], t[idxt -1]))
    lis.append(x - s[idxs - 1] + (t[idxt] - s[idxs - 1]))
    lis.append(t[idxt] - x + (t[idxt] - s[idxs - 1]))
    lis.append(x - t[idxt - 1] + (s[idxs] - t[idxt - 1]))
    lis.append(s[idxs] - x + (s[idxs] - t[idxt - 1]))
    lis.append(max(s[idxs], t[idxt]) - x)
    ans.append(min(lis))
for i in range(q):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
import bisect
import sys
input = sys.stdin.readline
a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    ans.append(min(x - min(s[idxs - 1], t[idxt -1]),
                     x - s[idxs - 1] + (t[idxt] - s[idxs - 1]),
                     t[idxt] - x + (t[idxt] - s[idxs - 1]),
                     x - t[idxt - 1] + (s[idxs] - t[idxt - 1]),
                     s[idxs] - x + (s[idxs] - t[idxt - 1]),
                     max(s[idxs], t[idxt]) - x,
                     min(x - min(s[idxs - 1], t[idxt -1]))))
for i in range(q):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
import bisect
import sys
input = sys.stdin.readline
a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    ans.append(min(x - min(s[idxs - 1], t[idxt -1]),
                     x - s[idxs - 1] + (t[idxt] - s[idxs - 1]),
                     t[idxt] - x + (t[idxt] - s[idxs - 1]),
                     x - t[idxt - 1] + (s[idxs] - t[idxt - 1]),
                     s[idxs] - x + (s[idxs] - t[idxt - 1]),
                     max(s[idxs], t[idxt]) - x,
                     min(x - min(s[idxs - 1], t[idxt -1]))
for i in range(q):
    print(ans[i])
Problem p03136 (python)

Fixed submission:
num = int(input())
l = list(map(int, input().split()))
max = l.pop(l.index(max(l)))
sum = 0
for i in range(len(l)):
    sum = sum + l[i]
if sum <= max:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
num = int(input())
l = list(map(int, input().split()))
max = l.pop(max(l))
for i in range(len(l)):
    if max < l[i]:
        print('No')
        exit(0)
print('Yes')
Problem p03145 (python)

Fixed submission:
a, b, c = map(int, input().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print('%d' % a*b/2)
Problem p03213 (python)

Fixed submission:
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())
def comb(n, k):
    return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))

def era(n):
    lis = [i for i in range(3, n + 1, 2)]
    lis.insert(0, 2)
    for ll in lis:
        lis = [i for i in lis if (i == ll or i % ll != 0)]
    return lis


n = ni()
if n == 1:
    print(0)
    exit()
lis = era(n)
lis2 = [[lis[i], 0] for i in range(len(lis))]
for i in range(1, n + 1):
    for j in lis:
        count = 0
        while(i % j == 0):
            i //= j
            count += 1
        lis2[lis.index(j)][1] += count
c74 = 0
c24 = 0
c14 = 0
c4 = 0
c2 = 0
for i in range(len(lis2)):
    if lis2[i][1] >= 74:
        c74 += 1
    if lis2[i][1] >= 24:
        c24 += 1
    if lis2[i][1] >= 14:
        c14 += 1
    if lis2[i][1] >= 4:
        c4 += 1
    if lis2[i][1] >= 2:
        c2 += 1
ans = 0
ans += comb(c4, 2) * (c2 - 2)
ans += c24 * (c2 - 1)
ans += c14 * (c4 - 1)
ans += c74
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())
def comb(n, k):
    return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))

def era(n):
    lis = [i for i in range(3, n + 1, 2)]
    lis.insert(0, 2)
    for ll in lis:
        lis = [i for i in lis if (i == ll or i % ll != 0)]
    return lis


n = ni()
lis = era(n)
lis2 = [[lis[i], 0] for i in range(len(lis))]
for i in range(1, n + 1):
    for j in lis:
        count = 0
        while(i % j == 0):
            i //= j
            count += 1
        lis2[lis.index(j)][1] += count
c74 = 0
c24 = 0
c14 = 0
c4 = 0
c2 = 0
for i in range(len(lis2)):
    if lis2[i][1] >= 74:
        c74 += 1
    if lis2[i][1] >= 24:
        c24 += 1
    if lis2[i][1] >= 14:
        c14 += 1
    if lis2[i][1] >= 4:
        c4 += 1
    if lis2[i][1] >= 2:
        c2 += 1
ans = 0
ans += comb(c4, 2) * (c2 - 2)
ans += c24 * (c2 - 1)
ans += c14 * (c4 - 1)
ans += c74
print(ans)
Problem p03241 (python)

Fixed submission:
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
ans = 1
for i in range(1, int(math.sqrt(m)) + 2):
    if m % i == 0:
        if m // i >= n and i >= n:
            ans = max(ans, i, m // i)
        elif m // i >= n:
            ans = max(ans, i)
        elif i >= n:
            ans = max(ans, m // i)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
for i in range(2, n + 1):
    if m % i == 0 and m // i >= n:
        ans = i
print(ans)
Problem p03244 (python)

Fixed submission:
import collections

n = int(input())
v = list(map(int, input().split()))
odd = []
even = []
for i in range(0, n - 1, 2):
	odd.append(v[i])
	even.append(v[i + 1])
N = n // 2
co = collections.Counter(odd)
ce = collections.Counter(even)
omost = co.most_common(2)
emost = ce.most_common(2)
if len(omost) == 1 and len(emost) == 1:
	if omost[0][0] != emost[0][0]:
		print(0)
	else:
		print(N)
elif len(omost) == 1:
	print(N - emost[0][1])
elif len(emost) == 1:
	print(N - omost[0][1])
else:
	if omost[0][0] != emost[0][0]:
		print(n - omost[0][1] - emost[0][1])
	else:
		print(min(n - omost[0][1] - emost[1][1], n - omost[1][1] - emost[0][1]))

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
v = list(map(int, input().split()))
odd = []
even = []
for i in range(0, n - 1, 2):
	odd.append(v[i])
	even.append(v[i + 1])

co = collections.Counter(odd)
ce = collections.Counter(even)

if len(co) >= 2 and len(ce) >= 2:
	if co.most_common()[0][1] == ce.most_common()[0][1]:
		if co.most_common()[1][1] > ce.most_common()[1][1]:
			oddval = co.most_common()[1][0]
			evenval = ce.most_common()[0][0]
		else:
			oddval = co.most_common()[0][0]
			evenval = ce.most_common()[1][0]
	else:
		oddval = co.most_common()[0][0]
		evenval = ce.most_common()[0][0]

if len(co) == 1 and len(ce) >= 2:
	if ce.most_common()[0][0] != odd[0]:
		oddval = odd[0]
		evenval = ce.most_common()[0][0]
	else:
		oddval = odd[0] + 1
		evenval = ce.most_common()[0][0]

if len(ce) >= 2 and len(ce) == 1:
	if co.most_common()[0][0] != even[0]:
		evenval = even[0]
		oddval = co.most_common()[0][0]
	else:
		evenval = even[0] + 1
		oddval = co.most_common()[0][0]

if len(co) == 1 and len(ce) == 1:
	if odd[0] != even[0]:
		oddval = odd[0]
		evenval = even[0]
	else:
		oddval = odd[0] + 1
		evenval = even[0]


count = 0
for i in range(0, n - 1, 2):
	count += abs(oddval - v[i]) + abs(evenval - v[i + 1])

print(count)
Problem p03251 (python)

Fixed submission:

n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)

for i in range(len(x)):
	for j in range(len(y)):
		if (x[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')

Buggy submission (verdict: Runtime Error):

n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(y)

for i in range(len(x)):
	for j in range(i, len(x)):
		if (x[i] == y[j]) or (y[i] == x[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i])
else:
    print(1)

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

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i + 1])
else:
    print(1)

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

for i in range(1, len(s) + 1):
    if s[i - 1] == '1':
        continue
    else:
        break
if i == 1:
    print(s[0])
elif i >= k:
    print(1)
else:
    print(s[k])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
if s[0] == '1':
    print(s[1])
else:
    print(s[0])
Problem p03399 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a + c, a + d, b + c, b + d))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a + c, a + s, b + c, b + d))
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

comb = []
count = 0

for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
                comb.append([i, j, k])
for i in range(len(comb)):
    if (x == 500*comb[i][0] + 100*comb[i][1] + 50*comb[i][2]) and \
        (a >= comb[i][0]) and (b >= comb[i][1]) and (c >= comb[i][2]):
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
Count = 0
while(1):
    count = 0
    for i in range(n):
        if a[i] % 2 == 0:
            count += 1
    if count != n:
        break
    for i in range(n):
        a[i] /= 2
    Count += 1
print(Count)
Problem p03477 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if a + b == c + d:
    print('Balanced')
elif a + b < c + d:
    print('Right')
else:
    print('Left')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input())
if a + b == c + d:
    print('Balanced')
elif a + b < c + d:
    print('Right')
else:
    print('Left')
Problem p03547 (python)

Fixed submission:
x, y = map(str, input().split())
if x == y:
    print('=')
elif x > y:
    print('>')
else:
    print('<')

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
if x == y:
    print('=')
elif x > y:
    print('>')
else:
    print('<')
Problem p03599 (python)

Fixed submission:
a, b, c, d, e, f = map(int, input().split())
ans = []
for ai in range(31):
    bb = (f - (ai * a * 100)) // b
    for bi in range(bb + 1):
        if ai == bi == 0:
            continue
        cc = (f - (ai * a * 100 + bi * b * 100)) // c
        for ci in range(cc + 1):
            dd = (f - (ai * a * 100 + bi * b * 100 + ci * c)) // d
            for di in range(dd + 1):
                if 100 * a * ai + 100 * b * bi + c * ci + d * di <= f:
                    if (c * ci + d * di)/(100 * a * ai + 100 * b * bi) <= e/100:
                        ans.append([(c * ci + d * di)/(100 * a * ai + 100 * b * bi + c * ci + d * di), 100 * a * ai + 100 * b * bi + c * ci + d * di, c * ci + d * di])
ans.sort(reverse=True)
print(ans[0][1], ans[0][2])

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, f = map(int, input().split())
ans = []
for ai in range(31):
    bb = (f - (ai * a * 100)) // b
    for bi in range(bb):
        if ai == bi == 0:
        continue
        cc = (f - (ai * a * 100 + bi * b * 100)) // c
        for ci in range(cc):
            dd = (f - (ai * a * 100 + bi * b * 100 + ci * c)) // d
            for di in range(dd):
                if 100 * a * ai + 100 * b * bi + c * ci + d * di <= f:
                    if (c * ci + d * di)/(100 * a * ai + 100 * b * bi) <= e/100:
                        ans.append([(c * ci + d * di)/(100 * a * ai + 100 * b * bi + c * ci + d * di), 100 * a * ai + 100 * b * bi + c * ci + d * di, c * ci + d * di])
ans.sort(reverse=True)
print(ans[0][1], ans[0][2])
Problem p03633 (python)

Fixed submission:
import sys
import fractions
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

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

n = ni()
t = ni()
if n == 1:
    print(t)
else:
    for i in range(n - 1):
        tmp = ni()
        t = lcm(t, tmp)
    print(t)

Buggy submission (verdict: Runtime Error):
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

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

n = ni()
t = ni()
if n == 1:
    print(t)
else:
    for i in range(n - 1):
        tmp = ni()
        t = lcm(t, tmp)
    print(t)