Submission #19725410
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++ (Clang 10.0.0) |
Score | 0 |
Code Size | 1530 Byte |
Status | CE |
Compile Error
./Main.cpp:6:10: fatal error: 'bits/stdc++.h' file not found #include <bits/stdc++.h> ^~~~~~~~~~~~~~~ 1 error generated.