Submission #1289076

#TimeUsernameProblemLanguageResultExecution timeMemory
1289076kaysanXORanges (eJOI19_xoranges)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define pp pop_back #define pf push_front #define pt pop_front #define fi first #define se second #define lb lower_bound #define ub upper_bound #define pll pair<ll,ll> #define pii pair<int,int> #define vl vector<ll> #define endl "\n" #define fr(i,a,b) for(ll i=a; i<=b; i++) #define fre(i,a,b) for(ll i=a; i>=b; i--) #define kpnyh ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // __builtin_ctzll(bits) kalo mau iterasi bits 1 nya aja const ll maxn = 1e5+7, maxn2 = 1e7+7, modn2 = 1e9+7, modn = 998244353; using namespace std; ll mul(ll x, ll y) {return (x*y) % modn;} ll add(ll x, ll y) {return(x+y) % modn;} ll dec(ll x, ll y) {return(x-y+modn) % modn;} ll binpow(ll x, ll y) {ll ret = 1;while (y) {if (y&1) ret = mul(ret,x); y/=2;x = mul(x,x);}return ret;} mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll te,n,m,k,q,s; void upd(ll i, ll val, ll n, vector<ll>&bit) { while (i <= n) { bit[i] ^= val; i += i & -i; } } ll qry(ll i, const vector<ll>&bit) { ll ret = 0; while (i > 0) { ret ^= bit[i]; i -= i & -i; } return ret; } void solve() { cin>>n>>q; vector<ll>a(n+1),bit(n+1),bit2(n+1); for (ll i=1; i<=n; i++) { cin>>a[i]; if (i&1) upd(i,a[i],n,bit); else upd(i,a[i],n,bit2); } while (q--) { ll x,y,z; cin>>x>>y>>z; if (x == 1) { if (y&1) { upd(y,a[y],n,bit); a[y] = z; upd(y,a[y],n,bit); } else { upd(y,a[y],n,bit2); a[y] = z; upd(y,a[y],n,bit2); } } else { if ((z - y + 1) % 2 == 0) { cout<<0<<endl; } else { if (y&1) { cout<<qry(z,bit) ^ qry(y-1,bit)<<endl; } else { cout<<qry(z,bit2) ^ qry(y-1,bit2)<<endl; } } } } } /*\ 1 5 2 3 98 99 20 31 74 27 31 50 26 90 10 91 27 50 21 */ int main () { kpnyh te=1; // cin>>te; while (te--) { // cout<<endl; solve(); } }

Compilation message (stderr)

xoranges.cpp: In function 'void solve()':
xoranges.cpp:71:52: error: invalid operands of types 'long long int' and 'const char [2]' to binary 'operator<<'
   71 |                     cout<<qry(z,bit) ^ qry(y-1,bit)<<endl;
      |                                        ~~~~~~~~~~~~^~
      |                                           |
      |                                           long long int
xoranges.cpp:73:54: error: invalid operands of types 'long long int' and 'const char [2]' to binary 'operator<<'
   73 |                     cout<<qry(z,bit2) ^ qry(y-1,bit2)<<endl;
      |                                         ~~~~~~~~~~~~~^~
      |                                            |
      |                                            long long int