Submission #19725159


Source Code Expand

Copy
#include <cstdio>
#include <algorithm>
using namespace std;

template <typename T>
void read(T &x) {
	T f=1;x=0;char s=getchar();
	while(s<'0'||s>'9') {if(s=='-') f=-1;s=getchar();}
	while(s>='0'&&s<='9') {x=(x<<3)+(x<<1)+(s^'0');s=getchar();}
	x *= f;
}

int T;

int main() {
	scanf("%d" , &T);
	while(T -- > 0) {
		int ax , ay , bx , by , cx , cy;
		read(ax),read(ay),read(bx),read(by),read(cx),read(cy);
		int X = min(ax , min(bx , cx)) , Y = min(ay , min(by , cy));
		int sx = ax + bx + cx - X * 3 - 1 , sy = ay + by + cy - Y * 3 - 1;
		int ans = (max(abs(X * 2 + sx) , abs(Y * 2 + sy)));
		if(X * 2 + sx == Y * 2 + sy && X * 2 + sx != 1 && Y * 2 + sy != 0) ans ++;
		printf("%d\n" , ans);
	}
	return 0;
}

Submission Info

Submission Time
Task D - L
User Reanap
Language C++ (Clang 10.0.0)
Score 600
Code Size 735 Byte
Status AC
Exec Time 11 ms
Memory 3208 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 11 ms 3208 KB
edge_2.txt AC 2 ms 3204 KB
edge_3.txt AC 2 ms 3068 KB
edge_4.txt AC 2 ms 3036 KB
edge_5.txt AC 2 ms 3200 KB
edge_6.txt AC 2 ms 3056 KB
edge_7.txt AC 3 ms 3064 KB
edge_8.txt AC 3 ms 3036 KB
random.txt AC 2 ms 3068 KB
random_2.txt AC 2 ms 3008 KB
random_3.txt AC 2 ms 2996 KB
random_4.txt AC 2 ms 3008 KB
random_5.txt AC 2 ms 3008 KB
sample.txt AC 2 ms 3000 KB
sample_2.txt AC 3 ms 3004 KB