# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336637 | ChrisT | 영역 (JOI16_ho_t4) | C++17 | 382 ms | 180204 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 <bits/stdc++.h>
using namespace std;
const int MN = 5e5 + 5;
struct Stupid {
map<long long,long long> row,row2;
set<long long> dub,dub2,intersect;
void add (long long i, long long v) {
if (!row.count(i)) {
row[i] += v;
//assert(row[i] >= 0);
if (row.count(i-1)) {
dub.insert(i-1);
if (dub2.count(i-1)) intersect.insert(i-1);
}
if (row.count(i+1)) {
dub.insert(i);
if (dub2.count(i)) intersect.insert(i);
}
return;
}
if (!(row[i] += v)) {
row.erase(i);
if (row.count(i-1)) {
dub.erase(i-1);
if (dub2.count(i-1)) intersect.erase(i-1);
}
if (row.count(i+1)) {
dub.erase(i);
if (dub2.count(i)) intersect.erase(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... |