摘要:样例 123123 6 1211 3 1 232 4 5 数据量不大 1 //暴力 2 #include<bits/stdc++.h> 3 using namespace std; 4 string s,s1,s2; 5 int l1; 6 int main() 7 { 8 //数据量不大,可以2重
阅读全文
摘要:1 //n件物品,m种关系,(有关系的2个不能在同一组) 2 //把所有物品分为2组,希望最后2组的差值尽可能小,输出较大者 3 /* 4 二分图涂色+可行性(01)背包 5 dp[i] =1表示 最后差值为i可行 6 建图后,对于每个连通分量记录差值,来求所有的可行 7 */ 8 #include<bits/stdc++.h> 9 using namespace std; 10 int t,n,
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; #define N 5010 #define ll long long #define inf 0x3f3f3f3f char s[N],p[N]; int ls,lp; int c0,c1,c2; int dp[N][N]; //把s变为p的最小代价 //c0 增加一个的代价 //c1 删除一个的代价 /
阅读全文
摘要:C: 回文 时间限制: 1 s 内存限制: 128 MB 题目描述 给定一个字符串,你可以对字符串做任意改动,你可以在任意地方增加一个字符、删除一个字符或者改变一个字符。但是不同的操作所花费的代价也是不同的,增加和删除所付出的代价为1,直接改变一个字符所花费的代价为2,问最少花费多少能得到一个回文串
阅读全文
摘要://poj 1458 Common Subsequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 69884 Accepted: 29304 Description A subsequence of a given se
阅读全文
摘要:一:Uva12230Crossing Rivers (数学期望)题目大意:有个人每天要去公司上班,每次会经过N条河,家和公司的距离为D,默认在陆地的速度为1,给出N条河的信息,包括起始坐标p,宽度L,以及船的速度v。船会往返在河的两岸,人到达河岸时,船的位置是随机的(往返中)。问说人达到公司所需要的
阅读全文
摘要://hdu 2089 不要62 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 60338 Accepted Submission(s): 238
阅读全文
摘要://Poj 3254 Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 20258 Accepted: 10633 Description Farmer John has purchased a lush n
阅读全文
摘要:Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. T
阅读全文
摘要:// ACM训练联盟周赛 C. Teemo's tree problem There is an apple tree in Teemo's yard. It contains n nodes and n-1 branches, and the node 1 is always the root o
阅读全文
摘要:Almost Sorted Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 7686 Accepted Submission(s)
阅读全文
摘要:Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1196 Accepted: 783 Description The classic Two Glass Balls brain-teaser is often pose
阅读全文
摘要:题目描述 现在给你N个正整数ai,每个数给出一“好数程度” gi(数值相同但位置不同的数之间可能有不同的好数程度)。对于在 i 位置的数,如果有一在j位置的数满足 j < i 且 ai=aj,则你可以将位于[i,j]闭区间内的序列评为“好序列”,然后获得∑gk(j≤k≤i)(此闭区间内“好数程度”之
阅读全文
摘要:It’s universally acknowledged that there’re innumerable trees in the campus of HUST.Now HUST got a big land whose capacity is C to plant trees. We hav
阅读全文
摘要:https://cn.vjudge.net/contest/224070#problem/B
阅读全文
摘要:托米没有完成上一个任务,准备施展黑魔法推倒 1317 黑魔法咒语被描述为一个 长为 n 的,仅包含小写英文字母 'a'...'i' 的字符串,在托米所在的星球,魔法造成的每次有效伤害都是来自他的一个子序列,对于每一个 'a'... 'i' 的排列(共 9! 种),若作为咒语的子序列出现, 就会造成
阅读全文
摘要:65536K 动态归化+滚动数组 JSZKC is the captain of the lala team. There are NN girls in the lala team. And their height is [1,N][1,N] and distinct. So it means
阅读全文
摘要:/ Joy OI / 题目列表 / 最大子序和 / Joy OI / 题目列表 / 最大子序和 / Joy OI / 题目列表 / 最大子序和 / Joy OI / 题目列表 / 最大子序和 / Joy OI / 题目列表 / 最大子序和 题目限制 时间限制 内存限制 评测方式 题目来源 1000m
阅读全文
摘要:1 //hdu 1087 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 #define max(a,b) a>b?a:b 12 typedef long long ll; 13 c...
阅读全文