Submission #466152

#TimeUsernameProblemLanguageResultExecution timeMemory
466152ardaak33XORanges (eJOI19_xoranges)C++17
0 / 100
1088 ms1076 KiB
#include<bits/stdc++.h> using namespace std; unsigned int ulutoplam=0; unsigned int sayilar[200005]; void guncel(unsigned int indis,unsigned int sayi) { ulutoplam^=sayilar[indis]; sayilar[indis]=sayi; ulutoplam^=sayilar[indis]; } unsigned int yap(int l,int r) { unsigned int sonuc=0; for (int i = 1; i <= r-l+1; i++) { if(i%2){ int indi=r; for (int j = 0; j < i; j++) { if(j %2){ sonuc ^=sayilar[j+l]; sonuc^=sayilar[indi]; } indi--; } sonuc^=ulutoplam; } else{ int bindi=r; for (int j = 0; j < i; j++) { if(!(j %2)){ sonuc ^=sayilar[j+l]; sonuc^=sayilar[bindi]; } bindi--; } } } return sonuc; } int main() { cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false); int n,q; cin >> n >> q; for (int i = 1; i <= n; i++) { cin >> sayilar[i]; ulutoplam^=sayilar[i]; } for (int i = 0; i < q; i++) { unsigned int sayi1,sayi2,sayi3; cin >> sayi1 >> sayi2>> sayi3; if(sayi1==1) guncel(sayi2,sayi3); else cout << yap(sayi2,sayi3)<<endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...