結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-11 11:51:46 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 322 bytes |
| 記録 | |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 85,108 KB |
| 実行使用メモリ | 111,036 KB |
| 最終ジャッジ日時 | 2026-05-27 10:18:13 |
| 合計ジャッジ時間 | 3,176 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 12 |
ソースコード
from collections import deque
N = int(input())
A = deque(map(int, input().split()))
a, t = 0, 0
for _ in range(N):
if A[0] - A[1] > A[-1] - A[-2]:
a += A[0]
t += A[1]
A.popleft()
A.popleft()
else:
a += A[-1]
t += A[-2]
A.pop()
A.pop()
print(a - t)