# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
571481 |
2022-06-02T09:56:33 Z |
nttt |
XOR (IZhO12_xor) |
C++14 |
|
2000 ms |
1036 KB |
#include<bits/stdc++.h>
using namespace std;
#define MASK(i) (1LL << (i))
#define BIT(x, i) ((x >> (i)) & 1)
#define fi first
#define se second
#define ll long long
#define task "C"
const int oo = 1e9 + 7;
const ll loo = (ll)1e18 + 7;
const int MOD = 1e9 + 7;
const int N = 2e6 + 3;
const int BASE = 10;
template <typename T1, typename T2> bool minimize(T1 &a, T2 b)
{
if (a > b) {a = b; return true;} return false;
}
template <typename T1, typename T2> bool maximize(T1 &a, T2 b)
{
if (a < b) {a = b; return true;} return false;
}
ll n, x;
ll a[N];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//freopen(task".in" , "r" , stdin);
//freopen(task".out" , "w" , stdout);
cin >> n >> x;
for (int i = 1; i <= n; i++) cin >> a[i];
pair<int, int> ans;
for (int i = 1; i <= n; i++)
{
ll s = 0;
for (int k = i; k <= n; k++)
{
s ^= a[k];
if(s >= x && k - i > ans.se - ans.fi ) ans = make_pair(i, k);
}
}
cout << ans.fi << " " << ans.se - ans.fi + 1;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
225 ms |
468 KB |
Output is correct |
6 |
Correct |
429 ms |
468 KB |
Output is correct |
7 |
Correct |
346 ms |
548 KB |
Output is correct |
8 |
Correct |
478 ms |
596 KB |
Output is correct |
9 |
Execution timed out |
2053 ms |
1036 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |