# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336369 | 2020-12-15T05:44:26 Z | juggernaut | Intergalactic ship (IZhO19_xorsum) | C++14 | 2000 ms | 492 KB |
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,a[105],pref[105],q,l[15],r[15],val[15],mod=1e9+7; void _xor(int mask){ for(int i=0;i<q;i++)if(mask&(1<<i))for(int pos=l[i+1];pos<=r[i+1];pos++)a[pos]^=val[i+1]; } ll sq(ll x){return (x*x)%mod;} ll go(int mask){ _xor(mask); ll res=0; for(int i=1;i<=n;i++)pref[i]=pref[i-1]+a[i]; for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) res=(res+sq(pref[i]-pref[j-1]))%mod; _xor(mask); return res; } int main(){ scanf("%lld",&n); for(int i=1;i<=n;i++)scanf("%lld",&a[i]); scanf("%lld",&q); for(int i=1;i<=q;i++)scanf("%lld%lld%lld",&l[i],&r[i],&val[i]); ll ans=go(0); for(int mask=1;mask<(1<<q);mask++)ans=(ans+go(mask))%mod; cout<<ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 2 ms | 492 KB | Output is correct |
5 | Correct | 2 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 2 ms | 492 KB | Output is correct |
5 | Correct | 2 ms | 364 KB | Output is correct |
6 | Correct | 56 ms | 492 KB | Output is correct |
7 | Correct | 56 ms | 364 KB | Output is correct |
8 | Correct | 57 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2080 ms | 364 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 2 ms | 492 KB | Output is correct |
5 | Correct | 2 ms | 364 KB | Output is correct |
6 | Correct | 56 ms | 492 KB | Output is correct |
7 | Correct | 56 ms | 364 KB | Output is correct |
8 | Correct | 57 ms | 376 KB | Output is correct |
9 | Incorrect | 1 ms | 364 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 2 ms | 492 KB | Output is correct |
5 | Correct | 2 ms | 364 KB | Output is correct |
6 | Correct | 56 ms | 492 KB | Output is correct |
7 | Correct | 56 ms | 364 KB | Output is correct |
8 | Correct | 57 ms | 376 KB | Output is correct |
9 | Incorrect | 1 ms | 364 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 2 ms | 492 KB | Output is correct |
5 | Correct | 2 ms | 364 KB | Output is correct |
6 | Correct | 56 ms | 492 KB | Output is correct |
7 | Correct | 56 ms | 364 KB | Output is correct |
8 | Correct | 57 ms | 376 KB | Output is correct |
9 | Execution timed out | 2080 ms | 364 KB | Time limit exceeded |
10 | Halted | 0 ms | 0 KB | - |