zoj 2872 Binary Partitions

zoj 2872 Binary Partitions,第1张

zoj 2872 Binary Partitions
#include<cstdio>#include<cmath>#include<vector>#include<cstring>#include<algorithm>using namespace std;typedef long long LL;const int maxn = 2000005;int n, f[maxn], x;int main(){    f[0] = 1;    for (int j = 0; (1 << j) < maxn; j++)        for (int i = (1 << j); i < maxn; i++) (f[i] += f[i - (1 << j)]) %= 1000000;    while (scanf("%d", &n) != EOF)    {        while (n--)        { scanf("%d", &x); printf("%dn", f[x]);        }    }    return 0;}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4911336.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-12
下一篇 2022-11-12

发表评论

登录后才能评论

评论列表(0条)

保存