Today Codeforces Problem E — Leaked

Revision en1, by introvert_boi, 2023-09-07 20:34:44

include<bits/stdc++.h>

using namespace std;

define ll long long

define pb push_back

define loop(n) for(long long i=0;i<n;i++)

define rloop(n) for(long long i=n-1;i>=0;i--)

////////////////////////////////////////////

//////////////////////////////////////////////

signed main(){

ios::sync_with_stdio(false);
  cin.tie(nullptr);

  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output2.txt","w",stdout);
   #endif

int test_cases; cin>>test_cases; while(test_cases--){

ll n; cin>>n;

ll a[n]; loop(n)cin >>a[i];

string s; cin >>s;

vectorx(n+1,0); int b=0,c=0; loop(n){ x[i+1]=x[i]^a[i]; if(s[i]=='0')b^=a[i]; else c^=a[i]; } //b for zero //c for one

ll q; cin >>q; while(q--){ ll t; cin >>t; ll pp,qq; if(t == 1){ cin >>pp >> qq; c=(c^x[qq]^x[pp-1]); b=(b^x[qq]^x[pp-1]);

}else {
    cin >> pp;
    if(pp==0)cout<<b;
    else cout<<c;
    cout<<" ";

}

} cout<<"\n";

} return 0; }

This code was leaked in the telegram.

Please Codeforces Head look into the matter and check the submission of the participants.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English introvert_boi 2023-09-07 20:34:44 1284 Initial revision (published)