Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111819 | 万隽宇 | 数列求和 | C++ | Wrong Answer | 1 MS | 276 KB | 534 | 2025-03-06 18:37:50 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ long long a[52]; long long n,b=1,c=0; cin>>n; a[1]=0; for(int i=0;i<51;i++){ a[i]=b; b*=2; } if(n==1){ cout<<0; return 0; } for(int i=0;i<n;i++){ c+=a[i]; } cout<<c; return 0; }
------Input------
1
------Answer-----
1
------Your output-----
0