結果

問題 No.3165 [Cherry 7th Tune A] Croissants Continu
ユーザー 👑 Kazun
提出日時 2023-10-21 00:50:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 742 ms
コンパイル使用メモリ 81,912 KB
実行使用メモリ 122,368 KB
最終ジャッジ日時 2025-05-30 21:02:25
合計ジャッジ時間 5,449 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    S = sum(A)
    A_max = max(A)
    return (S - A_max) + min(A_max, S - A_max +1)

#==================================================
import sys
input=sys.stdin.readline
write=sys.stdout.write

T = int(input())
write("\n".join(map(str, [solve() for _ in range(T)])))
0