摘要: 题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1556 Description Jerry is caught by Tom. He was penned up in one room with a door, which only 阅读全文
posted @ 2017-04-21 19:55 Dh_q 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1554 Description The SG value of a set (multiset) is the minimum positive integer that could n 阅读全文
posted @ 2017-04-21 19:47 Dh_q 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1553 Description Give you a sequence of n numbers, and a number k you should find the max leng 阅读全文
posted @ 2017-04-21 19:30 Dh_q 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1552 Description On an alien planet, every extraterrestrial is born with a number. If the sum 阅读全文
posted @ 2017-04-21 19:16 Dh_q 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/problem/142542/origin Description You need to design road from (0, 0) to (x, y) in plane with the lowest cost. Unfortunatel 阅读全文
posted @ 2017-04-20 23:55 Dh_q 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1547 Description Now ,there are some rectangles. The area of these rectangles is 1* x or 2 * x 阅读全文
posted @ 2017-04-20 23:32 Dh_q 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1753 题意: 给你一个4*4的棋盘,上面有两种颜色的棋子(一种黑色,一种白色),你一次可以选择一个棋子翻转它(黑色变成白色,同理反之),选择的这枚棋子的上下左右都会被翻动(前提是上下左右都可以被翻动)。问最少可以翻动多少颗棋子,让整个 阅读全文
posted @ 2017-04-11 23:45 Dh_q 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题目:http://arc071.contest.atcoder.jp/tasks/arc071_b 题意: 有一个二维的平面,给你xn根竖线和ym根横线,问这些线围成的长方形(正方形)的面积和(要求mod)。 例子: 构成了9个长方体。 可以算出ans = 60; 题解: 很容易就可以想到暴击枚举 阅读全文
posted @ 2017-04-10 23:51 Dh_q 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 有关最长上升子序列的详细算法解释在http://www.cnblogs.com/denghaiquan/p/6679952.html 1)51nod 1134 一题裸的最长上升子序列,由于N<=50000,n2算法会超时,只能用nlogn算法。 1 #include <iostream> 2 #in 阅读全文
posted @ 2017-04-08 09:57 Dh_q 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 最长上升子序列 给你n个整数 A1 A2 ········· An 找出在这个数组里面的最长上升的子序列。例如给你(1,7,3,5,9,4,8),他的上升子序列有(1,7) (3,4,8)等等之类的,但是最长的上升子序列是(1,3,5,8)。 1)n^2算法 dp[i] 为当前数组里第i个元素时,以 阅读全文
posted @ 2017-04-08 00:12 Dh_q 阅读(417) 评论(0) 推荐(1) 编辑