# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111068 | Tsagana | XOR (IZhO12_xor) | C++14 | 1 ms | 336 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(x) x.begin(), x.end()
#define lnl long long
#define pq priority_queue
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pp pop_back
#define F first
#define S second
using namespace std;
int dp[250000];
void solve () {
int n, s; cin >> n >> s;
dp[0] = 0;
for (int i = 1; i <= n; i++) {
int x; cin >> x;
dp[i] = dp[i-1]^x;
}
for (int i = n; i > 1; i--)
for (int j = 0; j < i; j++) {
if (dp[j]^dp[i] >= s) {
cout << j+1 << ' ' << i-j;
return ;
}
}
}
int main() {IOS solve(); return 0;}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |