QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65413#5122. Strange SumressoaWA 2ms3408kbC++17439b2022-11-30 15:35:012022-11-30 15:35:05

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-30 15:35:05]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3408kb
  • [2022-11-30 15:35:01]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
    int n;
    cin>>n;
    ll a[n+1];
    for(int i=1;i<=n;i++)cin>>a[i];
    ll mx=max(0ll,a[0]);
    for(int i=1;i<n;i++)mx=max(mx,a[i]+a[i+1]);
    cout<<mx<<'\n';
    return void();
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t=1;
//    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3352kb

input:

4
1 4 3 2

output:

7

result:

ok 1 number(s): "7"

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3408kb

input:

3
-10 -10 -10

output:

94659612431856

result:

wrong answer 1st numbers differ - expected: '0', found: '94659612431856'