結果
| 問題 |
No.999 てん vs. ほむ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-28 21:44:19 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| コード長 | 384 bytes |
| コンパイル時間 | 82 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 33,392 KB |
| 最終ジャッジ日時 | 2024-10-13 17:10:48 |
| 合計ジャッジ時間 | 3,084 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
def main():
N = int(input())
A = [int(i) for i in input().split()]
B = [A[i] - A[i+1] for i in range(0, 2*N, 2)]
# print(B)
from itertools import accumulate
S = [a for a in accumulate([0] + B)]
# print(S)
ans = -(10**9)
for i in range(N+1):
ans = max(ans, S[i] - S[0] - (S[N] - S[i]))
print(ans)
if __name__ == '__main__':
main()