Submission #19724651


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=2e9,Y=2e9,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+=ax+bx+cx-X*3;
		sy+=ay+by+cy-Y*3;
		ans=max(Abs(X*2+sx),Abs(Y*2+sy));
		if(X*2+sx==Y*2+sy&&X*2+sx!=0&&X*2+sx!=1) ans++;
		printf("%d\n",ans);
	}
	return 0;
}

Submission Info

Submission Time
Task D - L
User SenseAnone
Language C++ (Clang 10.0.0)
Score 600
Code Size 483 Byte
Status AC
Exec Time 12 ms
Memory 3188 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 2
AC × 15
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 AC 12 ms 3020 KB
edge_2.txt AC 3 ms 3016 KB
edge_3.txt AC 3 ms 3020 KB
edge_4.txt AC 4 ms 3188 KB
edge_5.txt AC 3 ms 3188 KB
edge_6.txt AC 3 ms 3044 KB
edge_7.txt AC 4 ms 3188 KB
edge_8.txt AC 4 ms 3188 KB
random.txt AC 4 ms 2968 KB
random_2.txt AC 5 ms 3052 KB
random_3.txt AC 5 ms 2972 KB
random_4.txt AC 6 ms 3060 KB
random_5.txt AC 3 ms 2972 KB
sample.txt AC 2 ms 3012 KB
sample_2.txt AC 2 ms 2980 KB