結果
| 問題 | No.3494 一点挿入区間和取得 |
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2026-04-03 22:45:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 85,360 KB |
| 実行使用メモリ | 83,328 KB |
| 最終ジャッジ日時 | 2026-04-03 22:46:58 |
| 合計ジャッジ時間 | 12,516 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 TLE * 1 -- * 7 |
ソースコード
N,Q=map(int,input().split())
A=list(map(int,input().split()))
result=[0]*Q
q=[]
for i in range(Q):
pos,x,l,r=map(int,input().split())
q.append((pos,x,l,r))
for pos in range(1,N+1):
y=A[pos-1]
now=pos
for i in range(Q):
pos,x,l,r=q[i][:]
if pos<now:
now+=1
if l<=now<=r:
result[i]+=y
for i in range(Q):
pos,x,l,r=q[i][:]
now=pos+1
if l<=now<=r:
result[i]+=x
for j in range(i+1,Q):
pos,y,l,r=q[j][:]
if pos<now:
now+=1
if l<=now<=r:
result[j]+=x
for i in range(Q):
print(result[i])
ゼット