正文
增加 4 行删除 4 行
45 行未改动46474849505152535422 行未改动7778798081828384856 行未改动929394959697989910010110210310445 行未改动void solve(int l, int r, int L, int R) {if (L > R) return;if (l == r) {for (int i = L; i <= R; i++)if (q[i].op==2) ans[q[i].id]=l;return;}int mid = (l+r) >> 1, cnt1 = 0, cnt2 = 0;22 行未改动for (int i = 1; i <= n; i++) {cin >> a[i];q[++cnt] = (node){a[i], 1, 0, i, 1};}for (int i = 1; i <= m; i++) {char op;cin >> op;if (op == 'Q') {6 行未改动q[++cnt] = (node){a[x], -1, 0, x, 1};q[++cnt] = (node){a[x]=y, 1, 0, x, 1};}}solve(-INF, INF, 1, cnt);for (int i = 1; i <= tot; i++) {cout << ans[i] << '\n';}return 0;}```45 行未改动46474849505152535422 行未改动7778798081828384856 行未改动929394959697989910010110210310445 行未改动void solve(int l, int r, int L, int R) {if (L > R) return;if (l == r) {for (int i = L; i <= R; i++)if (q[i].op==2) ans[q[i].id]=l;return;}int mid = (l+r) >> 1, cnt1 = 0, cnt2 = 0;22 行未改动for (int i = 1; i <= n; i++) {cin >> a[i];q[++cnt] = (node){a[i], 1, 0, i, 1};}for (int i = 1; i <= m; i++) {char op;cin >> op;if (op == 'Q') {6 行未改动q[++cnt] = (node){a[x], -1, 0, x, 1};q[++cnt] = (node){a[x]=y, 1, 0, x, 1};}}solve(-INF, INF, 1, cnt);for (int i = 1; i <= tot; i++) {cout << ans[i] << '\n';}return 0;}```