首页 > 代码库 > hdu 2178

hdu 2178

猜数字

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3487    Accepted Submission(s): 2512


Problem Description
A有1数m,B来猜.B每猜一次,A就说"太大","太小"或"对了" 。 
问B猜n次可以猜到的最大数。 
 

 

Input
第1行是整数T,表示有T组数据,下面有T行 
每行一个整数n (1 ≤ n ≤ 30) 
 

 

Output
猜n次可以猜到的最大数
 

 

Sample Input
213
 

 

Sample Output
17
 

 

Author
Zhousc
 

 

Source
ECJTU 2008 Summer Contest
 
#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<cmath>#include<algorithm>#include<cstdlib>#include<queue>#include<set>#include<vector>using namespace std;int t,n;int main(){      scanf("%d",&t);      while(t--)      {            scanf("%d",&n);            printf("%d\n",(1<<n)-1);      }      return 0;}

  

hdu 2178