现在的位置: 首页 > 综合 > 正文

uva 11556 – Best Compression Ever(水题)

2019年08月20日 ⁄ 综合 ⁄ 共 291字 ⁄ 字号 评论关闭

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

抱歉!评论已关闭.