結果

問題 No.999 てん vs. ほむ
ユーザー 👑 timitimi
提出日時 2020-10-14 09:51:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 30,304 KB
最終ジャッジ日時 2023-09-28 00:31:06
合計ジャッジ時間 4,186 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
7,796 KB
testcase_01 AC 13 ms
7,716 KB
testcase_02 AC 13 ms
7,780 KB
testcase_03 AC 14 ms
7,948 KB
testcase_04 AC 14 ms
7,804 KB
testcase_05 AC 12 ms
7,828 KB
testcase_06 AC 13 ms
7,772 KB
testcase_07 AC 12 ms
7,884 KB
testcase_08 AC 17 ms
8,804 KB
testcase_09 AC 134 ms
28,048 KB
testcase_10 AC 50 ms
14,140 KB
testcase_11 AC 38 ms
12,112 KB
testcase_12 AC 68 ms
17,028 KB
testcase_13 AC 146 ms
29,856 KB
testcase_14 AC 149 ms
30,000 KB
testcase_15 AC 145 ms
29,868 KB
testcase_16 AC 144 ms
29,968 KB
testcase_17 AC 134 ms
30,304 KB
testcase_18 AC 132 ms
29,108 KB
testcase_19 AC 137 ms
30,164 KB
testcase_20 AC 140 ms
29,416 KB
testcase_21 AC 140 ms
29,780 KB
testcase_22 AC 138 ms
29,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
cnt=0
for i in range(N):
  cnt+=A[2*i]
d=cnt
for i in range(N):
  d+=A[-1-2*i]-A[-2-2*i]
  cnt=max(d,cnt)
tem=sum(A)-cnt
print(cnt-tem)
0