結果
問題 |
No.3164 [Chery 7th Tune B] La vie en rose
|
ユーザー |
|
提出日時 | 2025-08-11 20:29:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 446 bytes |
コンパイル時間 | 332 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 13,772 KB |
最終ジャッジ日時 | 2025-08-11 20:29:55 |
合計ジャッジ時間 | 11,073 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 TLE * 1 -- * 27 |
ソースコード
from collections import deque n = int(input()) a = list(map(int, input().split())) q = int(input()) for _ in range(q): x, b = map(int, input().split()) x -= 1 left = 0 for i in range(x-1, -1, -1): if a[i] == 0: break else: left += a[i] right = 0 for i in range(x+1, n): if a[i] == 0: break else: right += a[i] print(left + right + b)