### tolbi's blog

By tolbi, 16 months ago,

level: **VERY HARD*

hello today am gonna tech xor basis/ but proofs are very hard so no proof. it inituavautve

okl we hvae arary basis[37] mane basis[i] mst's i so we habvee

flolpowing codem for is to isnert x in tonhe the set;/ buist it's bveyr har adsso i wont';t exp[alaomn

# include<stdc++/bits.h>

using namespace = std; typedef int long long; void insert(x){ for(i in 30 to 0) if(x's i'th bit is not 1) : ccinonitue if(basis[i] == -1) basis[i] = x; break; else x = x $\oplus$ basis[i] } ~~~~~

isneritng is same aas qureying hwo to i mane queery if ew cna maefae the X swith gigven xorn basis ealneaments

UPD: code for query

# include<stdc++/bits.h>

using namespace = std; typedef int long long; void insert(x){ for(i in 30 to 0) if(x's i'th bit is not 1) : ccinonitue if(basis[i] == -1) return false; else x = x $\oplus$ basis[i] return true;} ~~~~~

• +1

| Write comment?
 » 16 months ago, # |   +6 Auto comment: topic has been updated by tolbi (previous revision, new revision, compare).
 » 16 months ago, # |   +31 thaknss fo4r th1s awsoeme edutiroal!
 » 16 months ago, # |   +17 your code didn't compile. can you fix it?
»
16 months ago, # |
Rev. 2   0

# If you enter:

cpp

#include <iostream>

using namespace std;

int main{

int array[10];

return 0;

}



# Then it will show:

#include <iostream>
int main{
int array[10];
return 0;
}

•  » » 16 months ago, # ^ |   0 I thonk ne dids on purpusr
•  » » » 16 months ago, # ^ |   +8 Y er porbly ritgh
 » 16 months ago, # | ← Rev. 3 →   +3 thenk yu for the explanat1on!!! ay ken n0w AC oll ex0R pr0bbblamss
 » 16 months ago, # |   +11 ay dond undstersatnd pls fhelp
 » 16 months ago, # |   +14 Very gut tutoral. Pleas more
 » 16 months ago, # |   +8 n1ec bolg, nwo 1 c4n b3 a lgm in 23 s3c0nds
 » 16 months ago, # |   +4 Veyr ince epxlantaion, txh!
 » 16 months ago, # |   +3 Tghsnkcs orf isth aeswome tut6969
 » 16 months ago, # |   0 r/ihadastroke
 » 16 months ago, # |   +11 too difficult to understand, had to go through a grad level linear algebra textbook to even understand the notation. downvoted ù_ú
 » 16 months ago, # |   +8 yur qurey si viod soo it caonot reutn bolo.