Submission #19724513


Source Code Expand

Copy
#include <cstdio>
#include <algorithm>
using namespace std;
int Abs(int x){return x>0?x:-x;}
int main() {
	int T;
	scanf("%d",&T);
	while(T--)
	{
		int ax,ay,bx,by,cx,cy,X,Y,sx=-1,sy=-1,ans=-1;
		scanf("%d %d %d %d %d %d",&ax,&ay,&bx,&by,&cx,&cy);
		X=min(ax,min(bx,cx));Y=min(ay,min(by,cy));
		sx+=Abs(X-ax)+Abs(X-bx)+Abs(X-cx);
		sy+=Abs(Y-ay)+Abs(Y-by)+Abs(Y-cy);
		ans=max(Abs(X*2+sx),Abs(Y*2+sy));
		if(Abs(X*2+sx)==Abs(Y*2+sy)&&Abs(X*2+sx)>=2) ans++;
		printf("%d\n",ans);
	}
	return 0;
}

Submission Info

Submission Time
Task D - L
User SenseAnone
Language C++ (Clang 10.0.0)
Score 0
Code Size 513 Byte
Status WA
Exec Time 10 ms
Memory 3192 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 600
Status
AC × 1
WA × 1
AC × 6
WA × 9
Set Name Test Cases
Sample sample.txt, sample_2.txt
All edge.txt, edge_2.txt, edge_3.txt, edge_4.txt, edge_5.txt, edge_6.txt, edge_7.txt, edge_8.txt, random.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, sample.txt, sample_2.txt
Case Name Status Exec Time Memory
edge.txt WA 10 ms 3032 KB
edge_2.txt WA 4 ms 3060 KB
edge_3.txt WA 4 ms 3184 KB
edge_4.txt WA 3 ms 3060 KB
edge_5.txt WA 4 ms 3188 KB
edge_6.txt WA 4 ms 2992 KB
edge_7.txt WA 3 ms 3052 KB
edge_8.txt WA 3 ms 3056 KB
random.txt AC 3 ms 3192 KB
random_2.txt AC 3 ms 3020 KB
random_3.txt AC 3 ms 3000 KB
random_4.txt AC 4 ms 2996 KB
random_5.txt AC 3 ms 2988 KB
sample.txt AC 3 ms 3028 KB
sample_2.txt WA 3 ms 2992 KB