MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / power

Function power

CSES/Intro/DigitQueries.cc:4–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace::std;
3
4int64_t power(int64_t x,int64_t y) {
5 int64_t res = 1;
6 while (y > 0) {
7 if (y & 1) res = res * x;
8 y = y >> 1;
9 x = (x * x);
10 }
11 return res;
12}
13
14int main(){
15 ios_base::sync_with_stdio(false),cin.tie(nullptr);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected