Codeforces 1348A. Phoenix and Balance Solution
Solution in c++:
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a,sum,i,j,t;
- cin>>t;
- for(j=1; j<=t; j++)
- {
- sum=0;
- cin>>a;
- {
- for(i=1; i<=a/2; i++)
- {
- sum=sum+pow(2,i);
- }
- cout<<sum<<endl;
- }
- }
- }
Wrong code, read the problem again. You just added all of them, it's wrong.
ReplyDeleteBuddy, you got screws loose. This solution is probably too good for your brain to think.
Delete