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

Fixed submission:
c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = [1,2,3]
c.remove(a)
c.remove(b)

print(c[0])

Buggy submission (verdict: Runtime Error):
c = [1,2,3]

a　= int(input())
b　= int(input())

c.remove(a)
c.remove(b)

c[0]

Buggy submission (verdict: Runtime Error):
c = [1,2,3]

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

c.remove(a)
c.remove(b)

c[0]

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
 
if a!=3 && b!=3:
  c = 3
elif a!=2 && b!=2:
  c = 2
elif a!=1 && b!=1:
  c = 1
  
print("{}".format(c))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())

if a==1 && b==2:
  c = 3
elif a==2 && b==1:
  c = 3
elif a==1 && b==3:
  c = 2
elif a==3 && b==1:
  c = 2
else:
  c = 1
  
print("{}".format(c))
Problem p02682 (python)

Fixed submission:
A,B,C,K=map(int, input().split(' '))
ans = 0
if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    print(A - (K-A-B))

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int, input().split(' '))
A_array, B_array, C_array, cards = [1] * A, [0] * B, [-1] * C, []
cards.extend(A_array)
cards.extend(B_array)
cards.extend(C_array)
total = 0
for _ in range(K):
    tmp = max(cards)
    total += tmp
    cards.remove(tmp)

print(total)
Problem p03250 (python)

Fixed submission:

lst_A = input().split()

lst_A.sort()

ans = int(lst_A[2]) * 10 + int(lst_A[0]) + int(lst_A[1])

print(ans)

Buggy submission (verdict: Runtime Error):

A = input()

lst_A = list(A)

lst_A.sort()

ans = int(lst_A[2]) * 10 + int(lst_A[0]) + int(lst_A[1])

print(ans)
Problem p02570 (python)

Fixed submission:
import sys

try:
    #d = int(input('D: '))
    #t = int(input('T: '))
    #s = int(input('S: '))
    nums = [int(e) for e in input().split()]
except ValueError:
    print('エラー：整数以外を入力しないでください')
    sys.exit(1)

if 1 <= nums[0] <= 10000 and 1 <= nums[1] <= 10000 and 1 <= nums[2] <= 10000:
    take_time = nums[0] / nums[2]
    if take_time <= nums[1]:
        print("Yes")
    else:
        print("No")
else:
    print('エラー：各入力は1～10000までの整数です')

Buggy submission (verdict: Runtime Error):
import sys

try:
    d = int(input('D: '))
    t = int(input('T: '))
    s = int(input('S: '))
except ValueError:
    print('エラー：整数以外を入力しないでください')
    sys.exit(1)

if 1 <= d <= 10000 and 1 <= t <= 10000 and 1 <= s <= 10000:
    take_time = d / s
    if take_time <= t:
        print("Yes")
    else:
        print("No")
else:
    print('エラー：各入力は1～10000までの整数です')
Problem p02570 (python)

Fixed submission:
def ans():
    if t==0:
        return "N0"
    if d/s <= t:
        return "Yes"
    else:
        return "No"
        
d, t, s = map(int, input().split())
print(ans())

Buggy submission (verdict: Runtime Error):
def ans():
    if t==0:
        return "N0"
    if d/s < = t:
        return "Yes"
    else:
        return "No"
        
d, t, s = map(int, input().split())
print(ans())
Problem p02570 (python)

Fixed submission:
string_list = input().split(' ')
D = int(string_list[0])
T = int(string_list[1])
S = int(string_list[2])
kyori = T * S
if D<=kyori:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
string_list = split(input())
D = int(string_list[0])
T = int(string_list[1])
S = int(string_list[2])
kyori = T * S
if D<=kyori:
  print('Yes')
else:
  print('No')
Problem p02570 (python)

Fixed submission:
D,T,S = map(int, input().split())

if (D/S)<=T:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
D=int(input('D='))
T=int(input('T='))
S=int(input('S='))

if (D/S)<=T:
    print('Yes')
else:
    print('No')
Problem p02912 (python)

Fixed submission:
import heapq
# import collection
# import bisect
# import numpy

