# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
571473 |
2022-06-02T09:45:29 Z |
vbee |
XOR (IZhO12_xor) |
C++14 |
|
2000 ms |
2512 KB |
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define fi first
#define se second
#define TASK "c"
#define ll long long
#define pll pair<ll, ll>
#define vll vector<ll>
#define vpll vector<pll>
#define pb push_back
#define MASK(i) (1 << (i))
#define BIT(x, i) ((x >> (i)) & 1)
using namespace std;
const int oo = 1e9 + 7;
const ll loo = (ll)1e18 + 7;
const int N = 3e5 + 7;
ll n, x, a[N], prexor[N];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
// freopen(TASK".inp", "r", stdin);
// freopen(TASK".out", "w", stdout);
cin >> n >> x;
for (int i = 1; i <= n; i++){
cin >> a[i];
prexor[i] = prexor[i - 1] ^ a[i];
}
for (int k = n; k >= 1; k--){
for (int i = 1; i <= n - k + 1; i++){
if ((prexor[i + k - 1] ^ prexor[i - 1]) >= x) {
return cout << i << " " << k, 0;
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
125 ms |
808 KB |
Output is correct |
6 |
Correct |
151 ms |
944 KB |
Output is correct |
7 |
Correct |
223 ms |
852 KB |
Output is correct |
8 |
Correct |
280 ms |
1048 KB |
Output is correct |
9 |
Execution timed out |
2067 ms |
2512 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |