上一页 1 2 3 4 5 6 7 8 ··· 30 下一页
摘要: 题意:两个整数集合,它们的相似度定义为:nc/nt*100%nc为两个集合都有的整数nt为两个集合一共有的整数注意这里的整数都是各不相同的,即重复的不考虑在内。给出n个整数集合,和k个询问,让你输出每个询问中两个集合的相似度。 因为数值范围在[0,10^9],开不了这么大的数组来标记某个数的出现,所 阅读全文
posted @ 2017-04-25 21:30 辰曦~文若 阅读(283) 评论(0) 推荐(0)
摘要: 题意:n个窗口,每个窗口可以排m人。有k为顾客需要办理业务,给出了每个客户的办理业务时间。银行在8点开始服务,如果窗口都排满了,客户就得在黄线外等候。如果有一个窗口用户服务结束,黄线外的客户就进来一个。如果有多个可选,选窗口id最小的。输出查询客户的服务结束时间。 如果客户在17点(注意是包括的!! 阅读全文
posted @ 2017-04-20 20:37 辰曦~文若 阅读(1661) 评论(0) 推荐(0)
摘要: 给出n个城市,m条边,起始点c1和目的点c2接下来给出n个城市的队伍数以及m条双向边问你求c1到c2的所有最短路径数目,以及其中经过的最多队伍数 先最短路dijkstra,同时建立vector数组pre存储前驱节点然后dfs求出路径,以及每条路径经过的队伍数,更新最大值即可 #include <io 阅读全文
posted @ 2017-04-19 20:33 辰曦~文若 阅读(741) 评论(0) 推荐(0)
摘要: 给出n和k接下来n行,每行给出a,b,c,表示a和b之间的关系度,表明他们属于同一个帮派一个帮派由>2个人组成,且总关系度必须大于k。帮派的头目为帮派里关系度最高的人。(注意,这里关系度是看帮派里边的和,而不是帮派里所有个人的总和。如果是按个人算的话,相当于一条边加了两次,所以应该是>2*k)问你有 阅读全文
posted @ 2017-04-19 20:16 辰曦~文若 阅读(474) 评论(0) 推荐(0)
摘要: 模拟先说一下例子,最后为方便起见,在目的地安增加一个费用为0的加油站0 1 2 3 4 5 6 7 87.1 7.0 7.2 6.85 7.5 7.0 7.3 6.0 00 150 200 300 400 600 1000 1250 1300车子加满了最多开50*12=600的距离0.第0个加油站6 阅读全文
posted @ 2017-04-19 20:07 辰曦~文若 阅读(475) 评论(0) 推荐(1)
摘要: #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> using namespace std; /* 链表题 水 */ int n; struct Word{ i 阅读全文
posted @ 2017-04-19 20:05 辰曦~文若 阅读(214) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> using namespace std; int n; int n1,n2,n3; char str[100 阅读全文
posted @ 2017-04-19 20:04 辰曦~文若 阅读(201) 评论(0) 推荐(0)
摘要: 模板题最短路+输出路径如果最短路不唯一,输出cost最小的 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> #include <queue> #define 阅读全文
posted @ 2017-04-19 20:02 辰曦~文若 阅读(340) 评论(0) 推荐(0)
摘要: 这个是原先AC的代码,但是目前最后一个样例会超内存,也就是开不了两个数组来保存两个序列了,意味着我们只能开一个数组来存,这就需要利用到两个数组都有序的性质了。 #include <iostream> #include <cstdio> #include <algorithm> #include <s 阅读全文
posted @ 2017-04-19 20:01 辰曦~文若 阅读(434) 评论(8) 推荐(0)
摘要: #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> #include <queue> using namespace std; /* 水排序 */ const 阅读全文
posted @ 2017-04-19 19:59 辰曦~文若 阅读(222) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 30 下一页