上一页 1 2 3 4 5 6 7 ··· 28 下一页

2015年3月10日

hdu 1536(博弈)

摘要: 传送门:S-Nim题意:给n个数的集合s, 再给m 组数据,每组表示 k 堆石子,每次可以取的个数只能是集合s中的数量。问先手胜还是输?分析:sg函数的经典运用,先预处理出所有数量为0~10000的石子的sg值,然后判断k堆石子的sg值异或和是否为0来判断先手的输赢。#include #includ... 阅读全文

posted @ 2015-03-10 18:46 lienus 阅读(300) 评论(0) 推荐(0)

SCU 3133(博弈)

摘要: 传送门:windy和水星 -- 水星游戏 2题意:在一张由 n*m 的格子组成的棋盘上放着 k 个骑士每个骑士的位置为(xi,yi),表示第xi行,第yi列骑士如果当前位置为(x,y),一步可以走的位置为(x-2,y-1)(x-2,y+1)(x-1,y-2)(x+1,y-2)两人对弈,每次移动至少一... 阅读全文

posted @ 2015-03-10 16:48 lienus 阅读(172) 评论(0) 推荐(0)

SCU 3132(博弈)

摘要: 传送门:windy和水星 -- 水星游戏 1题意:在一张由 n*m 的格子组成的棋盘上放着 k 个骑士每个骑士的位置为(xi,yi),表示第xi行,第yi列骑士如果当前位置为(x,y),一步可以走的位置为(x-2,y-1)(x-2,y+1)(x-1,y-2)(x+1,y-2)两人对弈,每次移动一个骑... 阅读全文

posted @ 2015-03-10 16:34 lienus 阅读(170) 评论(0) 推荐(0)

2015年3月7日

hdu 5183(hash)

摘要: 传送门:Negative and Positive (NP)题意:给定一个数组(a0,a1,a2,⋯an−1)和一个整数K, 请来判断一下是否存在二元组(i,j)(0≤i≤j#include #include #include #include #include #include #include ... 阅读全文

posted @ 2015-03-07 23:31 lienus 阅读(675) 评论(0) 推荐(0)

2015年3月2日

hdu3329(2次dfs)

摘要: 传送门:The Flood题意:当水的高度升为多少的时候,能够将这块区域分为两个部分.分析:枚举高度,先从外围开始一次dfs,将水能淹没的标记,然后看非标记的是否已分为多块。#include#include#include#include#define inf 0x7fffffff#define L... 阅读全文

posted @ 2015-03-02 22:11 lienus 阅读(119) 评论(0) 推荐(0)

2015年3月1日

hdu5179(数位dp)

摘要: 传送门:beautiful number题意:令 A=∑ni=1ai?10n?i(1≤ai≤9)(n为A的位数)。若A为“漂亮的数”当且仅当对于任意1≤i#include #include #include #include #include #include #include #include #... 阅读全文

posted @ 2015-03-01 22:45 lienus 阅读(166) 评论(0) 推荐(0)

zoj2314(有上下界的网络流)

摘要: 传送门:Reactor Cooling题意:给n个点,及m根pipe,每根pipe用来流躺液体的,单向的,每时每刻每根pipe流进来的物质要等于流出去的物质,要使得m条pipe组成一个循环体,里面流躺物质。并且满足每根pipe一定的流量限制,范围为[Li,Ri].即要满足每时刻流进来的不能超过Ri(... 阅读全文

posted @ 2015-03-01 19:27 lienus 阅读(159) 评论(0) 推荐(0)

CF 519E(树上倍增求lca)

摘要: 传送门:A and B and Lecture Rooms题意:给定一棵树,每次询问到达点u,v距离相等的点有多少个。分析:按情况考虑:1.abs(deep[u]-deep[v])%2==1时,必定不存在到达u,v距离相等的点。2.如果deep[u]==deep[v]时,ans=n-num[lca(... 阅读全文

posted @ 2015-03-01 00:49 lienus 阅读(538) 评论(0) 推荐(0)

2015年2月27日

hdu1251(Trie树)

摘要: 传送门:统计难题分析:Trie树入门题,随便写写练下手感,统计每个节点被多少单词经过就可以了。#include #include #include #include #include #include #include #include #define LL long long#define N 5... 阅读全文

posted @ 2015-02-27 23:00 lienus 阅读(146) 评论(0) 推荐(0)

SCU 2009(数位dp)

摘要: 传送门:Zeros and Ones题意:求总数位为n包含0和1个数相同且整除k的二进制数的个数。分析:设dp[pos][num][md]表示还有pos位已包含num个1且模k余md的符合条件的二进制数的个数,裸数位dp题。#include #include #include #include #i... 阅读全文

posted @ 2015-02-27 19:53 lienus 阅读(136) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 28 下一页

导航