Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FAK MEN
#include <iostream> #include <vector> #include <map> using namespace std; typedef long long ll; int main() { int n, mult = 1; map<int, int> datos; int res = 0; datos[0] = 0; datos[1] = 0; datos[3] = 1; datos[7] = 3; datos[15] = 7; datos[31] = 15; datos[63] = 31; datos[127] = 63; datos[255] = 127; datos[511] = 255; datos[1023] = 511; datos[2047] = 1023; datos[4095] = 2047; datos[8191] = 4095; datos[16383] = 8191; datos[32767] = 16383; datos[65535] = 32767; datos[131071] = 65535; datos[262143] = 131071; datos[524287] = 262143; datos[1048575] = 524287; datos[2097151] = 1048575; datos[4194303] = 2097151; datos[8388607] = 4194303; datos[16777215] = 8388607; datos[33554431] = 16777215; datos[67108863] = 33554431; datos[134217727] = 67108863; datos[268435455] = 134217727; datos[536870911] = 268435455; for(int i=1; i<1000000000; i++) { res = 0; mult = 1; //scanf("%d", &n); n = i; cout << "" << n << " "; while(true) { if( datos[n] != 0 or n == 1 ) break; if(n&1 and n != 1) { //cout << "\nMult: " << mult << "N: " << n << "\n"; res+=1*mult; n--; } n>>=1; mult*=2; } printf("%d\n", res+=mult*datos[n]); } }
run
|
edit
|
history
|
help
0
dsu on tree(264E BLOOD COUSIN RETURNS)
Two pointer - MUST DO
avx2 optimized pcg32 random number generator
DP Optimization another kind
float precision test
articulation points and bridges
water drop/ water land
Default_Template
inorder traversal
simple use of templete