QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65099#5122. Strange SumsunseaWA 2ms3412kbC++14245b2022-11-27 16:20:072022-11-27 16:20:09

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-27 16:20:09]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3412kb
  • [2022-11-27 16:20:07]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<=n-1;i++){
		cin>>a[i];
	}sort(a.begin(),a.end());
	cout<<max(0ll,a[n-1]+a[n-2])<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3284kb

input:

4
1 4 3 2

output:

7

result:

ok 1 number(s): "7"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3296kb

input:

3
-10 -10 -10

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3300kb

input:

2
-394027216 -486855090

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3312kb

input:

3
-357735986 584247758 118625500

output:

702873258

result:

ok 1 number(s): "702873258"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3264kb

input:

100
56104366 -596757183 -563118094 -754585503 -108568019 320836846 955898372 745823264 942812454 -13940121 510253952 538293489 -683482556 159329401 -488586607 718665544 -560503132 167141318 -121480647 873802880 -642178792 64201005 -768929811 383561940 -993409166 441561051 -205099595 858985447 181520...

output:

1932124867

result:

ok 1 number(s): "1932124867"

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3412kb

input:

100
-567600476 -894106086 -223725076 -909882978 -400731198 -189239097 -462293199 -238554058 -941987047 -722267978 -296331743 -93421496 -940651029 -80663430 -930158710 -549118977 -793669840 -994577540 -617696981 -976257121 -982653934 -418566026 -527080389 -35686402 -90648977 -289869319 -933020191 -42...

output:

225158686

result:

wrong answer 1st numbers differ - expected: '229738661', found: '225158686'