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

2013年9月16日

hdu 4745 Two Rabbits 环形最长回文子序列

摘要: Two Rabbits---------------------------------------------------------------------模型可以转化为求长度为n的序列的最长回文子序列方法为枚举起点+记忆化+环形dp用next(i)代替i++,prev(i)代替i--f[i][j]表示环(i,j)的最长回文子序列。若i=j则环区间为空,若i>j则区间为 i i+1 i+2 ... n-1 ... j-2 j-1 j若i#include #include #include #include using namespace std;const int maxn=1111 阅读全文

posted @ 2013-09-16 10:37 电子幼体 阅读(151) 评论(0) 推荐(0) 编辑

2013年9月13日

Codeforces Round #199 (Div. 2)

摘要: -----------------------------A. Xenia and Divisors---将n个数3个一组分成满足条件的n/3组。由于数字最多是7,所以只有124、126、136三种分组方式。先分出所有的136,再分出124,126。若所有数字都用光则分组成功。---#include using namespace std;int n;int a[10]={0};bool check(){ for (int i=1;i>n; for (int i=0;i>t; a[t]++; } if (n%3!=0){ cout0||a[7... 阅读全文

posted @ 2013-09-13 11:45 电子幼体 阅读(109) 评论(0) 推荐(0) 编辑

2013年9月12日

hdu 4722 Good Numbers 数位dp

摘要: Good NumbersTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 602Accepted Submission(s): 220Problem DescriptionIf we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.You are required to c 阅读全文

posted @ 2013-09-12 15:58 电子幼体 阅读(123) 评论(0) 推荐(0) 编辑

2013年9月9日

Codeforces Round #106 (Div. 2) //缺E

摘要: -------------------------A. Business trip---至少浇几个月水能使花的长度超过k。---#include #include using namespace std;int main(){ int k; int a[13]; int sum=0; int ans=-1; cin>>k; for (int i=0;i>a[i]; } sort(a,a+12,greater()); if (k==0){ cout=k){ ans=i+1; break... 阅读全文

posted @ 2013-09-09 20:27 电子幼体 阅读(127) 评论(0) 推荐(0) 编辑

Codeforces Round #103 (Div. 2) //缺E

摘要: ------------------A. Arrival of the General---可以交换相邻两个数字。求将最大值移到最左边,最小值移到最右边所用的最小步数。---#include using namespace std;int main(){ int n; int a[111]; cin>>n; int mx=0,mi=999; int p1,p2; for (int i=0;i>a[i]; if (a[i]>mx){ mx=a[i]; p1=i; } if (... 阅读全文

posted @ 2013-09-09 12:43 电子幼体 阅读(151) 评论(0) 推荐(0) 编辑

2013年9月8日

Codeforces Round #105 (Div. 2) //缺E

摘要: --------------A. Insomnia cure---求1~n中能被klmn整除的数的个数。---#include using namespace std;int main(){ int k,l,m,n,d; cin>>k>>l>>m>>n>>d; int sum=0; for (int i=1;iusing namespace std;const double eps=1e-8;int main() { int vp,vd,t,f,c; cin>>vp>>vd>>t>>f& 阅读全文

posted @ 2013-09-08 21:52 电子幼体 阅读(154) 评论(0) 推荐(0) 编辑

Codeforces Round #104 (Div. 2) //缺E

摘要: ----------------A. Lucky Ticket---判断给出的数字是不是两半和相等的幸运数字。---#include using namespace std;int main(){ int n; char s[111]; cin>>n>>s; bool ok=true; for (int i=0;i#include using namespace std;bool check(int a,int b){ int n=0; int i=1; while (a>0){ int t=a%10; a/=10; ... 阅读全文

posted @ 2013-09-08 21:38 电子幼体 阅读(133) 评论(0) 推荐(0) 编辑

2013年9月7日

POJ 2914 Minimum Cut 无向图最小割

摘要: Minimum CutTime Limit:10000MSMemory Limit:65536KTotal Submissions:6869Accepted:2848Case Time Limit:5000MSDescriptionGiven an undirected graph, in which two vertices can be connected by multiple edges, what is the size of the minimum cut of the graph? i.e. how many edges must be removed at least to d 阅读全文

posted @ 2013-09-07 15:56 电子幼体 阅读(187) 评论(0) 推荐(0) 编辑

poj 2987 Firing 最大权闭合图

摘要: FiringTime Limit:5000MSMemory Limit:131072KTotal Submissions:7126Accepted:2164DescriptionYou’ve finally got mad at “the world’s most stupid” employees of yours and decided to do some firings. You’re now simply too mad to give response to questions like “Don’t you think it is an even more stupid deci 阅读全文

posted @ 2013-09-07 09:58 电子幼体 阅读(125) 评论(0) 推荐(0) 编辑

2013年9月6日

Poj 3713 Transferring Sylla 3-连通

摘要: Transferring SyllaTime Limit:5000MSMemory Limit:65536KTotal Submissions:1320Accepted:322DescriptionAfter recapturing Sylla, the Company plans to establish a new secure system, a transferring net! The new system is designed as follows:The Company staff chooseNcities around the nation which are connec 阅读全文

posted @ 2013-09-06 15:08 电子幼体 阅读(177) 评论(0) 推荐(0) 编辑

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

导航