結果

問題 No.2488 Mod Sum Maximization
ユーザー naesiranaesira
提出日時 2023-09-29 22:34:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 188 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 86,608 KB
実行使用メモリ 116,676 KB
最終ジャッジ日時 2023-09-29 22:34:46
合計ジャッジ時間 7,010 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,232 KB
testcase_01 AC 70 ms
70,872 KB
testcase_02 AC 71 ms
71,072 KB
testcase_03 WA -
testcase_04 AC 156 ms
116,676 KB
testcase_05 WA -
testcase_06 AC 149 ms
111,752 KB
testcase_07 WA -
testcase_08 AC 149 ms
111,632 KB
testcase_09 AC 129 ms
112,552 KB
testcase_10 WA -
testcase_11 AC 75 ms
76,152 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 115 ms
104,644 KB
testcase_16 AC 75 ms
76,244 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 139 ms
105,596 KB
testcase_20 AC 145 ms
106,524 KB
testcase_21 AC 140 ms
106,224 KB
testcase_22 AC 147 ms
111,640 KB
testcase_23 AC 148 ms
111,696 KB
testcase_24 WA -
testcase_25 AC 76 ms
76,396 KB
testcase_26 WA -
testcase_27 AC 110 ms
100,964 KB
testcase_28 AC 111 ms
101,112 KB
testcase_29 AC 113 ms
100,920 KB
testcase_30 AC 96 ms
90,812 KB
testcase_31 AC 78 ms
77,444 KB
testcase_32 AC 137 ms
105,484 KB
testcase_33 AC 75 ms
75,988 KB
testcase_34 AC 147 ms
111,556 KB
testcase_35 AC 95 ms
89,248 KB
testcase_36 AC 68 ms
71,068 KB
testcase_37 AC 68 ms
71,200 KB
testcase_38 AC 69 ms
71,104 KB
testcase_39 AC 71 ms
71,068 KB
testcase_40 AC 71 ms
71,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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