Submission #19724547


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(X*2+sx==Y*2+sy&&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 498 Byte
Status WA
Exec Time 9 ms
Memory 3224 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 600
Status
AC × 2
AC × 7
WA × 8
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 8 ms 3012 KB
edge_2.txt WA 3 ms 3200 KB
edge_3.txt WA 3 ms 3044 KB
edge_4.txt WA 3 ms 3044 KB
edge_5.txt WA 3 ms 2992 KB
edge_6.txt WA 4 ms 3204 KB
edge_7.txt WA 9 ms 3168 KB
edge_8.txt WA 2 ms 3164 KB
random.txt AC 2 ms 3068 KB
random_2.txt AC 5 ms 2996 KB
random_3.txt AC 3 ms 3060 KB
random_4.txt AC 3 ms 3068 KB
random_5.txt AC 3 ms 3040 KB
sample.txt AC 2 ms 3224 KB
sample_2.txt AC 2 ms 2992 KB