QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#100841#5122. Strange Sumlgvc#AC ✓12ms4864kbC++231.6kb2023-04-28 12:39:142023-04-28 12:39:16

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-28 12:39:16]
  • 评测
  • 测评结果:AC
  • 用时:12ms
  • 内存:4864kb
  • [2023-04-28 12:39:14]
  • 提交

answer

//这回只花了114514min就打完了。
//真好。记得多手造几组。
#include <bits/stdc++.h>
//#define int long long
#define pai 3.141592653589793238462643383279502884197169399375105820
#define MOD 1000000007
#define eps 0.00000001
inline int min(int a,int b) {return a<b?a:b;}
inline int max(int a,int b) {return a>b?a:b;}
#define ULL unsigned long long
#define LL long long
#define INF 0x3f3f3f3f
#define INF_LL 0x3f3f3f3f3f3f3f3f
static char buf[1000000],*paa=buf,*pd=buf;
static char buf2[1000000],*pp=buf2;
#define getchar() paa==pd&&(pd=(paa=buf)+fread(buf,1,1000000,stdin),paa==pd)?EOF:*paa++
inline void pc(char ch){
	if(pp-buf2==1000000) fwrite(buf2,1,1000000,stdout),pp=buf2;
	*pp++=ch;
}
inline void pcc(){
	fwrite(buf2,1,pp-buf2,stdout);
	pp=buf2;
}
inline int read(void) {
	int w=1;
	register int x(0);register char c(getchar());
	while(c<'0'||c>'9') {if(c=='-') w=-1;c=getchar();}
	while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return w*x;
}
void write(int x) {
	if(x<0) pc('-'),x=-x;
	static int sta[20];
	int top=0;
	do {
		sta[top++]=x%10,x/=10;
	} while(x);
	while(top) pc(sta[--top]+48);
}
void we(int x) {
	write(x);
	pc('\n');
}
inline bool cmp_xi(int a,int b) {return a<b;}
inline bool cmp_da(int a,int b) {return a>b;}
int N,a[1000009];
signed main(void) {
    //freopen("m.in","r",stdin);
    //freopen("m.out","w",stdout);
	N=read();
	for(int i=1;i<=N;i++) {
		a[i]=read();
	}
	std::sort(a+1,a+N+1,cmp_da);
	int as=0;
	as=std::max(as,a[1]);
	as=std::max(as,a[1]+a[2]);
    printf("%d",as);
	return 0;
}


詳細信息

Test #1:

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

input:

4
1 4 3 2

output:

7

result:

ok 1 number(s): "7"

Test #2:

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

input:

3
-10 -10 -10

output:

0

result:

ok 1 number(s): "0"

Test #3:

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

input:

2
-394027216 -486855090

output:

0

result:

ok 1 number(s): "0"

Test #4:

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

input:

3
-357735986 584247758 118625500

output:

702873258

result:

ok 1 number(s): "702873258"

Test #5:

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

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: 0
Accepted
time: 2ms
memory: 3548kb

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:

229738661

result:

ok 1 number(s): "229738661"

Test #7:

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

input:

5000
457233381 -334308427 -945383311 109737141 220522283 -825145950 983334529 -800255337 260343217 577537758 839314256 172673836 -263048041 -557219056 482052599 -232488897 -623040424 952406032 -108025788 294934125 -207134390 -418498487 -108935754 -462409857 786736393 264922451 -285331046 51041867 -1...

output:

1998884140

result:

ok 1 number(s): "1998884140"

Test #8:

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

input:

5000
-86752678 -923106715 -617820559 -752205976 -985440235 -720875583 -160332291 -248766223 -807631910 -403138655 -562471495 -169464418 -224444502 -58797020 -994589274 -72633250 -247579219 -136505811 -512852945 -579246808 -914472276 -616164381 -352686946 -239352972 -635125610 -738674382 -284271708 -...

output:

652078770

result:

ok 1 number(s): "652078770"

Test #9:

score: 0
Accepted
time: 12ms
memory: 4856kb

input:

100000
-806539626 37327278 -723627534 -712013395 -936543383 -703760083 -500091286 919372769 -239257228 -947626941 128041284 -620762788 -18059293 -485581078 269417107 -737588653 389995721 -687038683 -534038890 -581807543 929003083 939555027 -894345018 559795178 502351625 -53905303 829244616 841015040...

output:

1999980954

result:

ok 1 number(s): "1999980954"

Test #10:

score: 0
Accepted
time: 12ms
memory: 4864kb

input:

100000
-695136745 -397897138 -571418704 -364038958 -482957315 -69257144 -488540027 -451766730 -689323291 -561002861 -593508839 -983556946 -358885894 -583971761 -806557945 -324148965 -965668249 -618230724 -947485650 -687630271 -806991393 -262571198 -606474447 -714504889 -952150250 -38061847 -58721255...

output:

0

result:

ok 1 number(s): "0"