Submission #19725121


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 mx = min(ax , min(bx , cx)) , my = min(ay , min(by , cy));
		int sx = ax + bx + cx - mx * 3 , sy = ay + by + cy - my * 3;
		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 0
Code Size 729 Byte
Status CE

Compile Error

./Main.cpp:22:22: error: use of undeclared identifier 'X'
                int ans = (max(abs(X * 2 + sx) , abs(Y * 2 + sy)));
                                   ^
./Main.cpp:22:40: error: use of undeclared identifier 'Y'
                int ans = (max(abs(X * 2 + sx) , abs(Y * 2 + sy)));
                                                     ^
./Main.cpp:23:6: error: use of undeclared identifier 'X'
                if(X * 2 + sx == Y * 2 + sy && X * 2 + sx != 1 && Y * 2 + sy != 0) ans ++;
                   ^
./Main.cpp:23:20: error: use of undeclared identifier 'Y'
                if(X * 2 + sx == Y * 2 + sy && X * 2 + sx != 1 && Y * 2 + sy != 0) ans ++;
                                 ^
./Main.cpp:23:34: error: use of undeclared identifier 'X'
                if(X * 2 + sx == Y * 2 + sy && X * 2 + sx != 1 && Y * 2 + sy != 0) ans ++;
                                               ^
./Main.cpp:23:53: error: use of undeclared identifier 'Y'
                if(X * 2 + sx == Y * 2 + sy && X * 2 + sx != 1 && Y * 2 + sy != 0) ans ++;
                                                                  ^
6 errors generated.