Uoj #350. 新年的XOR

 

    前缀异或和是可以讨论的,非常naive,然后这就是个水题了23333

 

 

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int T,lef;
ll L[4]={1,2,3,1},R[4]={3,3,5,2};
int main(){
//	freopen("T1.in","r",stdin);
//	freopen("T1.out","w",stdout);
	scanf("%d",&T);
	while(T--){
		ll n; scanf("%lld",&n),lef=n%4;
		if(n<4) printf("%lld %lld\n",L[n],R[n]);
		else if(!lef) printf("%lld %lld\n",1ll,n);
		else if(lef==1) printf("%lld %lld\n",2ll,n-1);
		else if(lef==2) printf("%lld %lld\n",2ll,n);
		else printf("%lld %lld\n",1ll,n-1);
	}
	return 0;
}

  

posted @ 2018-04-18 11:01  蒟蒻JHY  阅读(145)  评论(0编辑  收藏  举报