5 条题解

  • 1
    @ 2024-12-6 20:09:49

    whytherearepeople不会

    include<bits/stdc++.h>
    using namespace std;
    long long a,ans=1;
    int main()
    {
    	cin>>a;
    	for(int i=1;i<=a;i++)ans = (ans+1)*2;
    	cout<<ans;
    	return 0;
    }
    
    • 0
      @ 2024-11-22 20:08:42

      #include<iostream> #include<iomanip> #include<cmath> using namespace std; int main() { int n,sum=1; cin>>n; for(int i=1;i<=n;i=i+1) { sum=2*(sum+1); } cout<<sum; return 0; }

      • 0
        @ 2023-9-10 11:54:31
        /************************************
        Note Book:
        ************************************/
        #include <iostream>
        #include <cstdio>
        #include <iomanip>
        #include <cmath>
        #include <algorithm>
        #include <cstring>
        #include <string>
        #include <stack>
        #include <queue>
        #include <math.h>
        #define LL long long
        using namespace std;
        const int INF = 0x3f3f3f3f;
        const int N = 1e5 + 10;
        int n , shuliang = 1; 
        int main()
        {
        	cin >> n;
        	while( n-- )
        	{
        		shuliang = shuliang + 1;
        		shuliang = shuliang * 2; 
        	}
        	cout << shuliang;
        	return 0;
        }
        
        
        
        • 0
          @ 2023-2-4 21:11:13
          #include<bits/stdc++.h>
          #include <math.h>
          #include <stack>
          #include <stdio.h>
          #include <iostream>
          #include <vector>
          #include <iomanip>
          #include <string>
          #include <algorithm>
          using namespace std;
          int main(){
              int n,m=1;
              cin>>n;
              while(n>0){
                  m=(m+1)*2;
                  n--;
              }
              cout<<m;
          }
          
          • -1
            @ 2022-7-11 9:21:31

            //dev c++[[990.cpp]]*******

            //dev c++[top fanil]]******

            //dev c++*www.temege.com

            #include <stdio.h>

            #include <iostream>

            #include <math.h>

            #include <queue>

            #include <stack>

            #include <vector>

            #include <iomanip>

            #include <string.h>

            #include <algorithm>

            using namespace std;

            #define LL long long

            const int N=1e6+10;

            const int INF=0x3f3f3f3f;

            int a[110];

            int main()

            {

            int n;
            
            cin>>n;
            
            int sum=1;
            
            while(n--)
            
            {
            
            	sum=(sum+1)*2;
            
            }
            
            cout<<sum<<endl;
            
            return 0;
            

            }

            • 1

            信息

            ID
            1954
            时间
            1000ms
            内存
            128MiB
            难度
            3
            标签
            递交数
            204
            已通过
            107
            上传者