結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-28 21:34:17 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 284 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 32,744 KB |
| 最終ジャッジ日時 | 2026-09-15 21:08:10 |
| 合計ジャッジ時間 | 3,840 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 12 |
ソースコード
from collections import deque
l, r = 0, 0
h, t = 0, 0
n = int(input())
A = deque(map(int, input().split()))
while A:
l = A[0]-A[1]
r = A[-1]-A[-2]
if l >= r:
h += A.popleft()
t += A.popleft()
else:
h += A.pop()
t += A.pop()
print(h-t)