uva 11556 - Best Compression Ever(水题)

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

你可能感兴趣的:(uva 11556 - Best Compression Ever(水题))