算法设计
文章平均质量分 61
边城浪子_2013
梦想还是要有的,万一实现了呢!
展开
-
1005. F.Snowy Roads最小生成树Kruskal算法
1005. F.Snowy Roads最小生成树Kruskal算法 Description There was a heavy snow in the town yesterday. Some roads in the town are covered with thick snow so that t原创 2015-12-20 13:33:54 · 420 阅读 · 0 评论 -
Sicily 1321(Dijkstra算法)
1321. RobotConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionKarell Incorporated has designed a new exploration robot that has the ability to explore new terrains, thi原创 2016-02-25 10:37:28 · 401 阅读 · 0 评论 -
c++精度输出
#include cout // cout setiosflags(ios::fixed)原创 2017-02-07 16:37:22 · 285 阅读 · 0 评论 -
回文判断
个人笔记原创 2017-02-08 15:03:37 · 250 阅读 · 0 评论 -
1021. Deepest Root (25)
#include #include #include #include using namespace std;const int maxn = 10010;int deepest = 0;vector city[maxn];int deep_r[maxn], p = 0;bool visit[maxn] = {false};bool visit1[maxn] = {fa原创 2017-02-20 12:12:46 · 249 阅读 · 0 评论 -
1112. Stucked Keyboard (20)
题目链接:点击打开链接问题:字符串中连续出现K次的字符为坏键.AC思路:用vector记录每个字符出现的位置(遍历一遍字符串),然后根据每个字符出现次数,若不能整除K,则说明该字符合法;否则依次对比出现的位置pos[i + K - 1] - pos[i] == K - 1,若是,则该字符不合法;否则记为合法。代码如下:#include #include #include #include原创 2017-02-23 01:15:29 · 300 阅读 · 0 评论