- 博客(26)
- 资源 (4)
- 收藏
- 关注
原创 【专题】KMP
挖坑... ---------------------------- 一 模板 ---------------------------- const int maxn=1111111; char P[maxn]; char T[maxn]; int f[maxn]; void getFail(char P[],int f[]){ int i=0,j=-1; int
2013-09-29 15:27:17 1324 4
原创 UVA 10816 Travel in Desert 最短路+二分
-------------------- Description There is a group of adventurers who like to travel in the desert. Everyone knows travelling in desert can be very dangerous. That's why they plan the
2013-09-28 20:51:01 1544
原创 UVA 10600 ACM Contest and Blackout 次小生成树/裸
---------- Problem A ACM CONTEST AND BLACKOUT In order to prepare the “The First National ACM School Contest”(in 20??) the major of the city decided to provide all the schools with a rel
2013-09-26 13:12:43 1475
原创 Poj 3552 Slim Span 最小生成树
----------------- Slim Span Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5725 Accepted: 3008 Description Given an undirected weighted gra
2013-09-25 21:13:05 1319
原创 UVA 11354 - Bond 最小树/LCA/瓶颈路
----------------------- Once again, James Bond is on his way to saving the world. Bond's latest mission requires him to travel between several pairs of cities in a certain country. The countr
2013-09-25 18:39:04 1189
原创 HDU 4081 Qin Shi Huang's National Road System 最小/次小生成树的性质
------------------------------ Qin Shi Huang's National Road System Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2168 Accepted Sub
2013-09-25 14:29:24 1151
原创 UVA 10269 Adventure of Super Mario floyd dp
Problem A Adventure of Super Mario Input: Standard Input Output: Standard Output After rescuing the beautiful princess, Super Mario needs to find a way home -- with the princess of course
2013-09-23 20:26:51 1164
原创 UVA 11280 Flying to Fredericton 最短路DP
Problem C FLYING TO FREDERICTON After being inspired by Salvador Dali's artwork, Brett decided he would like to travel to Fredericton, New Brunswick to visit the Beaverbrook Art Gallery. Br
2013-09-23 20:19:42 1059
原创 【专题】树状数组
------------------------------ 挖坑。。。 ------------------------------ ------------------------------ ------------------------------ ------------------------------ -------------------------
2013-09-17 21:47:08 681
原创 【专题】Subsequence
回文子序列 ---------------------------- 环形回文子序列 HDU 4745 Two Rabbits ---------------------------- 重点是用next() prev() 代替l+1,r-1 ---------------------------- const int maxn=1111; int a[maxn];
2013-09-17 21:42:54 839
原创 hdu 4745 Two Rabbits 环形最长回文子序列
Two Rabbits --------------------------------------------------------------------- 模型可以转化为求长度为n的序列的最长回文子序列 方法为枚举起点+记忆化+环形dp 用next(i)代替i++,prev(i)代替i-- f[i][j]表示环(i,j)的最长回文子序列。 若i=j则环区间为空, 若i>j
2013-09-16 10:37:55 767
原创 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; i
2013-09-13 11:45:50 768
原创 hdu 4722 Good Numbers 数位dp
Good Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 602 Accepted Submission(s): 220 Problem Description If we sum up ev
2013-09-12 15:58:36 858
原创 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;
2013-09-09 20:27:25 782
原创 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,m
2013-09-09 12:43:16 809
原创 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;i<=d;i++){
2013-09-08 21:52:17 773
原创 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<n;i+
2013-09-08 21:38:04 706
原创 POJ 2914 Minimum Cut 无向图最小割
Minimum Cut Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 6869 Accepted: 2848 Case Time Limit: 5000MS Description Given an undirected graph, in w
2013-09-07 15:56:10 813
原创 poj 2987 Firing 最大权闭合图
Firing Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 7126 Accepted: 2164 Description You’ve finally got mad at “the world’s most stupid” employees o
2013-09-07 09:58:47 841
原创 Poj 3713 Transferring Sylla 3-连通
Transferring Sylla Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 1320 Accepted: 322 Description After recapturing Sylla, the Company plans to establish
2013-09-06 15:08:55 1206
原创 SPOJ 7758 Growing Strings AC自动机DP
7758. Growing Strings Problem code: MGLAR10 English Vietnamese Gene and Gina have a particular kind of farm. Instead of growing a
2013-09-05 16:43:58 1085
原创 Codeforces Round #102 (Div. 2) //缺E
----------------------- A. Help Vasilisa the Wise 2 --- 暴力枚举 --- #include using namespace std; int r1,r2,c1,c2,d1,d2; int a[2][2]; bool solve() { if (a[0][0]+a[0][1]!=r1) return false;
2013-09-04 19:50:37 766
原创 Codeforces Round #101 (Div. 2)
-------------- A. Amusing Joke -- 前两行的字母恰好组成最后一行 -- #include #include using namespace std; char a[1111]; int ch[26]={0}; int main() { cin>>a; for (int i=0;a[i];i++){ ch[a[i]
2013-09-04 16:13:47 736
原创 poj 1769 Minimizing maximizer 线段树优化的dp
Minimizing maximizer Time Limit: 5000MS Memory Limit: 30000K Total Submissions: 3047 Accepted: 1187 Description The company Chris Ltd. is preparing a new sorting ha
2013-09-03 21:27:41 1383
原创 3734 Blocks DP矩阵优化入门
Blocks Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3665 Accepted: 1611 Description Panda has received an assignment of painting a line of blocks. Sin
2013-09-03 20:37:32 749
原创 Code Library 打印面
--- /*==============================================*\ | Code Library \*==============================================*/ /** head-file **/ #include #include #include #include #include #include
2013-09-02 19:30:22 657
CSDN博客导出器2014/8/22
2014-08-22
(键)脑操语言解释器 brainfuck
2014-07-04
【Java】推箱子小游戏
2014-01-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人