UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#208664#3765. 差距wsh02201001056ms1196kbC++11358b2024-08-03 09:10:262024-08-03 12:02:59

answer

#include <bits/stdc++.h>
using namespace std;
long long n,x,y,maxa,mina,maxb,minb;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>x>>y;
		if(i==1)
		{
			maxa=mina=x+y;
			maxb=minb=x-y;
		}
		maxa=max(maxa,x+y);
		maxb=max(maxb,x-y);
		mina=min(mina,x+y);
		minb=min(minb,x-y);
	}
	cout<<max(maxa-mina,maxb-minb);
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1192kb

input:

3000
792453998 306958027
996204014 600915334
-981568884 236264724
470759953 606485180
-53238153 -555...

output:

3941875385

result:

ok single line: '3941875385'

Test #2:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

3000
79975810 212758591
-601603486 -625555123
-708207563 -951706306
774109860 63713456
-946878280 50...

output:

3917242036

result:

ok single line: '3917242036'

Test #3:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

3000
691369894 -8116153
-443993089 719627429
-784315238 -928459306
271872303 -657587041
245813343 30...

output:

3960933529

result:

ok single line: '3960933529'

Test #4:

score: 10
Accepted
time: 118ms
memory: 1196kb

input:

200000
599323188 0
-843037110 0
518683150 0
-159076766 0
588819428 0
56209470 0
855323935 0
10073519...

output:

1999957119

result:

ok single line: '1999957119'

Test #5:

score: 10
Accepted
time: 109ms
memory: 1196kb

input:

200000
480502842 0
139974590 0
-311006285 0
296111828 0
-96216923 0
491915067 0
741774257 0
70377442...

output:

1999984073

result:

ok single line: '1999984073'

Test #6:

score: 10
Accepted
time: 113ms
memory: 1192kb

input:

200000
-713216891 0
897961748 0
-746428112 0
-906216677 0
-319987275 0
920073294 0
-47674064 0
18432...

output:

1999970653

result:

ok single line: '1999970653'

Test #7:

score: 10
Accepted
time: 162ms
memory: 1192kb

input:

200000
37685867 -780251225
743094375 -127258779
-135245284 -324381032
117211694 -763086777
544186852...

output:

3995976829

result:

ok single line: '3995976829'

Test #8:

score: 10
Accepted
time: 173ms
memory: 1192kb

input:

200000
272655496 813504818
-63935068 844884673
329969667 -935497929
939027783 774905192
63872339 -61...

output:

3988926702

result:

ok single line: '3988926702'

Test #9:

score: 10
Accepted
time: 163ms
memory: 1196kb

input:

200000
931816546 -929771953
478933054 204368625
-513722829 814068200
424836471 -113036793
-288435765...

output:

3989038088

result:

ok single line: '3989038088'

Test #10:

score: 10
Accepted
time: 218ms
memory: 1192kb

input:

200000
559626386 634020933
549422179 -500273550
281287608 320750484
67874874 196515538
-116637058 37...

output:

3994387298

result:

ok single line: '3994387298'

Extra Test:

score: 0
Extra Test Passed