introvert_boi's blog

By introvert_boi, history, 14 months ago, In English

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.

  • Vote: I like it
  • -8
  • Vote: I do not like it

| Write comment?
»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

If the term 'leak' refers to a tester or writer publicly disclosing the solution to the 'leaked' problem before the contest, then you must provide evidence to support this claim.

If, on the other hand, 'leak' means that someone randomly sent the answer to the problem into an unknown Telegram channel during the contest, I suggest you consider retaking your grammar exam.