Submission #19725472


Source Code Expand

Copy
#include <map>
#include <queue>
#include <cstdio>
#include <utility>
#include <cstring>
#include <bits/stdc++.h>
using namespace std;

#define rep( i, a, b ) for( int (i) = (a) ; (i) <= (b) ; (i) ++ )
#define per( i, a, b ) for( int (i) = (a) ; (i) >= (b) ; (i) -- )

#define xx first
#define yy second

typedef long long LL;

typedef pair<int, int> Point;
const int INF = 0x3f3f3f3f;

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

template<typename _T>
void write( _T x )
{
	if( x < 0 ){ putchar( '-' ); x = ( ~ x ) + 1; }
	if( 9 < x ){ write( x / 10 ); }
	putchar( x % 10 + '0' );
}

LL Calc( LL X, LL Y )
{
	X = (X>0 ? X-X/3 : X+(2-X)/3) - 1;
	Y = (Y>0 ? Y-Y/3 : Y+(2-Y)/3) - 1;
  	if (X == 0 && Y == 0)
    	return 0;
  	if (X == 1 && Y == 1)
   	 	return 1;
  	return max({X, -X, Y, -Y}) + (X == Y);
}

int main()
{
//	freopen( "data", "w", stdout );
	int T;
	for( read( T ) ; T -- ; )
	{
		LL ax, ay, bx, by, cx, cy;
		read( ax ), read( ay ), read( bx ), read( by ), read( cx ), read( cy );
		write( Calc( ax + bx + cx, ay + by + cy ) ), putchar( '\n' );
	}
	return 0;
}

Submission Info

Submission Time
Task D - L
User crashed
Language C++ (GCC 9.2.1)
Score 600
Code Size 1338 Byte
Status AC
Exec Time 8 ms
Memory 3636 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 8 ms 3636 KB
edge_2.txt AC 3 ms 3400 KB
edge_3.txt AC 4 ms 3568 KB
edge_4.txt AC 4 ms 3568 KB
edge_5.txt AC 3 ms 3404 KB
edge_6.txt AC 2 ms 3440 KB
edge_7.txt AC 3 ms 3600 KB
edge_8.txt AC 3 ms 3564 KB
random.txt AC 3 ms 3604 KB
random_2.txt AC 3 ms 3568 KB
random_3.txt AC 2 ms 3548 KB
random_4.txt AC 3 ms 3396 KB
random_5.txt AC 3 ms 3564 KB
sample.txt AC 2 ms 3632 KB
sample_2.txt AC 2 ms 3616 KB