这道题我因为范围的问题错了好多次,n最大为31,1<<n在int范围内,但是1<<2*n的范围超出了int
void calc(long long n,long long a){
long long z = a / (1ll<<2(n-1));
if(a==0) ax = 0,ay = 0;
else calc(n-1,a % (1ll<<2(n-1)));
long long len = 1ll<<(n-1);
if(z==0) swap(ax,ay);
if(z==1) ax+=len;
if(z==2) ax+=len,ay+=len;
if(z==3) {
long long temp = ax;
ax = len - 1 - ay;
ay = 2*len - 1 - temp;
}
}