Skip to content

Instantly share code, notes, and snippets.

View SamuelGabriel's full-sized avatar

Samuel Müller SamuelGabriel

View GitHub Profile
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
long long onesFromTo(long long a,long long b){// counts number of ones for a>=0 and b>=0 and a<=b
long long right = 0,count = 0,countedb = 0,counteda = 0,lastbitb = 0,lastbita = 0;