# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102788 | njchung99 | 즐거운 사진 수집 (JOI13_collecting) | C++14 | 0 ms | 0 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<algorithm>
#define ll long long
using namespace std;
ll seg[1 << 22];
ll seg1[1 << 22];
ll cc[1 << 20 + 1];
ll cc1[1 << 20 + 1];
ll n, m;
ll check[22];
ll update(ll pos, ll val, ll node, ll x, ll y)
{
if (pos < x || y < pos)return seg[node];
if (x == y)return seg[node] = val;
ll mid = (x + y) / 2;
return seg[node] = update(pos, val, node * 2, x, mid) + update(pos, val, node * 2 + 1, mid + 1, y);
}
ll update1(ll pos, ll val, ll node, ll x, ll y)
{
if (pos < x || y < pos)return seg1[node];
if (x == y)return seg1[node] = val;
ll mid = (x + y) / 2;
return seg1[node] = update1(pos, val, node * 2, x, mid) + update1(pos, val, node * 2 + 1, mid + 1, y);
}
ll query(ll node, ll x, ll y,ll depth)
{
ll ch = seg[node];
ll mid = (x + y) / 2;
if (ch == 0 || ch == (y - x + 1)) {
return 0;