6 条题解

  • 1
    @ 2025-3-10 12:41:51

    a=int(input()) print(2**(a)-1)

    • 1
      @ 2023-7-12 15:27:40
      #include <bits/stdc++.h>
      using namespace std;
      long long int price(int a)
      {
      	long long int b=0,c=1;
      	for(int i=1;i<=a;i++)
      	{
      		b+=c;
      		c*=2;
      	
      	}
      	return b;
      }
      
      int main() 
      {
      	int qi;
      	cin>>qi;
      	cout<<price(qi)<<endl;
      return 0;
      }
      
      • -2
        @ 2023-7-13 9:33:52

        #include<bits/stdc++.h> using namespace std; int main() { long a,s=0; cin>>a; for (int i=1;i<=a;i++) { s=s+pow(2,i-1); } cout<<s; }

        • -3
          @ 2023-5-8 15:24:31
          a=int(input())
          i=0
          c=0
          if a<=50:
              while i<=a-1:
                  c+=2**i
                  i+=1
              print(c)
          
          • -4
            @ 2024-3-5 10:56:00

            print(2**int(input())-1)#大道至简

            • -14
              @ 2022-12-10 11:19:37
              • 1

              信息

              ID
              71
              时间
              1000ms
              内存
              128MiB
              难度
              4
              标签
              递交数
              816
              已通过
              400
              上传者