# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
236167 |
2020-05-31T10:35:46 Z |
VEGAnn |
Dojave (COCI17_dojave) |
C++14 |
|
4000 ms |
5444 KB |
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define a3 array<int, 3>
using namespace std;
const int N = (1 << 20);
const int oo = 2e9;
int a[N], need, m, ans = 0;
bool par[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> m;
for (int i = 0; i < (1 << m); i++)
cin >> a[i];
need = (1 << m) - 1;
for (int l = 0; l < (1 << m); l++){
int xr = 0;
fill(par, par + (1 << m), 0);
int kol = 0;
for (int r = l; r < (1 << m); r++){
xr ^= a[r];
par[a[r]] = 1;
if (par[need - a[r]])
kol--;
else kol++;
if (xr == need){
if (r - l + 3 <= (1 << m) || (r - l + 1 > 1))
ans++;
} else {
if (kol > 0)
ans++;
}
}
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
512 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
384 KB |
Output is correct |
2 |
Correct |
48 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
139 ms |
384 KB |
Output is correct |
2 |
Correct |
189 ms |
444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
744 ms |
512 KB |
Output is correct |
2 |
Correct |
617 ms |
608 KB |
Output is correct |
3 |
Correct |
574 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4062 ms |
640 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4078 ms |
640 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4059 ms |
1656 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4072 ms |
5428 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4069 ms |
5444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |