# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41088 | kriii | Snake Escaping (JOI18_snake_escaping) | C++14 | 865 ms | 21960 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 <stdio.h>
int L,Q;
char sc[1<<20+2]; int bc[1<<20];
int Z[1<<20],O[1<<20];
void go(int l, int r)
{
if (l+1 == r) return;
int m = (l + r) / 2;
go(l,m);
go(m,r);
for (int i=l;i<m;i++){
Z[i-l+m] += Z[i];
O[i] += O[i-l+m];
}
}
int main()
{
scanf ("%d %d",&L,&Q);
scanf ("%s",sc);
for (int i=0;i<(1<<L);i++){
if (i) bc[i] = bc[i-(i&(-i))] + 1;
Z[i] = O[i] = sc[i] - '0';
}
go(0,(1<<L));
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... |