uva 11556 - Best Compression Ever(水题)

来源:互联网 发布:arduino软件下载 编辑:程序博客网 时间:2024/05/17 06:16

题目链接: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;}
0 0