Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76297 彭林江 数列求和 C++ Wrong Answer 1 MS 272 KB 256 2024-06-02 11:03:43

Tests(2/5):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n, sum = 0; cin >> n; int a[51]; a[1] = 1; for(int i = 2; i <= n; i++){ a[i] = a[i-1] * 2; } for(int i = 1; i <= n; i++){ sum += a[i]; } cout <<sum; return 0; }


Run Info:

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