Submission #571481

#TimeUsernameProblemLanguageResultExecution timeMemory
571481ntttXOR (IZhO12_xor)C++14
0 / 100
2053 ms1036 KiB
#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 timeMemoryGrader output
Fetching results...