結果

問題 No.3165 [Cherry 7th Tune A] Croissants Continu
ユーザー detteiuu
提出日時 2025-06-01 15:29:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 397 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 82,680 KB
実行使用メモリ 123,856 KB
最終ジャッジ日時 2025-06-01 15:29:37
合計ジャッジ時間 7,319 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    N = int(input())
    A = list(map(int, input().split()))

    SUM = sum(A)
    MAX = max(A)

    if MAX-1 <= SUM-MAX:
        print(SUM)
    else:
        print((SUM-MAX)*2+1)
0