# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568878 | nonsensenonsense1 | Fish 2 (JOI22_fish2) | C++17 | 4069 ms | 4360 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <utility>
#include <algorithm>
const int N = 100005;
int n, q, a[N], le[N], ri[N], cnt[N];
std::pair<int, int> b[N];
bool u[N];
long long sum[N];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i) scanf("%d", a + i);
scanf("%d", &q);
while (q--) {
int t;
scanf("%d", &t);
if (t == 1) {
int x, y;
scanf("%d%d", &x, &y);
a[x - 1] = y;
} else {
int l, r;
scanf("%d%d", &l, &r);
--l;
int len = r - l;
for (int i = 0; i < len; ++i) {
b[i] = std::make_pair(a[l + i], i);
sum[i + 1] = sum[i] + a[l + i];
le[i] = ri[i] = i;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |