# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
371153 | daniel920712 | Intergalactic ship (IZhO19_xorsum) | C++14 | 2084 ms | 6124 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 <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
long long all[200005];
pair < pair < long long , long long > , long long > tt[200005];
long long ans=0,N,M,MOD=1e9+7;
void F(long long here)
{
long long i,j,t;
if(here==M)
{
for(i=1;i<=N;i++)
{
t=0;
for(j=i;j<=N;j++)
{
t+=all[j];
ans+=t*t;
ans%=MOD;
}
}
return;
}
F(here+1);
for(i=tt[here].first.first;i<=tt[here].first.second;i++) all[i]^=tt[here].second;
F(here+1);
for(i=tt[here].first.first;i<=tt[here].first.second;i++) all[i]^=tt[here].second;
}
int main()
{
long long i;
scanf("%lld",&N);
for(i=1;i<=N;i++) scanf("%lld",&all[i]);
scanf("%lld",&M);
//printf("%lld\n",M);
for(i=0;i<M;i++) scanf("%lld %lld %lld",&tt[i].first.first,&tt[i].first.second,&tt[i].second);
F(0);
printf("%lld\n",ans);
return 0;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |