Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
111818 万隽宇 数列求和 C++ Wrong Answer 1 MS 272 KB 454 2025-03-06 18:23:15

Tests(2/5):


Code:

#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(){ int a[51]={0}; int n,b=1,c=0; cin>>n; for(int i=0;i<50;i++){ a[i]=b; b*=2; } for(int i=0;i<n;i++){ c+=a[i]; } cout<<c; return 0; }


Run Info:

------Input------
40
------Answer-----
1099511627775
------Your output-----
-1