![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二进制拆分
文章平均质量分 90
AI蜗牛之家
北航烟酒僧~ 百度、腾讯自然语言处理算法工程师~
展开
-
第四届 山东省ACM Alice and Bob
Alice and Bob Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description Alice and Bob like playing games very much.Today, they introduce a new game. There is a polyn原创 2017-04-13 16:11:33 · 781 阅读 · 0 评论 -
POJ 3252 Round Numbers (组合数学)
The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) in order to make原创 2017-04-27 22:04:19 · 900 阅读 · 0 评论 -
hdu1074Doing Homework( 状态压缩dp)
D - Doing Homework HDU - 1074 Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework.原创 2017-04-17 11:10:38 · 832 阅读 · 0 评论 -
SPOJ - BALNUM Balanced Numbers (*数位DP+三进制拆分)
Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: 1) Every even digit appears an odd number of times in its decimal represen原创 2017-04-30 19:50:19 · 1283 阅读 · 0 评论 -
POJ 1014 dividing(多重背包+二进制拆分)
#include using namespace std; int main () { int a[6],count=1; int vol[20010],f[20010*6]; while ( scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5])) { if( a[0]==0 && a[1]==0原创 2014-10-20 22:04:28 · 1319 阅读 · 0 评论 -
第三届 山东省ACM省赛 Mine Number(二进制查分+暴力)
http://www.sdutacm.org/sdutoj/problem.php?action=showproblem&problemid=2410 只要是第一行确定了,全部棋局也就确定了,dfs搜索第一行的情况,然后后面的直接根据上一行而定,这样最后就能得出整个矩阵了,第一行最多20个,也就是复杂度为2^20,不会超时,并且中间还会有剪枝。 但是苦逼的是当时模拟的时候感觉dfs没什原创 2016-05-04 15:03:40 · 904 阅读 · 0 评论 -
树状数组
好久都对这个东西有点陌生,看了一下午,终于能说出点缘由来了。。。 从网上找的点资料。。。 一、树状数组是干什么的? 平常我们会遇到一些对数组进行维护查询的操作,比较常见的如,修改某点的值、求某个区间的和,而这两种恰恰是树状数组的强项!当然,数据规模不大的时候,对于修改某点的值是非常容易的,复杂度是O(1),但是对于求一个区间的和就要扫一遍了,复杂度是O(N),如原创 2015-04-20 19:24:54 · 857 阅读 · 0 评论 -
Sum
开始的时候死活时没有看懂题目是 #include #include #include using namespace std; __int64 pow(__int64 b){ __int64 a=2; __int64 ans=1; while(b>0){ if(b&1) //判断是否为奇数,相当于 if(b%2==1)原创 2014-11-20 22:13:54 · 1047 阅读 · 0 评论