結果

問題 No.2799 Cut and Eat
コンテスト
ユーザー shobonvip
提出日時 2024-06-27 00:33:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 276 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 54,884 KB
最終ジャッジ日時 2024-06-27 00:33:16
合計ジャッジ時間 2,594 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int,input().split())
def v(x):
	if x <= k:
		return x
	return - (x%2)

a = list(map(int,input().split()))
b = [v(x) for x in a]
b.sort(lambda x: -x)

ans = 0
mode = 0
for i in b:
	print(i)
	if mode:
		ans -= i
	else:
		ans += i
	mode ^= 1
print((sum(a) + ans) // 2)
0