上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页

2017年5月21日

hdu5794 A Simple Chess 容斥+Lucas 从(1,1)开始出发,每一步从(x1,y1)到达(x2,y2)满足(x2−x1)^2+(y2−y1)^2=5, x2>x1,y2>y1; 其实就是走日字。而且是往(n,m)方向走的日字。还有r个障碍物,障碍物不可以到达。求(1,1)到(n,m)的路径条数。

摘要: A Simple Chess Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2597 Accepted Submission(s): 691 P 阅读全文

posted @ 2017-05-21 12:35 hnust_accqx 阅读(1310) 评论(0) 推荐(0) 编辑

hdu5795 A Simple Nim 求nim求法,打表找sg值规律 给定n堆石子,每堆有若干石子,两个人轮流操作,每次操作可以选择任意一堆取走任意个石子(不可以为空) 或者选择一堆,把它分成三堆,每堆不为空。求先手必胜,还是后手必胜。

摘要: /** 题目:A Simple Nim 链接:http://acm.hdu.edu.cn/showproblem.php?pid=5795 题意:给定n堆石子,每堆有若干石子,两个人轮流操作,每次操作可以选择任意一堆取走任意个石子(不可以为空) 或者选择一堆,把它分成三堆,每堆不为空。求先手必胜,还是后手必胜。 思路: 组合游戏Nim; 计算出每一堆的sg值,然后取异或。异或和>0那么先手... 阅读全文

posted @ 2017-05-21 10:13 hnust_accqx 阅读(2323) 评论(0) 推荐(0) 编辑

2017年5月20日

Tree UVA - 548 已知中序遍历和后序遍历,求这颗二叉树。

摘要: You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary 阅读全文

posted @ 2017-05-20 18:22 hnust_accqx 阅读(316) 评论(0) 推荐(0) 编辑

2017年5月17日

Trees on the level UVA - 122 复习二叉树建立过程,bfs,queue,strchr,sscanf的使用。

摘要: Trees are fundamental in many branches of computer science (Pun definitely intended). Current state- of-the art parallel computers such as Thinking Machines’ CM-5 are based on fat trees . Quad- and o... 阅读全文

posted @ 2017-05-17 13:50 hnust_accqx 阅读(225) 评论(0) 推荐(0) 编辑

UVA 679 Dropping Balls 由小见大,分析思考 二叉树放小球,开关翻转,小球最终落下叶子编号。

摘要: A number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, either fol... 阅读全文

posted @ 2017-05-17 13:01 hnust_accqx 阅读(406) 评论(0) 推荐(0) 编辑

2017-5-14 湘潭市赛 Similar Subsequence 分析+四维dp+一些简单优化

摘要: Similar Subsequence Accepted : 10 Submit : 53 Time Limit : 10000 MS Memory Limit : 135536 KB Similar Subsequence For given sequence A=(a1,a2,…,an), a sequence S=(s1,s2,…,sn) has... 阅读全文

posted @ 2017-05-17 09:43 hnust_accqx 阅读(236) 评论(0) 推荐(0) 编辑

2017年5月16日

Problem #3263 丽娃河的狼人传说 区间满足灯数,r排序后贪心。

摘要: 丽娃河的狼人传说 Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 megabytes 丽娃河是华师大著名的风景线。但由于学校财政紧缺,丽娃河边的路灯年久失修,一到晚上就会出现走在河边要打着手电的情况,不仅非常不方便,而且影响安全:已经发生了大大小小的事故多起。 方便... 阅读全文

posted @ 2017-05-16 20:35 hnust_accqx 阅读(338) 评论(0) 推荐(0) 编辑

2017-5-14 湘潭市赛 Longest Common Subsequence 想法题

摘要: Longest Common Subsequence Accepted : 7 Submit : 66 Time Limit : 3000 MS Memory Limit : 65536 KB Longest Common Subsequence Bobo has a sequence A=(a1,a2,…,an) of length n. He wo... 阅读全文

posted @ 2017-05-16 20:01 hnust_accqx 阅读(269) 评论(0) 推荐(0) 编辑

2017-5-14 湘潭市赛 Parentheses 转化思想+贪心 使括号序列合法的最小花费。满足前面左括号的数量>=有括号的数量。

摘要: Parentheses Accepted : 8 Submit : 19 Time Limit : 3000 MS Memory Limit : 65536 KB Parentheses Bobo has a very long sequence divided into n consecutive groups. The i-th group con... 阅读全文

posted @ 2017-05-16 13:27 hnust_accqx 阅读(577) 评论(0) 推荐(0) 编辑

2017年5月15日

deque双端队列用法

摘要: #include #include #include #include using namespace std; deque dq; int main() { dq.push_front(102);///插入头部 dq.push_back(101);///插入尾部 sort(dq.begin(),dq.end()); deque::iterator it ... 阅读全文

posted @ 2017-05-15 15:58 hnust_accqx 阅读(280) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页

导航