Submission #19725335


Source Code Expand

Copy
#include <map>
#include <queue>
#include <cstdio>
#include <utility>
#include <cstring>
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' );
}

template<typename _T>
_T ABS( const _T a )
{
	return a < 0 ? -a : a;
}

template<typename _T>
_T MAX( const _T a, const _T b )
{
	return a > b ? a : b;
}

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( ABS( X ), ABS( Y ) ) + ( X == Y );
}

int main()
{
//	freopen( "data", "w", stdout );
	int T;
	for( read( T ) ; T -- ; )
	{
		int 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++ (Clang 10.0.0)
Score 0
Code Size 1504 Byte
Status WA
Exec Time 15 ms
Memory 3012 KB

Compile Error

./Main.cpp:17:11: warning: unused variable 'INF' [-Wunused-const-variable]
const int INF = 0x3f3f3f3f;
          ^
1 warning generated.

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 600
Status
AC × 2
AC × 2
WA × 13
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 15 ms 2736 KB
edge_2.txt WA 2 ms 2928 KB
edge_3.txt WA 6 ms 2840 KB
edge_4.txt WA 3 ms 2876 KB
edge_5.txt WA 2 ms 2936 KB
edge_6.txt WA 2 ms 2928 KB
edge_7.txt WA 2 ms 3012 KB
edge_8.txt WA 2 ms 2880 KB
random.txt WA 4 ms 2836 KB
random_2.txt WA 2 ms 2864 KB
random_3.txt WA 2 ms 2936 KB
random_4.txt WA 3 ms 2840 KB
random_5.txt WA 4 ms 2944 KB
sample.txt AC 2 ms 2736 KB
sample_2.txt AC 2 ms 2792 KB