摘要:
" 题目链接 " Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortuna 阅读全文
摘要:
问题描述 有一个长为n的子序列A0,A1···An 1。求出这个序列中最长的上升子序列的长度。上升子序列指的是对于任意的i include using namespace std; int n; int a[1000]; int dp[1000]; void solve() { int ans=0; 阅读全文
摘要:
题目引入: 有n个重量和价值分别为Wi,Vi的物品。从这些物品中挑选出总重量不超过W的物品,求所有挑选方案中的价值总和的最大值。 分析: 首先,我们用最普通的方法,针对每个物品是否放入背包进行搜索。 include include using namespace std; int n,W; int 阅读全文
摘要:
" 题目链接 " Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ 阅读全文
摘要:
" 题目连接 " Description Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman dis 阅读全文