[Ynoi2003] 樋口円香

Luogu
IDLGP8527
Time2000ms
Memory512MB
DifficultyP6
2003O2优化Ynoi
给定两个序列 $a_1,\dots,a_n$,$b_1,\dots,b_n$,一开始 $b_i=0$; 你需要进行 $m$ 次操作: 每次操作,给出 $l,r,L$,需要对于$k\in[l,r]$,将 $b_{L+k-l}$ 增加 $a_k$; 最后输出经过所有操作后的序列 $b_1,\dots,b_n$。 ## Input 第一行一个整数 $n$; 第二行 $n$ 个整数 $a_1,\dots,a_n$; 第三行一个整数 $m$; 之后 $m$ 行每行三个整数 $l\;r\;L$,表示一个询问。 ## Output 输出 $n$ 行,表示操作后的 $b_1,\dots,b_n$。 [samples] ## Background ![](https://cdn.luogu.com.cn/upload/image_hosting/n2xd23kw.png) ## Note Idea:nzhtl1477,Solution:ccz181078,Code:ccz181078,Data:ccz181078 对于 $100\%$ 的数据满足 $0\le a_i\le 1000$;$1\le n\le 10^5$;$1\le m\le 10^6$。
Samples
Input #1
3
1 2 3
1
1 2 2
Output #1
0
1
2
API Response (JSON)
{
  "problem": {
    "name": "[Ynoi2003] 樋口円香",
    "description": {
      "content": "给定两个序列 $a_1,\\dots,a_n$,$b_1,\\dots,b_n$,一开始 $b_i=0$; 你需要进行 $m$ 次操作: 每次操作,给出 $l,r,L$,需要对于$k\\in[l,r]$,将 $b_{L+k-l}$ 增加 $a_k$; 最后输出经过所有操作后的序列 $b_1,\\dots,b_n$。 ",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P6"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP8527"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "给定两个序列 $a_1,\\dots,a_n$,$b_1,\\dots,b_n$,一开始 $b_i=0$;\n\n你需要进行 $m$ 次操作:\n\n每次操作,给出 $l,r,L$,需要对于$k\\in[l,r]$,将 $b_{L+k-l}$ 增加 $a_k$;\n\n最后输出经过所有操作后的序列 $b_1,\\dots,b_n$。\n\n## Input\n\n第一行一个整数 $n$;\n\n第二行 $n$ 个整数 $a_1,...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments