Problem:


Score : 200 points

Problem Statement

In some other world, today is the day before Christmas Eve.

Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).

He has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?

Constraints

2 \leq N \leq 10

100 \leq p_i \leq 10000

p_i is an even number.

Input

Input is given from Standard Input in the following format:

N
p_1
p_2
:
p_N

Output

Print the total amount Mr. Takaha will pay.

Sample Input 1

3
4980
7980
6980

Sample Output 1

15950

The 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.

Note that outputs such as 15950.0 will be judged as Wrong Answer.

Sample Input 2

4
4320
4320
4320
4320

Sample Output 2

15120

Only one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.



Sample input:
3
4980
7980
6980


Sample output:
15950

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    p = [0] * N
    for i in range(N):
        p[i] = int(input())

    p.sort()
    ans = sum(p[:-1]) + p[-1] // 2
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for i in range(N)]

print(sum(P) - max(P) // 2)

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for _ in range(n)]
print(sum(p)-max(p)//2)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for i in range(N)]

print(int(max(P) * 0.5 + sum(P) - max(P)))

Submission status: Accepted

Solution code:
N = int(input())
P = []
for i in range(N):
    P.append(int(input()))
print(sum(P)-max(P)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [0] * n
for i in range(n):
    p[i] = int(input())
print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
n = int(input())
p = sorted([int(input()) for _ in range(n)])
print(sum(p) - p[-1]//2)

Submission status: Accepted

Solution code:
n = int(input())
l = []
for i in range(n):
  l.append(int(input()))
print(sum(l)-max(l)//2)

Submission status: Accepted

Solution code:

N = int(input())
a = sorted([int(input()) for i in range(N)])

print(int(a[-1]/2) + sum((a)[:-1]) )

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for i in range(n)]
print(sum(p)+max(p)//2-max(p))

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]
print(sum(P) - max(P) + max(P)//2)

Submission status: Accepted

Solution code:
l = sorted(list(int(input()) for _ in range(int(input()))), reverse=True)
print(sum(l) - l[0]//2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, p: "List[int]"):
    print(sum(p) - max(p) // 2)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, p)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ar = []
for _ in range(n):
  ar.append(int(input()))

print(sum(ar)-max(ar)//2)

Submission status: Accepted

Solution code:
n = int(input())
p_list = sorted([int(input()) for _ in range(n)])
print(sum(p_list) - p_list[-1] // 2)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]

print(sum(P) - max(P)//2 )

Submission status: Accepted

Solution code:
N = int(input())
pl = tuple(int(input())for _ in range(N))
p_mx = max(pl)//2
ans = sum(pl) - p_mx
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ma=0
s=0
for i in range(n):
    k=int(input())
    if k>ma:
        ma=k
    s+=k
print(ma//2+s-ma)

Submission status: Accepted

Solution code:
n = int(input())
p_list = [int(input()) for nesya in range(n)]
a = max(p_list)//2
c = 0
for hoge in p_list:
  c += hoge
print(c-a)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
a = max(p) // 2
print(sum(p) - a)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

def main():
    p = []
    my_max = 0
    ans = 0
    for i in range(N):
        p = int(input())
        ans += p
        my_max = max(my_max, p)
    print(ans - my_max // 2)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
prices = []
for i in range(N):
  prices.append(int(input()))

prices_sum = sum(prices)
ans = prices_sum - (max(prices) / 2)

print(int(ans))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
A = sorted([ii() for _ in range(N)])

print(sum(A) - A[-1]//2)

Submission status: Accepted

Solution code:
n=int(input())
lis=sorted([int(input()) for i in range(n)])
print(lis[-1]//2+sum(lis[:-1]))

Submission status: Accepted

Solution code:
_,*p=map(int,open(0));print(sum(p)-max(p)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for a in range(n)]
print(int(sum(p) - max(p) // 2))

Submission status: Accepted

Solution code:
# ABC115B

n = int(input())
p = [0] * n
for i in range(n):
    p[i] = int(input())
print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]
mp = max(P)
mpi = P.index(mp)
print(sum(P[:mpi]+P[mpi+1:])+mp//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]

p.sort(reverse=True)
print(p[0]//2 + sum(p[1:]))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
p.sort()
p.reverse()
p[0] //= 2
print(sum(p))

Submission status: Accepted

Solution code:
n=int(input())
P=sorted(list([int(input()) for i in range(n)]))[::-1]
print(P[0]//2+sum(P[1:]))

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for x in range(n)]
m=max(p)
p.remove(m)
print(m//2+sum(p))

Submission status: Accepted

Solution code:
n=int(input())
p=sorted([int(input()) for _ in range(n)])
print(sum(p[:n-1])+p[-1]//2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n=I()
l=[I() for i in range(n)]
l.sort()
print(sum(l)-l[-1]//2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input()) 
p = sorted([int(input()) for _ in range(n)])
print(int(sum(p[:-1]) + p[-1] / 2))

Submission status: Accepted

Solution code:
n=int(input())
p = [int(input()) for _ in range(n)]
print(sum(p)-(max(p)//2))

Submission status: Accepted

Solution code:
n=int(input())
p=[]
for i in range(n):
  p.append(int(input()))
p.sort()
print(sum(p[0:n-1])+p[n-1]//2)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
m = 0
for _ in range(n):
  a = int(input())
  ans += a
  m = max(m, a)
print(ans-m//2)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    num_list = [int(input()) for _ in range(n)]

    num_list.sort(reverse=True)

    count = 0

    for i in range(n):
        if i == 0:
            count += num_list[i] // 2
        else:
            count += num_list[i]

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
p = []
for i in range(N):
  pi = [int(input())]
  p = p + pi
  
M = max(p)

print(int(sum(p)-M/2))

Submission status: Accepted

Solution code:
p=sorted([int(input()) for _ in range(int(input()))])
print(sum(p[0:-1])+p[-1]//2)

Submission status: Accepted

Solution code:

n = int(input())
p = [int(input()) for i in range(n)]

p.sort()
a = int(p.pop(-1) / 2)
print(a+sum(p))

Submission status: Accepted

Solution code:
n = int(input())
res = []
for i in range(n):
    p = int(input())
    res.append(p)
print(int(sum(res)-max(res)/2))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]

idx = p.index(max(p))

ans = 0
for i in range(n):
    if i == idx:
        ans += p[i]/2
    else:
        ans += p[i]

print(int(ans))

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for _ in range(n)]
p.sort()
s=0
for i in range(n-1):
  s+=p[i]
ans=s+(p[n-1]//2)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
c=0
c+=max(a)//2
a.remove(max(a))
for i in range(n-1):
    c+=a[i]
print(c)

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
print(sum(a)-max(a)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
print(sum(p) - max(p) + max(p) // 2)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for i in range(n)]
l.sort(reverse=True)

ans = 0
for i in range(n):
    if i == 0:
        ans+= l[i]//2
    else:
        ans+= l[i]
    
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for i in range(n)]
ans=sum(p)-max(p)//2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
p = []

for i in range(N):
    p.append(int(input()))

highest = None

for i in p:
    if highest is None:
        highest = i
        continue
    if highest < i:
        highest = i

for i in range(len(p)):
    if p[i] == highest:
        p[i] = highest / 2
        break
        
print(int(sum(p)))

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]
print(sum(P) - max(P) // 2)

Submission status: Accepted

Solution code:
N = int(input())

p = [0] * N
for i in range(N):
    p[i] = int(input())

mx = max(p)
p.pop(p.index(mx))

print(sum(p) + mx // 2)

Submission status: Accepted

Solution code:
N = int(input())
P = []
for _ in range(N):
    P.append(int(input()))
P.sort(reverse=True)
print(P[0] // 2 + sum(P[1:]))

Submission status: Accepted

Solution code:
import sys
import numpy as np

# import os
# path = os.getcwd()
# path = os.path.join(path,"input.txt")
# sys.stdin = open(path)

input = sys.stdin.readline
N = int(input())
p = [int(input()) for i in range(N)]
p.sort(reverse=True)
p[0] = int(p[0]/2)
print(sum(p))

Submission status: Accepted

Solution code:
n=int(input())
s=[int(input()) for _ in range(n)]
print(sum(s)-max(s)//2)

Submission status: Accepted

Solution code:
N = int(input())
li = []
for i in range(N):
    li.append(int(input()))
maxnum = max(li)
del li[li.index(maxnum)]
price = 0
for i in li:
    price += i
price += maxnum // 2
print(price)

Submission status: Accepted

Solution code:
N=int(input())
s=[]
for i in range(N):
    s.append(int(input()))
s.sort(key=int)
s[-1] = int(s[-1]/2)
print(sum(s))

Submission status: Accepted

Solution code:
n = int(input())
p = []
for i in range(n):
    p.append(int(input()))
print(sum(p)-max(p)//2)

Submission status: Accepted

Solution code:
N = int(input())
p = list()
for a in range(0, N):
    p.append(int(input()))

mx = p.pop(p.index(max(p)))
mx //= 2

print(sum(p) + mx)

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(N)]

print(sum(p) - max(p)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
p = sorted(p)
print(int(sum(p[:-1])+p[-1]/2))

Submission status: Accepted

Solution code:
N=int(input())
P=[int(input()) for i in range(N)]
print(sum(P)-max(P)//2)

Submission status: Accepted

Solution code:
n=int(input())
list=[int(input()) for _ in range(n)]
print(int(sum(list)-max(list)/2))

Submission status: Accepted

Solution code:
n = int(input())
arr = [0]*n
for i in range(n):
    arr[i]=int(input())
arr.sort()
ans = arr[-1]//2+sum(arr[:-1])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
h = max(a)
print(sum(a)-h+h//2)

Submission status: Accepted

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    P = iln(N)
    print(max(P) // 2 + sum(P) - max(P))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(int(input()))]
print(int(sum(l) - max(l)/2))

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
P = [ir() for _ in range(N)]
answer = sum(P) - max(P) // 2
print(answer)

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(N)]
print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))

l.sort()
l[-1]=l[-1]//2
print(sum(l))

Submission status: Accepted

Solution code:
N = int(input())
p = sorted([int(input()) for i in range(N)])
print(p[-1]//2 + sum(p[:-1]))

Submission status: Accepted

Solution code:


def solve():

    N = int(input())

    # 一行で取る
    Plist = [int(input()) for i in range(N)]

    # max indexをとるには
    m = max(Plist)
    Plist.remove(Plist[Plist.index(m)])
    print(m//2+sum(Plist))


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
p = [INT() for _ in range(N)]

print(sum(p) - max(p)//2)

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    p = [int(input()) for _ in range(n)]
    print(sum(p)-max(p)//2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

n = int(input())
p = [int(input()) for _ in range(n)]
p.sort()

print(sum(p)-int(p[-1]/2))

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a.sort()
a[-1]=a[-1]//2
print(sum(a))

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a=sorted(a,reverse=True)
a[0]=a[0]//2
print(sum(a))

Submission status: Accepted

Solution code:
def bChristmas(n, pl):

    return int(sum(pl) - (max(pl)/ 2))

def main():
    n = int(input())
    pl = [int(input()) for i in range(n)]
    print(bChristmas(n, pl))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
p = [0] * N
for i in range(N):
    p[i] = int(input())

p.sort()

p[N-1] = p[N-1] // 2

print(sum(p))

Submission status: Accepted

Solution code:
n = int(input())
price=[int(input()) for i in range(n)]
sort_price = sorted(price)
discount = sort_price[len(sort_price)-1] // 2
sort_price[len(sort_price)-1] = discount
print(sum(sort_price))

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for i in range(N)]
#最大値を求める
max = p[0]
max_i = 0
for i in range(N):
    if max < p[i]:
        max = p[i]
        max_i = i
#maxが最大値
sum = 0
p[max_i] = p[max_i] / 2
for i in range(N):
    sum = sum + p[i]
print(int(sum))

Submission status: Accepted

Solution code:
n=int(input())
a=[0]*n
for i in range(n):
    a[i]=int(input())
print(int(sum(a)-max(a)/2))

Submission status: Accepted

Solution code:
p=[int(input()) for _ in range(int(input()))]
ans=0
for i in range(len(p)):
    ans+=p[i]
ans=ans-max(p)+max(p)/2
print(int(ans))

Submission status: Accepted

Solution code:
n_list = [int(input()) for _ in range(int(input()))]

print(int(sum(n_list) - max(n_list) /2))

Submission status: Accepted

Solution code:
n = int(input())
Lista = [int(input()) for i in range(n)]
Lista.sort(reverse=True)
Lista[0] = int(Lista[0] / 2)
print(sum(Lista))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]

ma = max(p)
ans = sum(p)-ma//2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p.sort(reverse=True)
ans = 0
for t in p:
    ans += t
print(int(ans - p[0] / 2))

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    n=int(input())
    p=[0]*n
    for i in range(n):
        p[i]=int(input())
    print(sum(p)-max(p)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
print(int(sum(p)-max(p)/2))

Submission status: Accepted

Solution code:
N=int(input())
p = [None]*N
for i in range(N):
    p[i] = int(input())

p.sort()
print(int(sum(p)-p[N-1]/2))

Submission status: Accepted

Solution code:
N=int(input())
P=[int(input()) for _ in range(N)]
idx=P.index(max(P))
print(sum(P)-P[idx]//2)

Submission status: Accepted

Solution code:
import numpy as np
import sys

n = int(input())
mx = 0
sm = 0
for i in range(n):
	p = int(input())
	sm += p
	if(p > mx):
		mx = p
sm -= mx
sm += mx // 2
print(sm)

Submission status: Accepted

Solution code:
N = int(input())
ary1 = sorted([int(input()) for x in range(N)])
ans = sum(ary1[:-1]) + ary1[-1]//2
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    price = [int(input()) for _ in range(N)]
    price.sort()
    print(sum(price[:len(price)-1]) + price[-1]//2)
main()

Submission status: Accepted

Solution code:
# ABC 115: B – Christmas Eve Eve
n = int(input())
p = [int(input()) for _ in range(n)]

print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
# solution

data = int(input())

array = [int(input()) for i in range(data)]

print(sum(array)-max(array)//2)

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input()) for i in range(n)]
p.sort()
print(sum(p)-p[-1]//2)

Submission status: Accepted

Solution code:
N = int(input())

A = [int(input()) for i in range(N)]

print(sum(A)-(max(A)//2))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
l.sort()
print(sum(l[: n - 1]) + l[-1] // 2)

Submission status: Accepted

Solution code:
N = int(input())
lp = [None for _ in range(N)]
for i in range(N):
  lp[i] = int(input())
lps = sorted(lp,reverse = True)
sum = lps[0]/2
for i in range(1,N):
  sum += lps[i]
print(int(sum))

Submission status: Accepted

Solution code:
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
print(int((max(A)/2)+sum(A)-max(A)))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    print(sum(A) - max(A) // 2)
    
    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for i in range(N)]
p.sort(reverse=True)

p[0] = p[0] // 2
print(sum(p))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p.sort(reverse=True)
p[0] = p[0]//2
print(sum(p))

Submission status: Accepted

Solution code:
n = int(input())
p = []

max_suffix = 0
for i in range(n):
    p.append(int(input()))
    if p[max_suffix] < p[i]: max_suffix = i

ans = 0
for i in range(n):
    if i == max_suffix: ans += p[i]/2
    else: ans += p[i]
    
print(int(ans))

Submission status: Accepted

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    P = sorted([ii() for _ in range(ii())])[::-1]
    print(sum(P[:1]) // 2 + sum(P[1:]))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(N)]
ans = (max(p)//2) + sum(p) - max(p)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    p = IR(n)
    print(sum(p) - max(p) // 2)
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())
num = N+1
price = []
for i in range (1,num):
  price.append(int(input()))
else:
  exp = max(price)//2
  total = sum(price) - exp
  print(total)

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
    a =input()
    l.append(int(a))
lm=sorted(l)
lm2=lm[0:n-1]
b=lm[-1]
print(sum(lm2)+int(b)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]

print(sum(p) - max(p)//2)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

N = int(input())

item = [int(input()) for _ in range(N)]

print(sum(item) - max(item) // 2)

Submission status: Accepted

Solution code:
N,*P=map(int,open(0));print(sum(P)-max(P)//2)

Submission status: Accepted

Solution code:
N = int(input())
l = [int(input()) for i in range(N)]
print(sum(l) - max(l) + max(l)//2)

Submission status: Accepted

Solution code:
n = int(input())
p = []
for i in range(n):
    x = int(input())
    p.append(x)

p.sort(reverse=True)

most_expensive = p[0]
print(most_expensive//2 + sum(p[1:]))

Submission status: Accepted

Solution code:
N=int(input())
p_list=[]
for i in range(N):
  p=int(input())
  p_list.append(p)

print(sum(p_list)-round(max(p_list)/2))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for _ in range(n)]
m = max(p)
print(sum(p) - m//2)

Submission status: Accepted

Solution code:

url = "https://atcoder.jp//contests/abc115/tasks/abc115_b"

def main():
    n = int(input())
    t = [int(input()) for i in range(n)]
    ind = t.index(max(t))
    t[ind] = t[ind] // 2
    print(sum(t))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n =int(input())
p =[]
for i in range(n):
    a =int(input())
    p.append(a)
p.sort()
new_p =p[n-1]/2
ans =sum(p[:n-1])+new_p
print(int(ans))

Submission status: Accepted

Solution code:
n = int(input())
P = sorted([int(input()) for i in range(n)])
ans = sum(P[:-1]) + (P[-1] // 2)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
p=list(int(input()) for i in range(N))
pp=sorted(p)
print(int(sum(pp[:-1])+(pp[-1])//2))

Submission status: Accepted

Solution code:
n = int(input())
ma = 0
ans = 0
for _ in range(n):
    p = int(input())
    if ma < p:
        ans += ma
        ma = p
    else:
        ans += p
ans += ma // 2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
p=[]
for i in range(n):
    p.append(int(input()))
p=sorted(p,reverse=True)
print(sum(p[1:n])+p[0]//2)

Submission status: Accepted

Solution code:
n=int(input())
p=[int(input())for i in range(n)]
p.sort(reverse=True)
p[0]//=2
print(sum(p))

Submission status: Accepted

Solution code:
n=int(input())
p=[]
for i in range(n):
    p.append(int(input()))
p.sort()
p.append(p.pop()//2)

print(sum(p))

Submission status: Accepted

Solution code:
n = int(input())
s = 0
m = 0
for i in range(n):
  p = int(input())
  s += p
  m = max(m, p)
print(s - m//2)

Submission status: Accepted

Solution code:
a = int(input())
b_list =[]
for i in range(a):
    b = int(input())
    b_list.append(b)
    
print(int(sum(b_list) - 0.5*max(b_list)))

Submission status: Accepted

Solution code:
n = int(input())
ma = 0
ans = 0
for i in range(n):
    p = int(input())
    ma = max(p,ma)
    ans+=p
print(ans -ma//2)

Submission status: Accepted

Solution code:
N = int(input())

p= [int(input()) for i in range(N)]

print(sum(p)-max(p)//2)

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for _ in range(N)]

ans = sum(p)
ans -= max(p)//2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
price_max = 0
for i in p:
    price_max = max(price_max,i)
print(sum(p)-price_max//2)

Submission status: Accepted

Solution code:
n=int(input())
p=[0]*n
t=0
for i in range(n):
  p[i]=int(input())
  t+=p[i]
s=max(p)
t-=s//2
print(t)

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for i in range(N)]
sp = sorted(p)
sp[-1] = sp[-1]//2
print(sum(sp))

Submission status: Accepted

Solution code:
_, *p = map(int, open(0).read().split());l = sorted(p)
print(sum(l[:-1]) + l[-1] // 2)

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  #s = input()
  #s = input().split()
  #a,b = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  b = sorted(a)
  
  for i in range(n):
    ans += a[i]
  print(ans-b[-1]//2)
  

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
a = []
for i in range(int(input())):
    a.append(int(input()))
print(sum(a)-max(a)//2)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(input()) for _ in range(N)]
print(sum(P) - max(P)//2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline().rstrip())
p = [int(readline().rstrip()) for i in range(n)]
print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
N = int(input())
p = list(int(input()) for _ in range(N))

tmp = sorted(p,reverse=True)
print(tmp[0]//2 + sum(tmp[1:]))

Submission status: Accepted

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]

ans = sum(p) - max(p)//2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0

p = [int(input()) for i in range(n)]
p = sorted(p)

ans = sum(p) - p[n - 1]//2

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
p =  [0]*N
for i in range(N):
  p.append(int(input()))
p.sort(reverse=True)
total = p[0]//2
for i in range(1,N):
  total+=p[i]
print(total)

Submission status: Accepted

Solution code:
N = int(input())
p = []
for i in range(N):
  p.append(int(input()))
print(sum(p) - max(p) // 2)

Submission status: Accepted

Solution code:
#ABC-115-B
N = int(input())
P = []
for _ in range(N):
    pi = int(input())
    P.append(pi)

print(int(sum(P)-max(P)+(max(P)/2)))

Submission status: Accepted

Solution code:
N = int(input())
p=[]
for _ in range(N):
    p.append(int(input()))
print(sum(p)-max(p)//2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
p = [I() for _ in range(n)]
s = sum(p)
ans = s - max(p)//2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
  l.append(int(input()))
print(sum(l)-max(l)//2)

Submission status: Accepted

Solution code:
N = int(input())
p = [int(input()) for i in range(N)]
print(sum(p)-max(p)//2)