Submission #38922

#TimeUsernameProblemLanguageResultExecution timeMemory
38922TalantXOR (IZhO12_xor)C++14
0 / 100
2000 ms4360 KiB
#include <bits/stdc++.h> #define fr first #define sc second #define OK puts("OK"); #define pb push_back #define mk make_pair using namespace std; typedef long long ll; const int inf = (int)1e9 + 7; const int N = (int)3e5 + 7; int n,k; int a[N]; int p[N]; int id,o; int main () { cin >> n >> k; for (int i = 1; i <= n; i ++) { cin >> a[i]; p[i] = (p[i - 1] ^ a[i]); } for (int i = 1; i <= n; i ++) { for (int j = i; j <= n; j ++) { if ((p[j] ^ p[i - 1]) >= k) { if (o < (j - i + 1)) id = i,o = (j - i + 1); } } } cout << id << " " << o << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...