結果

問題 No.2488 Mod Sum Maximization
ユーザー hirayuu_ychirayuu_yc
提出日時 2023-09-29 21:38:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 193 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 114,688 KB
最終ジャッジ日時 2023-09-29 21:38:29
合計ジャッジ時間 6,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,156 KB
testcase_01 AC 70 ms
71,076 KB
testcase_02 AC 73 ms
71,276 KB
testcase_03 WA -
testcase_04 AC 149 ms
114,380 KB
testcase_05 WA -
testcase_06 AC 148 ms
109,664 KB
testcase_07 WA -
testcase_08 AC 148 ms
109,800 KB
testcase_09 AC 126 ms
111,096 KB
testcase_10 WA -
testcase_11 AC 77 ms
76,424 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 114 ms
103,748 KB
testcase_16 AC 76 ms
76,568 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 140 ms
105,684 KB
testcase_20 AC 142 ms
104,732 KB
testcase_21 AC 136 ms
104,620 KB
testcase_22 AC 145 ms
109,540 KB
testcase_23 AC 146 ms
109,632 KB
testcase_24 WA -
testcase_25 AC 76 ms
76,508 KB
testcase_26 WA -
testcase_27 AC 109 ms
100,344 KB
testcase_28 AC 112 ms
100,164 KB
testcase_29 AC 109 ms
100,112 KB
testcase_30 AC 95 ms
90,452 KB
testcase_31 AC 79 ms
77,732 KB
testcase_32 AC 135 ms
105,684 KB
testcase_33 AC 75 ms
76,428 KB
testcase_34 AC 145 ms
109,408 KB
testcase_35 AC 99 ms
88,716 KB
testcase_36 AC 69 ms
71,344 KB
testcase_37 AC 69 ms
71,356 KB
testcase_38 AC 73 ms
71,336 KB
testcase_39 AC 72 ms
71,400 KB
testcase_40 AC 70 ms
71,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
add=0
for i in A:
    add+=i
add-=A[-1]
ans=add+(A[-1]%A[0])
for i in range(1,N-1):
    ans=max(ans,add-A[i]+(A[-1]%A[i])+(A[i]%A[0]))
print(ans)
0