Skip to content

Instantly share code, notes, and snippets.

View dotslash's full-sized avatar
🍊
🍒

Sai Teja Suram dotslash

🍊
🍒
View GitHub Profile
@dotslash
dotslash / Main.scala
Last active December 15, 2015 06:49
Scala Template
import java.io._
import java.util._
import java.math._
class InputReader(stream: InputStream)
{
val br : BufferedReader = new BufferedReader(new InputStreamReader(stream))
var tokenizer : StringTokenizer = null
#define _all5 0x55555555
#define _all3 0x33333333
#define _all0F 0x0F0F0F0F
#define _all01 0x01010101
#define _to64(x) (((long long)x)<<32 + x)
int NumberOfSetBits64(long long i)
{
i = i - ((i >> 1) & _to64(_all5));
i = (i & _to64(_all3)) + ((i >> 2) & _to64(_all3));