[Ynoi2078] 《A theory of consciousness from a theoretical computer scienceperspective: Insights from the Conscious Turing Machine》阅读报告(更新中...)

Luogu
IDLGP8524
Time60000ms
Memory512MB
DifficultyP6
O2优化Ynoi2078
给定一个长度 $n$ 的序列 $a_1,\dots,a_n$,需要进行 $m$ 次操作,操作共有三种类型: 操作 1:给定 $l,r,x$,先新建一个数组 $b$ 满足 $b_i=a_i$,之后将 $a_x,\dots,a_{x+r-l}$ 同时修改为 $b_l,\dots,b_r$; 操作 2:给定 $l,r$,将 $a_l,\dots,a_r$ 同时修改为除以 $2$ 下取整后的值; 操作 3:给定 $l,r$,求 $a_l,\dots,a_r$ 的和。 ## Input 第一行一个整数 $n$。 接下来一行 $n$ 个整数表示序列 $a_1,\dots,a_n$。 接下来一行一个整数 $m$。 接下来 $m$ 行,每行表示一个操作: `1 l r x` 表示操作 1; `2 l r` 表示操作 2; `3 l r` 表示操作 3。 ## Output 对每个操作 3,输出一行,包含一个整数,表示答案。 [samples] ## Background ## 警告:滥用本题将被封号。 ## Note 对于 $100\%$ 的数据,满足 $1\le n\le 3\cdot 10^6$,$1\le m\le 3\cdot 10^6$。 序列的初值满足 $1\le a_i\le 10^9。$ 对每个操作满足 $1\le l\le r\le n$。 对每个操作 1 满足 $1\le x\le x+r-l+1\le n$。 以上所有数值为整数。
Samples
Input #1
10
1 81 93 81 16 97 63 26 66 13
10
1 1 5 3
3 5 6
3 9 9
3 1 3
3 1 7
2 1 3
3 3 9
1 5 6 6
3 1 4
3 3 9
Output #1
174
66
83
354
363
121
440
Input #2
10
61 53 17 97 81 17 1 91 38 93
10
2 3 6
2 1 8
3 1 5
3 1 1
3 1 7
3 3 5
3 1 4
2 2 10
2 1 5
3 5 5
Output #2
104
30
108
48
84
5
API Response (JSON)
{
  "problem": {
    "name": "[Ynoi2078] 《A theory of consciousness from a theoretical computer scienceperspective: Insights from the Conscious Turing Machine》阅读报告(更新中...)",
    "description": {
      "content": "给定一个长度 $n$ 的序列 $a_1,\\dots,a_n$,需要进行 $m$ 次操作,操作共有三种类型: 操作 1:给定 $l,r,x$,先新建一个数组 $b$ 满足 $b_i=a_i$,之后将 $a_x,\\dots,a_{x+r-l}$ 同时修改为 $b_l,\\dots,b_r$; 操作 2:给定 $l,r$,将 $a_l,\\dots,a_r$ 同时修改为除以 $2$ 下取整后的值; 操",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 60000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P6"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP8524"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "给定一个长度 $n$ 的序列 $a_1,\\dots,a_n$,需要进行 $m$ 次操作,操作共有三种类型:\n\n操作 1:给定 $l,r,x$,先新建一个数组 $b$ 满足 $b_i=a_i$,之后将 $a_x,\\dots,a_{x+r-l}$ 同时修改为 $b_l,\\dots,b_r$;\n\n操作 2:给定 $l,r$,将 $a_l,\\dots,a_r$ 同时修改为除以 $2$ 下取整后的值;\n\n操...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments