TnT/CodeNet4Repair huggingface dataset:
Problem:
Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:                 for i = 1 to A.length-1     key = A[i]     /* insert A[i] into the sorted sequence A[0,...,j-1] */     j = i - 1     while j >= 0 and A[j] > key         A[j+1] = A[j]         j--     A[j+1] = key   Note that, indices for array elements are based on 0-origin.  To illustrate the algorithms, your program should trace intermediate result for each step.

Incorrect submission (verdict: Wrong Answer):
def insertionSort(A,N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print(' '.join([str(a) for a in A]))

def run():
    N = int(input())
    A = [int(i) for i in input().split()]
    insertionSort(A,N)

if __name__ == '__main__':
    run()


Fixed, accepted submission:
def insertionSort(A,N):
    print(' '.join([str(a) for a in A]))
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print(' '.join([str(a) for a in A]))

def run():
    N = int(input())
    A = [int(i) for i in input().split()]
    insertionSort(A,N)

if __name__ == '__main__':
    run()
Problem:
We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not.  You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S. It is guaranteed that such a non-empty string exists for a given input.

Incorrect submission (verdict: Wrong Answer):
#s = list(input())
s = input()
n = len(s)
count = 0   

if n % 2 == 1:
    count += 1

while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2

print(count)


Fixed, accepted submission:
#s = list(input())
s = input()
n = len(s)
count = 1   
 
if n % 2 == 1 - count:
    count += 1
 
while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2
 
print(n-count)
Problem:
We have a tree with N vertices numbered 1 to N. The i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i. Your objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:    * For any two vertices painted in the same color, the distance between them is an even number.  Find a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.

Incorrect submission (verdict: Wrong Answer):
from collections import deque

N = int(input())
branch = [list(map(int, input().split())) for _ in range(N-1)]

adj = [[] for _ in range(N+1)]
for b in branch:
  adj[b[0]].append([b[1],b[2]])
  adj[b[1]].append([b[0],b[2]])

ans = [-1] * (N+1)
deq = deque()
deq.appendleft(1)
while len(deq) > 0:
  v = deq.pop()
  for u, w in adj[v]:
    if ans[u] == -1:
      deq.appendleft(u)
    if ans[v] == -1 and ans[u] == -1:
      if w % 2 == 0:
        ans[v] = 0
        ans[u] = 0
      else:
        ans[v] = 0
        ans[u] = 1
    elif ans[v] == 0:
      if w % 2 == 0:
        ans[u] = 0
      else:
        ans[u] = 1
    else:
      if w % 2 == 0:
        ans[u] = 1
      else:
        ans[u] = 0
print(ans[1:])

Fixed, accepted submission:
from collections import deque

N = int(input())
branch = [list(map(int, input().split())) for _ in range(N-1)]

adj = [[] for _ in range(N+1)]
for b in branch:
  adj[b[0]].append([b[1],b[2]])
  adj[b[1]].append([b[0],b[2]])

ans = [-1] * (N+1)
deq = deque()
deq.appendleft(1)
while len(deq) > 0:
  v = deq.pop()
  for u, w in adj[v]:
    if ans[u] == -1:
      deq.appendleft(u)
    if ans[v] == -1 and ans[u] == -1:
      if w % 2 == 0:
        ans[v] = 0
        ans[u] = 0
      else:
        ans[v] = 0
        ans[u] = 1
    elif ans[v] == 0:
      if w % 2 == 0:
        ans[u] = 0
      else:
        ans[u] = 1
    else:
      if w % 2 == 0:
        ans[u] = 1
      else:
        ans[u] = 0
if N == 1:
  print(0)
else:
  for i in range(1,N+1):
    print(ans[i])
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
import math
n=int(input())
print(math.ceil(n)-n)

Fixed, accepted submission:
import math
n=int(input())
k=(math.ceil(n/1000)*1000-n)
print(k)
Problem:
Given an integer N not less than 3, find the sum of the interior angles of a regular polygon with N sides.  Print the answer in degrees, but do not print units.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
print((n-2)*180//2)

Fixed, accepted submission:
n=int(input())
print((n-2)*180)
Problem:
Write a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.

Incorrect submission (verdict: Wrong Answer):
second = int(input())
h = second // 360
m = (second % 360) // 60
s = (second % 360) % 60
print(str(h) + ':' + str(m) + ':' + str(s))


Fixed, accepted submission:
second = int(input())
h = second // 3600
m = (second % 3600) // 60
s = (second % 3600) % 60
print(str(h) + ':' + str(m) + ':' + str(s))
Problem:
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.  Assume that initially no person lives in the building.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
public_hall = [[[],[],[]],[[],[],[]],[[],[],[]],[[],[],[]]]
input_info = []

for b in range(4):
    for f in range(3):
        for r in range(10):
            public_hall[b][f].append(0)


for i in range(n):
    input_info.append(input().split())
    input_info[i] = list(map(int, input_info[i]))


for j in range(n):
    public_hall[input_info[j][0] - 1][input_info[j][1] - 1][input_info[j][2] - 1] += input_info[j][3]

# ??????
for k in range(4):
    for l in range(3):
        for m in range(10):
            print('', public_hall[k][l][m],end='')
        print()
    for n in range(20):
        print('#',end='')
    print()

Fixed, accepted submission:
n = int(input())
public_hall = [[[],[],[]],[[],[],[]],[[],[],[]],[[],[],[]]]
input_info = []

for b in range(4):
    for f in range(3):
        for r in range(10):
            public_hall[b][f].append(0)

for i in range(n):
    input_info.append(input().split())
    input_info[i] = list(map(int, input_info[i]))

for j in range(n):
    public_hall[input_info[j][0] - 1][input_info[j][1] - 1][input_info[j][2] - 1] += input_info[j][3]

for k in range(4):
    for l in range(3):
        for m in range(10):
            print('', public_hall[k][l][m],end='')
        print()
    if k != 3:
        print('#' * 20)
Problem:
You are given a string S of length N. Among its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.  Here, a subsequence of a string is a concatenation of **one or more** characters from the string without changing the order.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
s=input()
c=[0]*26
x=10**9+7

ans=0
for chr in range(n):
    c[ord(s[chr])-97]+=1
for i in range(26):
    ans=((ans%x)*((c[i]+1)%x))%x
    ans+=c[i]
    ans%=x
print(ans,c)

Fixed, accepted submission:
n=int(input())
s=input()
c=[0]*26
x=10**9+7

ans=0
for chr in range(n):
    c[ord(s[chr])-97]+=1
for i in range(26):
    ans=((ans%x)*((c[i]+1)%x))%x
    ans+=c[i]
    ans%=x
print(ans)
Problem:
Takahashi loves numbers divisible by 2.  You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.  Here, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.  For example,    * 6 can be divided by 2 once: 6 -> 3.   * 8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.   * 3 can be divided by 2 zero times.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
num = 1

while num < N:
  num *= 2

print(num) 

Fixed, accepted submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np

N = int(input())

maxi_num = 0
ans = 1

def div_count(x):
    num = 0
    while True:
        if x % 2 == 0:
            x /= 2
            num += 1
        else:
            break
    
    return num

for i in range(1, N+1):
    count = div_count(i)
    if maxi_num < count:
        maxi_num = count
        ans = i

print(ans)
Problem:
Find the largest square number not exceeding N. Here, a _square number_ is an integer that can be represented as the square of an integer.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
ans = 1
for i in range(1,n+1):
  if i**(1/2) == int(i**(1/2)):
    ans = 1
print(i)
  

Fixed, accepted submission:
n = int(input())
print(int(n**(0.5))**2)
Problem:
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive.  Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him.

Incorrect submission (verdict: Wrong Answer):
a, b, c = map(int, input().split())
count = 1
if a != b:
    count += 1
if b != c:
    count += 1
if c != a:
    count += 1
print(count)


Fixed, accepted submission:
a, b, c = map(int, input().split())
count = 1
if a != b:
    count += 1
if b != c and c != a:
    count += 1
print(count)
Problem:
You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order.

Incorrect submission (verdict: Wrong Answer):
s=sorted(input())
t=sorted(input(), reverse=True)
print('YES' if s<t else 'NO')

Fixed, accepted submission:
s=sorted(input())
t=sorted(input(), reverse=True)
print('Yes' if s<t else 'No')
Problem:
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?

Incorrect submission (verdict: Wrong Answer):
m=int(input())
x=24+(24-m)
print(m)


Fixed, accepted submission:
m=int(input())
x=24+(24-m)
print(x)
Problem:
You are given a positive integer X. Find the largest _perfect power_ that is at most X. Here, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.

Incorrect submission (verdict: Time Limit Exceeded):
X = int(input())
l = []
for i in range(int(X ** 0.5) + 1):
  j = 2
  while i ** j <= X:
    l.append(i ** j)
    j += 1
l.sort()
print(l[-1])

Fixed, accepted submission:
X = int(input())
l = []
if X < 4:
  print(1)
else:
  for i in range(2, int(X ** 0.5) + 1):
    j = 2
    while i ** j <= X:
      l.append(i ** j)
      j += 1
  l.sort()
  print(l[-1])
Problem:
Write a program which reads three integers, and prints them in ascending order.

Incorrect submission (verdict: Wrong Answer):
inputStr = input()
numList = inputStr.split(' ')
numList = [int(x) for x in numList]
numList.sort()

print(numList)

Fixed, accepted submission:
inputStr = input()
numList = inputStr.split(' ')
numList = [int(x) for x in numList]
numList.sort()

outputStr = ''
count = len(numList)
for z in numList:
    outputStr = outputStr + str(z)
    count-=1
    if count>0 :
        outputStr+=' '

print(outputStr)
Problem:
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.  Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.

Incorrect submission (verdict: Wrong Answer):
a,b,c,x,y=map(int,input().split())
p1=a*x+b*y
min=10**9
for i in range(10**5+1):
    p2=2*i*c+max(0,x-i)*a+max(0,y-i)*b
    if p2<min:
        min=p2
if p2<p1:
    print(p2)
else:
    print(p1)

Fixed, accepted submission:
a,b,c,x,y=map(int,input().split())
p1=a*x+b*y
min=10**9
for i in range(10**5+1):
    p2=2*i*c+max(0,x-i)*a+max(0,y-i)*b
    if p2<min:
        min=p2
if min<p1:
    print(min)
else:
    print(p1)
Problem:
Given a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: `a`, `e`, `i`, `o` and `u`.

Incorrect submission (verdict: Wrong Answer):
a = str(input())
boin = ["a","e","i","o","u"]
if a in boin:
    print("voewl")
else:
    print("consonant")

Fixed, accepted submission:
a = str(input())
boin = ["a","e","i","o","u"]
if a in boin:
    print("vowel")
else:
    print("consonant")
Problem:
You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion.  All strings that can be obtained in this way can be evaluated as formulas.  Evaluate all possible formulas, and print the sum of the results.

Incorrect submission (verdict: Wrong Answer):
import itertools
num = str(input())

olist = [int(i+1) for i in range(len(num)-1)]
comblist = []
for i, _ in enumerate(olist, 1):     
    for j in itertools.combinations(olist, r=i):
        comblist.append(j)

L = []
for i in range(len(comblist)):
  t = num
  for j in range(len(comblist[i])):
    t = t[0:comblist[i][j]+j] + "," + t[comblist[i][j]+j:]
  L.append(t)
print(L)

out = 0
for i in range(len(L)):
  t = L[i].split(",")
  for j in range(len(t)):
    out += int(t[j])
print(out+int(num))

Fixed, accepted submission:
import itertools
num = str(input())

olist = [int(i+1) for i in range(len(num)-1)]
comblist = []
for i, _ in enumerate(olist, 1):     
    for j in itertools.combinations(olist, r=i):
        comblist.append(j)

L = []
for i in range(len(comblist)):
  t = num
  for j in range(len(comblist[i])):
    t = t[0:comblist[i][j]+j] + "," + t[comblist[i][j]+j:]
  L.append(t)

out = 0
for i in range(len(L)):
  t = L[i].split(",")
  for j in range(len(t)):
    out += int(t[j])
print(out+int(num))
Problem:
AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.  If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1). Note that **he cannot stay at his place**. Determine whether he can carry out his plan.

Incorrect submission (verdict: Wrong Answer):
def boolean(a,b):
    if(abs(a[0] - b[0]) == abs(a[1] - b[1]) + abs(a[2] - b[2])):
        return 0
    else:
        return 1

N = int(input())
txy = [input() for i in range(N)]
txy = [list(map(int, txy[i].split())) for i in range(N)]
ans = "Yes"
for i in range(1,N):
    if(boolean(txy[i-1],txy[i])):
        ans = "No"
        break
print(ans)

Fixed, accepted submission:
def boolean(a,b):
    D = abs(a[0] - b[0]) -abs(a[1] - b[1]) - abs(a[2] - b[2])
    if(D >= 0 and D %2 == 0):
        return 0
    else:
        return 1

N = int(input())
txy=[0 for i in range(N+1)]
txy[0]=[0,0,0]
for i in range(N):
    a=list(map(int,input().split()))
    txy[i+1]=a
ans = "Yes"
for i in range(1,N + 1):
    if(boolean(txy[i-1],txy[i])):
        ans = "No"
        break
print(ans)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
#ABC173-A
N = int(input())
print(N % 1000)

Fixed, accepted submission:
#ABC173-A
N = int(input())
print(-N % 1000)
Problem:
You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is a_{ij}.  Put a box around this image and output the result. The box should consist of `#` and have a thickness of 1.

Incorrect submission (verdict: Wrong Answer):
h,w = map(int,input().split())
a_list = [[s for s in input()] for _ in range(h)]
print(a_list)

return_list = []

for i,row in enumerate(a_list):
    if i == 0:
        return_list.append(['#' for _ in range(w+2)])
    row.insert(0,'#')
    row.append('#')
    return_list.append(row)
    if i == len(a_list)-1:
        return_list.append(['#' for _ in range(w+2)])

for elem in return_list:
    print(''.join(elem))

Fixed, accepted submission:
h,w = map(int,input().split())
a_list = [[s for s in input()] for _ in range(h)]

return_list = []

for i,row in enumerate(a_list):
    if i == 0:
        return_list.append(['#' for _ in range(w+2)])
    row.insert(0,'#')
    row.append('#')
    return_list.append(row)
    if i == len(a_list)-1:
        return_list.append(['#' for _ in range(w+2)])

for elem in return_list:
    print(''.join(elem))
Problem:
E869120 has A 1-yen coins and infinitely many 500-yen coins.   Determine if he can pay exactly N yen using only these coins.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = int(input())
if n % 500 == a % 500:
  print('Yes')
else:
  print('No')

Fixed, accepted submission:
n = int(input())
a = int(input())
if (n % 500 <= a):
  print('Yes')
else:
  print('No')
Problem:
How many ways are there to choose two distinct positive integers totaling N, disregarding the order?

Incorrect submission (verdict: Wrong Answer):
n = int(input())
if n%2==0:
  n =  int(n/2)-1
if n%2==1:
  n = int(n/2)
print(n)

Fixed, accepted submission:
N = int(input())
if(N%2==0):
  print(int((N/2)-1))
else:
  print(int(N/2))
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
S = list(input())
num = 0
num2 = 0
for i in range(len(S)):
    if S[i] == "A":
        num = i
        break
for i in range(len(S)):
    if S[i] == "Z":
        num2 = i
        
print(num2 - num)


Fixed, accepted submission:
S = list(input())
num = 0
num2 = 0
for i in range(len(S)):
    if S[i] == "A":
        num = i
        break
for i in range(len(S)):
    if S[i] == "Z":
        num2 = i

print(num2 - num + 1)
Problem:
You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:    * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`.

Incorrect submission (verdict: Wrong Answer):
S = input ()
Z = ''.join(list(reversed(S)))
Z = Z.replace('resare', '')
Z = Z.replace('esare', '')
Z = Z.replace('remaerd', '')
Z = Z.replace('maerd', '')
z = len (Z)
if z == 0:
    print ('Yes')
else:
    print ('No')

Fixed, accepted submission:
S = input ()
Z = ''.join(list(reversed(S)))
Z = Z.replace('resare', '')
Z = Z.replace('esare', '')
Z = Z.replace('remaerd', '')
Z = Z.replace('maerd', '')
z = len (Z)
if z == 0:
    print ('YES')
else:
    print ('NO')
Problem:
You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total?  Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Incorrect submission (verdict: Wrong Answer):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt = 0
for i in range(a):
    for j in range(b):
        for k in range(c):
            if x == i * 500 + j * 100 + k * 50:
                cnt += 1
print(cnt)

Fixed, accepted submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if x == i * 500 + j * 100 + k * 50:
                cnt += 1
print(cnt)
Problem:
A string is called a KEYENCE string when it can be changed to `keyence` by removing its contiguous substring (possibly empty) only once.  Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string.

Incorrect submission (verdict: Wrong Answer):
import re,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
str = 'keyence'
pattern_keyence = []
for i in range(len(str)+1):
    pattern_keyence.append(repr(str[:i]+'.*'+str[i:]))
for p in pattern_keyence:
    if re.fullmatch(p,S):
        print('YES')
        break
else:
    print('NO')


Fixed, accepted submission:
import re,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
str = 'keyence'
pattern_keyence = []
for i in range(len(str)+1):
    pattern_keyence.append(r'{}'.format(str[:i]+'.*'+str[i:]))
for p in pattern_keyence:
    if re.fullmatch(p,S):
        print('YES')
        break
else:
    print('NO')
Problem:
Snuke loves working out. He is now exercising N times.  Before he starts exercising, his _power_ is 1. After he exercises for the i-th time, his power gets multiplied by i.  Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Incorrect submission (verdict: Wrong Answer):


import numpy as np
import math
MOD=10**9+7

n=int(input())
ans=1
for i in range(n+1):
    ans=(ans*i)%MOD
print(ans)

Fixed, accepted submission:


import numpy as np
import math
MOD=10**9+7

n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%MOD
print(ans)
Problem:
We have N cards. A number a_i is written on the i-th card.   Alice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.   The game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

if N%2 == 0:
  print(N/2)
else:
  print(N/2 + 1)

Fixed, accepted submission:
N = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
print(sum(l[0::2]) - sum(l[1::2]))
Problem:
This contest, _AtCoder Beginner Contest_ , is abbreviated as _ABC_.  When we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.  What is the abbreviation for the N-th round of ABC? Write a program to output the answer.

Incorrect submission (verdict: Wrong Answer):
n = input()
print('abc' + n.zfill(3))

Fixed, accepted submission:
n = input()
print('ABC' + n.zfill(3))