BZOJ 3609: [Heoi2014]人人尽说江南好

神分析......

https://blog.csdn.net/u010600261/article/details/53186407

#include<cstdio>
using namespace std;
int main(){
	int T;
	scanf("%d",&T);
	while (T--){
		int n,m;
		scanf("%d%d",&n,&m);
		int ans=n/m*(m-1);
		if (n%m) ans+=n%m-1;
		printf("%d\n",(ans&1)^1);
	}
	return 0;
}

  

 

posted @ 2018-11-04 09:10  ~Silent  阅读(200)  评论(0编辑  收藏  举报
Live2D