摘要:
Problem DescriptionFish likes to take photo with his friends. Several days ago, he found that some pictures of him were damaged. The trouble is that t... 阅读全文
摘要:
Description在n*n(1 #include#includeusing namespace std;int tot,n;int c[100];int vis[100];int path[100];bool flag; void dfs(int cur){ if(cur == n + 1... 阅读全文
摘要:
Problem DescriptionAfter losing all his chips when playing Texas Hold'em with Fsygd on the way to ZJOI2015, ZCC has just learned a black technology. N... 阅读全文
摘要:
Description多组测试数据 给你一棵树,n个点(n#include#include#includeusing namespace std;const int maxn = 10100;int mark[maxn],cot[maxn];vector G[10100];int dfs(int r... 阅读全文
摘要:
输入一个n,以及n个数据,输出最长的不下降的子序列大意:有两种思路:1.O(n^2)想法用一个num来记录以该数字为末数字的长度用一个if限制两个条件,后面小于前面并且后面的长度大于前面的长度+1那么说明需要更新了,最后只要遍历所有的数字在num中看以那个数字为开始点的长度最长。这个比较好理解#in... 阅读全文
摘要:
本文主要是由Wiskey大神的博客的结合少许个人的总结,传送门概念:状态压缩是以二进制来保存每一个的状态,比如总共的物品有n件,那么我一共的状态有2^n次,最大的状态用二进制表示为11....n个1...11,经常得到这样的状态转移方程dp[11001] = dp[10001] + dp[11000... 阅读全文
摘要:
DescriptionLet us define a regular brackets sequence in the following way:Empty sequence is a regular sequence.If S is a regular sequence, then (S) an... 阅读全文
摘要:
DescriptionThe railway line “Yekaterinburg-Sverdlovsk” with several stations has been built. This railway line can be represented as a line segment, r... 阅读全文
摘要:
DescriptionOnce upon a time an Eagle made a nest on the roof of a very large building. Time went by and some eggs appeared in the nest. There was a su... 阅读全文
摘要:
DescriptionMr. F. wants to get a document be signed by a minister. A minister signs a document only if it is approved by his ministry. The ministry is... 阅读全文