UVA 11488 - Hyper Prefix Sets
题目链接
题意:给一些01串,定义一个P(s)表示:拥有相同长度前缀的字符串个数 * 该前缀长度,求最大的P(S)
思路:Trie,建好Trie树后dfs一遍记录答案最大值
代码:
#include
#include
#include
using namespace std;
const int SI...
分类:
其他好文 时间:
2014-08-02 18:25:04
阅读次数:
202
Hang Up the System
Time Limit: 2 Seconds Memory Limit: 32768 KB
You're going to design a multi-task operating system for an embedded system. Because the resources are limited on this mini c...
分类:
其他好文 时间:
2014-08-02 18:22:13
阅读次数:
328
Match for Bonus
Time Limit: 2 Seconds Memory Limit: 65536 KB
Roy played a game with his roommates the other day.
His roommates wrote 2 strings of characters, and gave each character a b...
分类:
其他好文 时间:
2014-08-02 18:20:33
阅读次数:
256
#include #include using namespace std;int main(int argc, char *argv[]){ int i,n,m; string s; while(cin>>m) { while(m--) { cin>>s; n=1; if(s.si...
分类:
其他好文 时间:
2014-08-01 22:59:32
阅读次数:
352
QuicksumTime Limit: 2 Seconds Memory Limit: 65536 KBA checksum is an algorithm that scans a packet of data and returns a single number. The idea is...
分类:
其他好文 时间:
2014-08-01 22:43:32
阅读次数:
333
Geometry Made SimpleTime Limit: 2 Seconds Memory Limit: 65536 KBMathematics can be so easy when you have a computer. Consider the following example. ....
分类:
其他好文 时间:
2014-08-01 19:27:32
阅读次数:
308
Reverse TextTime Limit: 2 Seconds Memory Limit: 65536 KBIn most languages, text is written from left to right. However, there are other languages whe....
分类:
其他好文 时间:
2014-08-01 19:23:32
阅读次数:
202
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1911分析:首先可以的到裸的方程f[i]=max{f[j]+a*(Si-Sj)^2+b*(Si-Sj)+c} 0f[y]+a*(Si-Sy)^2+c整理一下:(f[x]+a*Sx^2)-(f[y]...
大致思路:1.查看分区状态2.创建分区3.重新加载分区表4.格式化分区5.挂载分区到目录查看当前分区状态:[root@localhost~]#fdisk-cul
Disk/dev/sda:21.5GB,21474836480bytes
255heads,63sectors/track,2610cylinders,total41943040sectors
Units=sectorsof1*512=512bytes
Secto..
分类:
其他好文 时间:
2014-07-31 21:13:37
阅读次数:
311
Time Limit:2 Seconds Memory Limit:65536 KBThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp w...
分类:
其他好文 时间:
2014-07-31 12:52:06
阅读次数:
277