MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / init_is_square

Function init_is_square

code/tricks/is_square.cpp:2–3  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1long long M;
2void init_is_square() {
3 rep(i,0,64) M |= 1ULL << (63-(i*i)%64); }
4inline bool is_square(ll x) {
5 if (x == 0) return true; // XXX
6 if ((M << x) >= 0) return false;

Callers 1

testFunction · 0.85

Calls

no outgoing calls

Tested by 1

testFunction · 0.68