When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

tolbi's blog

By tolbi, 14 months ago, In English

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

fi yow odsndint udnestsnad yoib can askj in comenents

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;} ~~~~~

  • Vote: I like it
  • +1
  • Vote: I do not like it

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

Auto comment: topic has been updated by tolbi (previous revision, new revision, compare).

»
14 months ago, # |
  Vote: I like it +31 Vote: I do not like it

thaknss fo4r th1s awsoeme edutiroal!

»
14 months ago, # |
  Vote: I like it +17 Vote: I do not like it

your code didn't compile. can you fix it?

»
14 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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;
}
»
14 months ago, # |
Rev. 3   Vote: I like it +3 Vote: I do not like it

thenk yu for the explanat1on!!! ay ken n0w AC oll ex0R pr0bbblamss

»
14 months ago, # |
  Vote: I like it +11 Vote: I do not like it

ay dond undstersatnd pls fhelp

»
14 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Very gut tutoral. Pleas more

»
14 months ago, # |
  Vote: I like it +8 Vote: I do not like it

n1ec bolg, nwo 1 c4n b3 a lgm in 23 s3c0nds

»
14 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Veyr ince epxlantaion, txh!

»
14 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Tghsnkcs orf isth aeswome tut6969

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

r/ihadastroke

»
14 months ago, # |
  Vote: I like it +11 Vote: I do not like it

too difficult to understand, had to go through a grad level linear algebra textbook to even understand the notation. downvoted ù_ú

»
14 months ago, # |
  Vote: I like it +8 Vote: I do not like it

yur qurey si viod soo it caonot reutn bolo.