http://acm.hdu.edu.cn/showproblem.php?pid=2066
/*主要思路就是把小草家看做源点0,然后和小草家相近的城市到源点距离为0,这样就妥妥的变成了单源的dijkstra,就基本上是模板了。。。。。。。*/
#include
#define N 1005
#define INF 0xfffffff
int map[N][N],dis[N],vis[...
分类:
其他好文 时间:
2014-06-05 11:45:12
阅读次数:
256
【题目】
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BANC".
Note:
If there is no such window in S that covers ...
分类:
其他好文 时间:
2014-06-05 11:14:26
阅读次数:
255
最短路
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 28836 Accepted Submission(s): 12480
Problem Description
在每年的校赛里,所有进入决赛的同学都会获得一件很...
分类:
其他好文 时间:
2014-06-05 10:03:43
阅读次数:
192
【题目】
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BANC".
Note:
If there is no such window in S that covers ...
一切见注释。
#include
#include
#include
#include
using namespace std;
bool vis[22];
int n;
int ans[22];
int top;
bool isprime(int x)//判断素数
{
for(int i=2;i<x;i++)
if(x%i==0)return false;
...
分类:
其他好文 时间:
2014-06-05 08:26:47
阅读次数:
201
"下沙野骆驼"ACM夏令营Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 786 Accepted Submission(s): 377
Problem Description 大家都知道,杭电计算机学院为了吸引更多的学...
分类:
其他好文 时间:
2014-06-05 07:45:01
阅读次数:
335
Reward
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3554 Accepted Submission(s): 1077
Problem Description
Dandelion's uncle i...
分类:
其他好文 时间:
2014-06-05 05:59:34
阅读次数:
203
http://acm.hdu.edu.cn/showproblem.php?pid=2544
入门级别 floyed和dijkstra都可以
//Dijkstra
#include
#include
#define N 105
#define inf 0xfffffff
int dis[N],map[N][N],vis[N],n;
void dijkstra()
{
int m,k...
分类:
其他好文 时间:
2014-06-05 05:39:32
阅读次数:
196
题目来源:HDU 3367 Pseudoforest
题意:每个连通块最多可以有一个环 求最大的森林
思路:考虑最大生成树 如果祖先一样没有环 那就合并 如果祖先不一样 如果2棵树都没有环 合并 如果有1棵树有环 合并 标记该棵树有环
#include
#include
#include
using namespace std;
const int maxn = 100010;
str...
分类:
其他好文 时间:
2014-06-05 05:35:03
阅读次数:
261
Floyd。注意字典序!!! 1 #include 2 #include 3 4
#define MAXNUM 55 5 #define INF 0x1fffffff 6 7 int cost[MAXNUM][MAXNUM]; 8 int
path[MAXNUM][MAXNUM]; 9 in...
分类:
其他好文 时间:
2014-05-31 04:41:38
阅读次数:
218