AtCoder Beginner Contest 440题解

AtCoder Beginner Contest 440题解

A

题意

求$X$翻倍$Y$次的结果 是翻倍不是求幂QAQ

思路

位运算或者$pow()$

代码

1
2
3
4
5
6
7
void solve(){   
int x, y;
cin >> x >> y;
// cout << x * pow(2, y) << endl;
while (y --) x <<= 1; // 位运算
cout << x << endl;
}
阅读更多