BZOJ 2927: [Poi1999]多边形之战(。。。)

版权声明:本文为博主原创文章,未经博主允许必须转载。 https://blog.csdn.net/qq_35950004/article/details/88639918

%dalao
没有什么好说的。
AC Code:

#include<cstdio>
#include<algorithm>
using namespace std;
int n,a,b,c;
int xl(int a,int b){ return abs(a-b)==1 || (a==0&&b==n-1) || (a==n-1&&b==0); }
int main(){
	scanf("%d%d%d%d",&n,&a,&b,&c);
	if(xl(a,b)+xl(b,c)+xl(c,a) >= 2) puts("TAK");
	else if(n&1) puts("NIE");
	else puts("TAK");
}

猜你喜欢

转载自blog.csdn.net/qq_35950004/article/details/88639918