POJ 1200题意:给定串s,串中不同字符数nc,所求子串长度n,求长度为n的不同的子串的个数分析:处理长度很短的字符串哈希,数据保证可以无冲突存储下来,利用hash思想快速查询以前便利的结果,关键在于优化搜索。code: 1 #include 2 #include 3 #include 4...
分类:
其他好文 时间:
2014-07-18 14:19:38
阅读次数:
361
次小生成树。求出两点间最短路径的最大权值,再把要加入的边与之比较即可。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAXN=1010; 8 const int MAXM=...
分类:
其他好文 时间:
2014-07-18 13:38:30
阅读次数:
292
Parencodings
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 19409
Accepted: 11718
Description
Let S = s1 s2...s2n be a well-formed string of parentheses. S ...
分类:
其他好文 时间:
2014-07-18 13:27:19
阅读次数:
204
题意:给你一个棋盘,上面的字母代表机器人要走的方向。如果机器人能走出这个棋盘,则输出机器人所走的步数,否则输出该机器人在走向无限循环前所走的步数,及无限循环所要走的格子数
思路:直接模拟,没有思路(大神可以多考虑些思路)
AC代码:
#include
#include
char str[12][12];
int flag[12][12];
int r,c,s,sum,loop;
void ...
分类:
其他好文 时间:
2014-07-18 12:23:10
阅读次数:
223
Description
The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.
There are 16 handles on the refrigerator door. Every handle can b...
分类:
其他好文 时间:
2014-07-18 12:21:12
阅读次数:
253
Sorting It All Out
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 26866
Accepted: 9267
Description
An ascending sorted sequence of distinct values...
分类:
其他好文 时间:
2014-07-18 11:33:31
阅读次数:
294
写这个就是为了手写一份好用的求割点模板:
吐槽下,题目中的 Each of the next at most N lines contains the number of a place followed by the numbers of some places to which there is a direct line from this place. 这个at most是不可信的,应...
分类:
其他好文 时间:
2014-07-18 11:29:34
阅读次数:
232
Description
Some of you may have played a game called 'Blocks'. There are n blocks in a row, each box has a color. Here is an example: Gold, Silver, Silver, Silver, Silver, Bronze, Bronze, Bronze, Go...
分类:
其他好文 时间:
2014-07-18 11:23:05
阅读次数:
280
Fence Repair
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 25274
Accepted: 8131
Description
Farmer John wants to repair a small length of the fence aro...
分类:
其他好文 时间:
2014-07-18 11:11:11
阅读次数:
241
Description
Your task is to read a picture of a chessboard position and print it in the chess notation.
Input
The input consists of an ASCII-art picture of a chessboard with chess pieces on positio...
分类:
其他好文 时间:
2014-07-18 11:03:28
阅读次数:
305