您的位置:首页 > 其它

uva 11556 - Best Compression Ever(水题)

2014-09-26 21:22 225 查看
题目链接:uva 11556 - Best Compression Ever

题目大意:有n个文件,问说用b+1位是否可以表示,全0不能表示。

解题思路:水题,不过话说英语实在看不懂啊,题意是半猜的。
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;
typedef long long ll;

int main () {
ll n, b;
while (scanf("%lld%lld", &n, &b) == 2) {

ll m = (1LL<<(b+1)) - 1;
printf("%s\n", n <= m ? "yes" : "no");
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: