# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
236096 |
2020-05-31T07:47:17 Z |
VEGAnn |
Dojave (COCI17_dojave) |
C++14 |
|
4000 ms |
12664 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 in[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(in, in + (1 << m), 0);
for (int r = l; r < (1 << m); r++){
xr ^= a[r];
in[a[r]] = 1;
if (xr == need){
if (r - l + 3 <= (1 << m) || (r - l + 1 > 1))
ans++;
// else cerr << l << " " << r << '\n';
} else {
bool ok = 0;
for (int i = l; i <= r && !ok; i++){
int nd = (need ^ a[i] ^ xr);
if (!in[nd])
ok = 1;
}
if (ok)
ans++;
// else cerr << l << " " << r << '\n';
}
}
}
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 |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1324 ms |
384 KB |
Output is correct |
2 |
Correct |
552 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4046 ms |
384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1626 ms |
572 KB |
Output is correct |
2 |
Execution timed out |
4067 ms |
512 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4064 ms |
1024 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4064 ms |
1024 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4066 ms |
3320 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4088 ms |
12536 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4040 ms |
12664 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |