1 solutions

  • 0
    @ 2025-12-3 16:15:31

    C++ :

    #include<iostream>
    #include<cstdio>
    using namespace std;
    
    int N,ans;
    
    int main()
    {
    //	freopen("ap.in","r",stdin);
    //	freopen("ap.out","w",stdout);	
        cin >>N;
        ans=2;
    	for (int i=1; i<N; i++)
    	{
    		ans = (ans+1)*2;
    	}
        cout << ans<<endl;
    	return 0;
    }
    
    • 1

    Information

    ID
    847
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    7
    Accepted
    4
    Uploaded By