結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-02 21:15:50 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 314 ms / 2,000 ms |
| + 199µs | |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 44,912 KB |
| 最終ジャッジ日時 | 2026-10-12 04:57:24 |
| 合計ジャッジ時間 | 10,276 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # %% import numpy as np # %% N = int(readline()) A = np.array(read().split(), np.int64) # %% from_left = np.zeros(N + 1, np.int64) from_left[1:] = (A[::2] - A[1::2]).cumsum() # %% from_right = np.zeros(N + 1, np.int64) from_right[1:] = (A[::-1][::2] - A[::-1][1::2]).cumsum() from_right = from_right[::-1] # %% answer = (from_left + from_right).max() print(answer)
maspy