# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
571477 | 2022-06-02T09:53:43 Z | nttt | XOR (IZhO12_xor) | C++14 | 2 ms | 340 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; } int n, x; int 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++) { int 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; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |