Submission #1049315

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10493152024-08-08 16:20:22sofija6XOR (IZhO12_xor)C++14
0 / 100
1 ms2396 KiB
#include <bits/stdc++.h>
#define ll long long
#define MAXN 250010
using namespace std;
ll a[MAXN],pref[MAXN];
map<ll,ll> pos;
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll n,x,ansi=0,ansk=0;
cin >> n >> x;
for (ll i=1;i<=n;i++)
{
cin >> a[i];
pref[i]=pref[i-1]^a[i];
}
for (ll i=n;i>=0;i--)
{
ll val=0;
for (ll j=30;j>=0;j--)
{
if ((1<<j)&x)
{
if (!((1<<j)&pref[i]))
val+=(1<<j);
continue;
}
if (!((1<<j)&pref[i]))
val+=(1<<j);
if (pos[val]-i>ansk)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...