用Dp的思想解决了这道题目,也就是所谓的暴力= =题意:给出一个集合,一个字符串,找出这个字符串的最长前缀,使得前缀可以划分为这个集合中的元素(集合中的元素可以不全部使用)。还不会Trie 树QAQSource Code:/*ID: wushuai2PROG: prefixLANG: C++*///...
分类:
其他好文 时间:
2015-02-21 14:14:36
阅读次数:
116
写这道题目的时候遇到了一个令人诧异的问题,就是平台上跑来的结果和我本机跑起来的结果不一样。后来Debug了之后才发现是我数组开小了,只开到100 的数组竟然都去访问他170位的地址肯定要跪成翔啊...好吧,解释一下题意。有N盏台灯,C次操作每次操作可以按一次按钮,一共一个四个按钮可以得出的规律是每6...
分类:
其他好文 时间:
2015-02-20 23:06:37
阅读次数:
189
通过USACO草地排水学习了一下网络流,终于写好了几个模板。最大流BFS求增广路径简述:通过BFS在网络中找出一条最短增广路径并修改流量(前向弧加可改进量X,后向弧则减去X),当不存在增广路径时得出最大流,时间效率O(nm^2)。{ID: qty1272PROG: ditchLANG: PASCAL...
分类:
编程语言 时间:
2015-02-19 19:45:19
阅读次数:
195
第一眼看到题目,感觉水水的,不就是最长下降子序列嘛!然后写……就呵呵了..要判重,还要高精度……判重我是在计算中加入各种判断。这道题比看上去麻烦一点,但其实还好吧..#include#include#include#include#define rep(i,l,r) for(int i=l;i0) ...
分类:
其他好文 时间:
2015-02-18 17:36:45
阅读次数:
211
二分图的最大匹配。我是用最大流求解。加个源点s和汇点t;s和每只cow、每个stall和t 连一条容量为1有向边,每只cow和stall(that the cow is willing to produce milk in )也连一条容量为1的边。然后就用ISAP。#include#include#...
分类:
其他好文 时间:
2015-02-18 15:13:26
阅读次数:
184
Magic Squares
IOI'96
Following the success of the magic cube, Mr. Rubik invented its planarversion, called magic squares. This is a sheet composed of 8 equal-sizedsquares:
1
2
3
4
8...
分类:
其他好文 时间:
2015-02-18 06:14:43
阅读次数:
418
最大流问题。ISAP算法。注意可能会有重边,不过我用的数据结构支持重边。距离d我直接初始化为0,也可以用BFS逆向找一次。#include#include#include#include#include#include#define rep(i,l,r) for(int i=l;ir;i--)#de...
分类:
其他好文 时间:
2015-02-17 22:13:08
阅读次数:
157
Feed Ratios1998 ACM Finals, Dan Adkins Farmer John feeds his cows only the finest mixture of cow food,which has three components: Barley, Oats, and Wheat. While he knowsthe precise mixture of these...
分类:
移动开发 时间:
2015-02-17 21:06:33
阅读次数:
237
根据题意的 Runaround 规则去找比当前数大的最近的一个 Runaround数字模拟题~Source code:/*ID: wushuai2PROG: runroundLANG: C++*///#pragma comment(linker, "/STACK:16777216") //for c...
分类:
其他好文 时间:
2015-02-17 21:02:04
阅读次数:
148
进到bin目录运行 emctl start dbconsoleoracle@suse92:~> sqlplus /nologSQL*Plus: Release 9.2.0.4.0 - Production on Fri Jan 20 02:29:37 2006Copyright (c) 1982, ...
分类:
数据库 时间:
2015-02-17 16:30:00
阅读次数:
172