Submission #19725438
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' );
}
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( { X, - X, Y, - 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++ (GCC 9.2.1) |
Score |
0 |
Code Size |
1497 Byte |
Status |
WA |
Exec Time |
9 ms |
Memory |
3556 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 600 |
Status |
|
|
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 |
9 ms |
3532 KB |
edge_2.txt |
WA |
2 ms |
3528 KB |
edge_3.txt |
WA |
2 ms |
3416 KB |
edge_4.txt |
WA |
2 ms |
3532 KB |
edge_5.txt |
WA |
2 ms |
3524 KB |
edge_6.txt |
WA |
2 ms |
3484 KB |
edge_7.txt |
WA |
3 ms |
3464 KB |
edge_8.txt |
WA |
2 ms |
3484 KB |
random.txt |
WA |
2 ms |
3556 KB |
random_2.txt |
WA |
8 ms |
3412 KB |
random_3.txt |
WA |
2 ms |
3356 KB |
random_4.txt |
WA |
2 ms |
3524 KB |
random_5.txt |
WA |
3 ms |
3484 KB |
sample.txt |
AC |
2 ms |
3536 KB |
sample_2.txt |
AC |
2 ms |
3532 KB |