# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
366857 | leinad2 | 조개 줍기 (KOI17_shell) | C++17 | 812 ms | 126188 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>
#define int long long
using namespace std;
int n, i, j, k, a, b, B[1510][1510], ans;
char c;
struct tree
{
int seg[6010], lazy[6010];
void busy(int id, int s, int e, int m)
{
seg[id*2]+=(m-s+1)*lazy[id];
seg[id*2+1]+=(e-m)*lazy[id];
lazy[id*2]+=lazy[id];
lazy[id*2+1]+=lazy[id];
lazy[id]=0;
}
void update(int id, int s, int e, int l, int r, int v)
{
if(l>r)return;
if(e<l||r<s)return;
if(l<=s&&e<=r)
{
seg[id]+=(e-s+1)*v;
lazy[id]+=v;
return;
}
int m=s+e>>1;
busy(id, s, e, m);
update(id*2, s, m, l, r, v);
update(id*2+1, m+1, e, l, r, v);
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... |