You are viewing a single comment's thread. Return to all comments →
long getXor(long x){ int n=x%8; if(n==0||n==1)return x; if(n==2||n==3)return 2; if(n==4||n==5)return x+2; else return 0; } long xorSequence(long l, long r) { return getXor(r)^getXor(l-1); }
Seems like cookies are disabled on this browser, please enable them to open this website
Xor-sequence
You are viewing a single comment's thread. Return to all comments →
c++ optimal one