N, M = list(map(int, input().split()))
# A = list(map(int, input().split()))

# N = 10**5
# A = [10 for i in range(10**5)]
# M = 10**5

# A = sorted(A)
A = []
for i in input().split():
    heapq.heappush(A, -int(i))

while M > 0:
    heapq.heappush(A, -((-heapq.heappop(A))//2))
    M -= 1

print(-sum(A))

Buggy submission (verdict: Runtime Error):
# import heapq
# import collection
# import bisect
import numpy


def binary_search(arry, target):
    result = None
    left = 0
    right = len(arry) - 1

    while left <= right:
        mid = (left + right) // 2
        if arry[mid] == target:
            result = mid
            break
        elif arry[mid] > target:
            right = mid - 1
        else:
            left = mid + 1

    # print(left, right)
    if result is None:
        return left
    else:
        return result


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

A = sorted(A)

# A = [i for i in range(10**5)]
# M = 10**5

while M > 0:
    index = binary_search(A, A[N-1] // 2)
    for i in range(index+1):
        if M <= 0:
            break
        A[N-1-i] = A[N-1-i] // 2
        M -= 1

print(numpy.sum(A))
Problem p02933 (python)

Fixed submission:

import sys

input = sys.stdin.readline

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    a = int(input())
    s = input()

    if a >= 3200:
        print(s)
    else:
        print('red')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

import sys

input = sys.stdin.readline

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    a = int(input())
    s = int(input())

    if a >= 3200:
        print(s)
    else:
        print('red')


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

Fixed submission:

import sys
from collections import deque

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    BLACK = '#'
    WHITE = '.'
    H, W = map(int, input().split())
    graph = [None] * H
    # w_score = [[0 for i in range(W)] for i in range(H)]
    # h_score = [[0 for i in range(W)] for i in range(H)]
    options = [(-1, 0), (0, 1), (1, 0), (0, -1)]
    visited = [[False for i in range(W)] for i in range(H)]
    initial = []

    for i in range(H):
        graph[i] = list(input())

        for j in range(W):
            if graph[i][j] == BLACK:
                initial.append((i, j))
                visited[i][j] = True

    # print(visited)
    # print(graph)

    q = deque()
    q.append(initial)
    ans = 0
    while len(q) != 0:
        n = q.popleft()
        # print(ans, n)

        items = set()
        for p in n:
            for d in options:
                i = p[0] + d[0]
                j = p[1] + d[1]

                if i >= 0 and i < H and j >= 0 and j < W and not visited[i][j] and graph[i][j] == WHITE:
                    visited[i][j] = True
                    graph[i][j] = BLACK
                    items.add((i, j))
                # else:
                #     print(i, j)

        if len(items) > 0:
            ans += 1
            q.append(items)

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

import sys
from collections import deque

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    BLACK = '#'
    WHITE = '.'
    H, W = map(int, input().split())
    graph = [None] * H
    # w_score = [[0 for i in range(W)] for i in range(H)]
    # h_score = [[0 for i in range(W)] for i in range(H)]
    options = [(-1, 0), (0, 1), (1, 0), (0, -1)]
    visited = [[False for i in range(W)] for i in range(H)]
    initial = []

    for i in range(H):
        graph[i] = list(input())

        for j in range(W):
            if graph[i][j] == BLACK:
                initial.append((i, j))
                visited[i][j] = True

    q = deque()
    q.append(initial)
    ans = 0
    while len(q) != 0:
        n = q.popleft()
        # print(ans, n)

        items = set()
        for p in n:
            for d in options:
                i = p[0] + d[0]
                j = p[1] + d[1]

                if i >= 0 and i < W and j >= 0 and j < H and not visited[i][j] and graph[i][j] == WHITE:
                    visited[i][j] = True
                    graph[i][j] = BLACK
                    items.add((i, j))
                # else:
                #     print(i, j)

        if len(items) > 0:
            ans += 1
            q.append(items)

    print(ans)


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

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A = sorted(A)

    while True:
        v = A[0]
        tmp = [v]
        for i in range(len(A)):
            if A[i] % v == 1:
                print(1)
                return
            if A[i] % v == 0:
                pass
            else:
                tmp.append(A[i] % v)

        if len(A) == 1:
            print(A[0])
            return

        A = sorted(tmp)
        # print(A)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import fractions

# N個の最大公約数
# ユークリッド互除法


def good(A):
    ans = A[0]
    for i in range(1, N):
        ans = fractions.gcd(A[1], ans)
    print(ans)


def my(A):
    A = sorted(A)

    while True:
        v = A[0]
        tmp = [v]
        for i in range(len(A)):
            if A[i] % v == 1:
                print(1)
                return
            if A[i] % v == 0:
                pass
            else:
                tmp.append(A[i] % v)

        if len(A) == 1:
            print(A[0])
            return

        A = sorted(tmp)
        # print(A)


def main():
    N = int(input())
    A = list(map(int, input().split()))

    good(A)


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

Fixed submission:
IINF = 10 ** 18


def main():
    N, M = list(map(int, input().split()))
    X = list(map(int, input().split()))
    X = sorted(X)
    # left = -IINF
    # right = IINF

    # print(M, N)
    if M <= N:
        print(0)
        return
    else:
        L = []
        for i in range(M-1):
            L.append(X[i+1]-X[i])

        # print(L)

        L.sort()
        if N == 1:
            ans = sum(L)
            print(ans)
        else:
            ans = sum(L[0:-(N-1)])
            print(ans)

    # for i in range(N):
    #     if len(X) == 0:
    #         break
    #     elif i == 0:
    #         left = X[0]
    #         X.pop(0)
    #     elif i == 1:
    #         right = X[-1]
    #         X.pop(len(X)-1)
    #     else:
    #         if abs(X[1] - X[-1]) < abs(X[-2] - X[0]):
    #             left = X[0]
    #             X.pop(0)
    #         else:
    #             right = X[-1]
    #             X.pop(-1)

    # ans = 0
    # while len(X) > 0:
    #     # print(ans, X)
    #     if abs(left - X[0]) < abs(right - X[-1]):
    #         ans += abs(left - X[0])
    #         left = X[0]
    #         X.pop(0)
    #     else:
    #         ans += abs(right - X[-1])
    #         right = X[-1]
    #         X.pop(len(X)-1)
    #     # b = min(abs(left - X[0]), abs(right - X[-1]))
    #     # print(b, X)
    #     # print(abs(X[0] - X[-1]) + b)
    # print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
IINF = 10 ** 18


def main():
    N, M = list(map(int, input().split()))
    X = list(map(int, input().split()))
    X = sorted(X)
    left = -IINF
    right = IINF

    for i in range(N):
        if len(X) == 0:
            break
        elif i == 0:
            left = X[0]
            X.pop(0)
        elif i == 1:
            right = X[-1]
            X.pop(len(X)-1)
        else:
            if abs(X[1] - X[-1]) < abs(X[-2] - X[0]):
                left = X[0]
                X.pop(0)
            else:
                right = X[-1]
                X.pop(-1)

    ans = 0
    while len(X) > 0:
        # print(ans, X)
        if abs(left - X[0]) < abs(right - X[-1]):
            ans += abs(left - X[0])
            left = X[0]
            X.pop(0)
        else:
            ans += abs(right - X[-1])
            right = X[-1]
            X.pop(len(X)-1)
        # b = min(abs(left - X[0]), abs(right - X[-1]))
        # print(b, X)
        # print(abs(X[0] - X[-1]) + b)
    print(ans)


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

Fixed submission:
item = input()
if "7" in item:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
item = input()
if 7 in item:
  print("Yes")
else:
  print("No")
Problem p02571 (python)

Fixed submission:
S=list(input())
T=list(input())
A=[]
for i in range(len(S)-len(T)+1):
    B=0
    for j in range(len(T)):
        if T[j]==S[i+j]:
            continue
        else:
            B =B+1
    A.append(B)

A.sort()
print(A[0])

Buggy submission (verdict: Runtime Error):
S=list(input())
T=list(input())
A=[]
for i in range(len(S)-len(T)):
    B=0
    for j in range(len(T)):
        if T[j]==S[i+j]:
            continue
        else:
            B =B+1
    A.append(B)

A.sort()
print(A[0])
Problem p02570 (python)

Fixed submission:
import sys
input = sys.stdin.readline
 
############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))#might need to remove the -1
def invr():
    return(map(int,input().split()))

d, t, s = invr()

if d/s<=t:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))#might need to remove the -1
def invr():
    return(map(int,input().split()))

if s*d<=t:
	print('Yes')
else:
	print('No')
Problem p02571 (python)

Fixed submission:
S, T = [input() for x in range(2)]
max_match_len = 0

for i in range(len(S)):
  if len(S) - len(T) < i:
    break
  compare_s = S[i:i+len(T)]
  match_len = 0
  for j in range(len(T)):
    if compare_s[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(len(T) - max_match_len)

Buggy submission (verdict: Runtime Error):
for i in range(len(S)-lenT+1):
  compareS = S[i:i+lenT]
  match_len = 0
  for j in range(lenT):
    if compareS[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(lenT - max_match_len)
Problem p03250 (python)

Fixed submission:
a,b,c = map(int, input().split())
print(9 * max(a,b,c) + a+b+c)

Buggy submission (verdict: Runtime Error):
def factorial(n):
	fact = 1
	while n > 0:
		fact *= n
		n -= 1
	return fact
	
def combination(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

n, m = map(int, input().split())
n_def = n
natural = list(range(2,320))
index = 0
while index < len(natural):
	for number in natural:
		if number % natural[index] == 0 and number / natural[index] != 1:
			natural.remove(number)
	index += 1
prime = natural

prime_division = {}
index = 0
number_prime = 0
while prime[index] <= m:
	if m % prime[index] == 0:
		m /= prime[index]
		number_prime += 1
		continue		
	else:
		prime_division[prime[index]] = number_prime
		number_prime = 0
		index += 1
else:
	prime_division[prime[index]] = number_prime

list_division = list(prime_division.values())
ans = 1
for i in list_division:
	ans *= combination(i+n-1,n-1)
print(int(ans%(10**9 + 7)))
Problem p03307 (python)

Fixed submission:
n = int(input())
if n%2==0:
  print(n)
else:
  print(n*2)

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <string>
#include <fstream>
#include <cmath>

using namespace std;

int main() {
    

    int n;
    cin >> n;
    if (n%2 == 0){
        cout << n << endl;
    }else{
        cout << 2 * n << endl;
    }


}
Problem p03617 (python)

Fixed submission:
q,h,s,d = map(int, input().split())
n = int(input())
q_perf = q / 0.25
h_perf = h / 0.5
s_perf = s
d_perf = d / 2
list_amo = [0.25,0.5,1,2]
list_price = [q,h,s,d]
list_perf = [q_perf,h_perf,s_perf,d_perf]
cost = 0
ind4 = list_perf.index(min(list_perf))
ind3 = list_perf.index(min(list_perf[0:3]))
ind2 = list_perf.index(min(list_perf[0:2]))
ind1 = list_perf.index(min(list_perf[0:1]))

while n >= 2:
    cost += int((n//list_amo[ind4]) *  int(list_price[ind4]))
    n -= (n//list_amo[ind4]) * list_amo[ind4]
while n >= 1:
    cost += int((n//list_amo[ind3]) *  int(list_price[ind3]))
    n -= (n//list_amo[ind3]) * list_amo[ind3]
while n >= 0.5:
    cost += int((n//list_amo[ind2]) *  list_price[ind2])
    n -= (n//list_amo[ind2]) * list_amo[ind2]

while n >= 0.25:
    cost += int((n//list_amo[ind1]) *  list_price[ind1])
    n -= (n//list_amo[ind1]) * list_amo[ind1]

print(int(cost))

Buggy submission (verdict: Runtime Error):
q,h,s,d = map(int, input().split())
n = int(input())
q_perf = q / 0.25
h_perf = h / 0.5
s_perf = s
d_perf = d / 2
list_amo = [0.25,0.5,1.0,2.0]
list_price = [q,h,s,d]
list_perf = [q_perf,h_perf,s_perf,d_perf]
cost = 0
ind4 = list_perf.index(min(list_perf))
ind3 = list_perf.index(min(list_perf[0:3]))
ind2 = list_perf.index(min(list_perf[0:2]))
ind1 = list_perf.index(min(list_perf[0:1]))

while n >= 2:
    cost += int((n//int(list_amo[ind4])) *  int(list_price[ind4]))
    n -= (n//list_amo[ind4]) * list_amo[ind4]

while n >= 1:
    cost += int((n//int(list_amo[ind3])) *  int(list_price[ind3]))
    n -= (n//list_amo[ind3]) * list_amo[ind3]
while n >= 0.5:
    cost += int((n//list_amo[ind2]) *  list_price[ind2])
    n -= (n//list_amo[ind2]) * list_amo[ind2]

while n >= 0.25:
    cost += int((n//list_amo[ind1]) *  list_price[ind1])
    n -= (n//list_amo[ind1]) * list_amo[ind1]

print(int(cost))
Problem p03804 (python)

Fixed submission:
n,m = map(int, input().split())
list_a = []
list_b = []
count = 0
while count < n:
    list_a.append(list(str(input())))
    count += 1
count = 0
while count < m:
    list_b.append(list(str(input())))
    count += 1
#print(list_a)
#print(list_b)[
phase = 0
if list_a != list_b:
    for i in range(0, n-m):
        for j in range(0, n-m):
            for k in range(0,m):
                if list_a[i+k][j:j+m] == list_b[k]:
                    if k != m-1:
                        continue
                    else:
                        pass
                else:
                    break
                phase = 1
                print("Yes")
                break
            if phase == 1:
                break
        if phase == 1:
            break
    else:
        print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
phase = 0
if list_a != list_b:
    for i in range(0, n-m):
        for j in range(0, n-m):
            for k in range(0,m):
                if list_a[i+k][j:j+m] == list_b[k]:
                    if k != m-1:
                        continue
                    else:
                        pass
                else:
                    break
                phase = 1
                print("Yes")
                break
            if phase == 1:
                break
        if phase == 1:
            break
    else:
        print("No")
else:
    print("Yes")
Problem p02912 (python)

Fixed submission:
import math
from heapq import heappush, heappop

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

a = list(map(int, input().split(' ')))

h = []

for i in a:
    heappush(h, -i)

for i in range(m):
    v = heappop(h)
    heappush(h, -(-v // 2))

print(-sum(h))

Buggy submission (verdict: Runtime Error):
import math
from heapq import heappush, heappop

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

a = list(map(int, input().split(' ')))

h = []

for i in a:
    heappush(h, -i)

for i in range(m):
    v = heappop(h)
    heappush(h, -(-v // 2))
    print(h)

print(-sum(h))
Problem p02990 (python)

Fixed submission:
import math

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

ans_list = []

def C(x, y):
    return math.factorial(x) // math.factorial(x - y) // math.factorial(y)

def calc(n, k, t):
    return C(n - k + 1, t) * C(k - 1, t - 1) % (10 ** 9 + 7)

for i in range(1, k + 1):
    
    if n - k <= 0:
        if len(ans_list) == 0:
            ans_list.append(1)
        else:
            ans_list.append(0)
    else:
        if i > (n - k + 1):
            if len(ans_list) == 0:
                ans_list.append(1)
            else:
                ans_list.append(0)
        else:
            ans_list.append(calc(n, k, i))

for i in ans_list:
    print(i)

Buggy submission (verdict: Runtime Error):
import math

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

ans_list = []

def C(x, y):
    return math.factorial(x) // math.factorial(x - y) // math.factorial(y)

def calc(n, k, t):
    return C(n - k + 1, t) * C(k - 1, t - 1) % (10 ** 9 + 7)

for i in range(1, k + 1):
    if (n - k + 2) >= i and (n - k) > 0:
        ans_list.append(calc(n, k, i))
    else:
        if len(ans_list) > 0:
            ans_list.append(ans_list[-1])
        else:
            ans_list.append(1)

for i in ans_list:
    print(i)

Buggy submission (verdict: Runtime Error):
import math

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

ans_list = []

def C(x, y):
    return math.factorial(x) // math.factorial(x - y) // math.factorial(y)

def calc(n, k, t):
    return C(n - k + 1, t) * C(k - 1, t - 1) % (10 ** 9 + 7)

for i in range(1, k + 1):
    if (n - k + 2) >= i:
        ans_list.append(calc(n, k, i))
    else:
        ans_list.append(ans_list[-1])

for i in ans_list:
    print(i)

Buggy submission (verdict: Runtime Error):
import math

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

def C(x, y):
    return math.factorial(x) // math.factorial(x - y) // math.factorial(y)

def calc(n, k, t):
    return C(n - k + 1, t) * C(k - 1, t - 1) % (10 ** 9 + 7)

for i in range(1, k + 1):
    print(calc(n, k, i))

Buggy submission (verdict: Runtime Error):
import math

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

def C(x, y):
    return math.factorial(x) // math.factorial(x - y) // math.factorial(y)

def calc(n, k, t):
    return C(n - k + 1, t) * C(k - 1, t - 1) % (10 ** 9 + 7)

for i in range(1, k + 1):
    print(calc(n, k, i))

Buggy submission (verdict: Runtime Error):
import math

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

def C(x, y):
    return math.factorial(x) // math.factorial(x - y) // math.factorial(y)

def calc(n, k, t):
    return C(n - k + 1, t) * C(k - 1, t - 1) % (10 ** 9 + 7)

for i in range(1, k + 1):
    print(calc(n, k, i))
Problem p03767 (python)

Fixed submission:
input_lines = str(input())
input_lines2 = str(input())

n = int(input_lines)
aAry = input_lines2.split(' ')
aAry = map(int,aAry)
aAry = sorted(aAry)
#print(aAry)

answer1 = 0
for i in range(n):
    answer1 += int(aAry[(-i-1)*2])
'''
answer2 = 0
for i in range(n):
    answer2 += int(aAry[-i-3])

if answer1 >= answer2:
    answer = answer1
else:
    answer = answer2
'''
print(answer1)

Buggy submission (verdict: Runtime Error):
input_lines = str(input())
input_lines2 = str(input())

n = int(input_lines)
aAry = input_lines2.split(' ')
aAry = map(int,aAry)
aAry = sorted(aAry)
#print(aAry)

answer1 = 0L
for i in range(n):
    answer1 += int(aAry[(-i-1)*2])

answer2 = 0L
for i in range(n):
    answer2 += int(aAry[-i-3])

if answer1 >= answer2:
    answer = answer1
else:
    answer = answer2
print(answer)
Problem p03307 (python)

Fixed submission:
N =int(input())
l = N * 2
if N % 2 == 0:
    print(N)
else:
    print(N*2)
# if 2 * N % 0 and N * N % 0

Buggy submission (verdict: Runtime Error):
xN =int(input())
l = N * 2
if N % 2 == 0:
    print(N)
else:
    print(N*2)
Problem p03315 (python)

Fixed submission:
S = input()
Steam = 0
minecraft = 0
for i in range(len(S)):
    if S[i] == "+":
        minecraft += 1
    else:
        Steam += 1
L = minecraft * 1
P = Steam * -1
print(L + P)

Buggy submission (verdict: Runtime Error):
S = input()
Steam = 0
minecraft = 0
for i in range()len(S):
    if S[i] == "+":
        minecraft += 1
    else:
        Steam += 1
L = minecraft * 1
P = Steam * -1
print(L + P)

Buggy submission (verdict: Runtime Error):
S = input()
Steam = 0
mincraft = 0
for i in range()len(S):
    if S[i] == "+":
        minecraft += 1
    else:
        steam += 1
L = minecraft * 1
P = steam * -1
print(L + P)