标签:
4
3
14
7
6
0
0
1
0
1 #include<stdio.h> 2 #include<math.h> 3 int main() 4 { 5 int a,sum,n; 6 scanf("%d",&n); 7 while(n--) 8 { 9 scanf("%d",&a); 10 sum=0.5+sqrt(0.25+2*(a-1));//对于2*(a-1+0.25)进行开方,并取整 11 a=a-sum*(sum-1)/2; 12 if(a==1)printf("%d\n",1);//是1 13 else printf("%d\n",0);//否则是0 14 } 15 return 0; 16 }
标签:
原文地址:http://www.cnblogs.com/geek-007/p/4298743.html