题目题意:给出n个车牌号、个值。注意:一个车可能出入校园好多次,停车的时间应该取之和。tip:map+排序+状态记录#inc...
原创
2023-06-27 10:23:15
79阅读
UVA_10397
这个题目是一个求最小生成树的题目,只不过在求最小生成树之前要先用并查集对已经建好的边进行处理即可。
#include<stdio.h>#include<string.h>#include<math.h>#include<stdlib.h>double x[1010],y[1010],w[1000010];int u[10
转载
2011-09-29 16:46:00
88阅读
Basic: Backtracking + pruning DP: refer to https://leetcode.com/problems/campus-bikes-ii/discuss/305218/DFS-%2B-Pruning-And-DP-Solution state : dp[i][
转载
2019-10-02 16:13:00
114阅读
2评论
#include<iostream> #include<vector> #include<map> #include<queue> #include<string> #include<cstring> using namespace std; const int MAXN = 205; const int INF = 1000000; int dis[MAXN]; int n;//结点数量 typedef pair<int,int> pii; struct edge//建立边的结构体 { int v; //v表
转载
2011-07-04 18:37:00
36阅读
最小生成树Kruskal#include#include#include#includeusing namespace std;struct A{ int x,y; double z;}a[500010];int r[755];int find_(int x){ while(x!=...
转载
2015-09-25 09:05:00
43阅读
2评论
1095 Cars on Campus (30 point(s))Zhejiang University has 8 campuses and a lot of gates. From
原创
2022-09-15 10:59:32
67阅读
Description
原创
2022-11-10 01:07:51
32阅读
带模拟。 题意 给出N条记录,每条记录给出一辆车的车牌号、当前时刻以及出入校情况(入校(in)还是出校(out))。然后给出K个查询,每个查询给出一个时刻,输出在这个时刻校园内的车辆数。 查询完毕后输出在学校内停留时间最长的车辆的车牌号(如果有多个,就一并输出)和对应的停留时间。 注意: 每个 in
转载
2021-02-17 10:05:00
72阅读
"Link" 实际上我们是维护了两个森林。 合并两个点时,我们考虑新建一个点,用这个新建的点储存信息,然后把需要合并的两个点所在树的根连到这个点上。 如果仅有大学的操作,我们可以每次给修改的树的根打一个,那么询问的就是一个点到树根的路径上的权值和,这个可以用带权并查集实现。 现在加上了军队的操作,如
转载
2020-03-09 20:37:00
66阅读
2评论
轮廓线dp一下就行了
原创
2023-07-05 20:01:38
49阅读
返回目录题意给出N条记录,每条记录给出一辆车的车牌号、 当前时刻以及出入校情况(入校(in)还是出校(o
原创
2022-07-14 17:45:23
30阅读
Zhejiang University has 8 campuses(校区) and a lot of gates(大门). From each gate we can collect the in/out times and the plate
原创
2022-05-25 17:50:55
74阅读
* 合办大学 -- internal campus in China- international campus zhejiang University- 南方科技大学 - 西交利物浦大学(Xi’an Jiaotong-liverpool University)- 宁波有诺丁汉大学(2004)- 上
原创
2021-07-28 13:48:04
256阅读
原题链接在这里:https://leetcode.com/problems/campus-bikes/ 题目: On a campus represented as a 2D grid, there are N workers and M bikes, with N <= M. Each worke
转载
2020-01-16 13:20:00
62阅读
2评论
输入N个车辆进出记录 K个要查询的时间点N行 车牌 时间(00:00:00~23:59:59) 进in/出out……K行 查询的时间(对应输出这个时间点停车场的车辆数。这个时间点如果正好有车有操作,那么车辆数是操作后的 【进+1/出-1/无0】)……最后给出一天中累计停放的时间最长的车牌号(多个按字母序输出) 并输出这个最长时间PS:由于K行的查询是按时间顺序进行的,那么可以直接从头搜到尾。也可以用统计放到数组里面再用二分法,测试出来的时间差不多,内存有点区别。但是如果全部用ci
原创
2022-11-25 11:14:45
63阅读
Just encountered the NUSmart driverless Shuttle in the campus, it was on 29 July when I was
原创
2022-08-22 14:05:20
74阅读
A1095Cars on CampusZhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the inform...
原创
2021-07-09 15:04:53
48阅读
原题链接在这里:https://leetcode.com/problems/campus-bikes-ii/ 题目: On a campus represented as a 2D grid, there are N workers and M bikes, with N <= M. Each wo
转载
2020-01-17 08:09:00
128阅读
2评论
题目大意:要在学校搭建校园网,已经将其中几台机器连接起来了,求将其他机器也用线连接起来,使其生成一棵最小生成树,求用的线的长度解题思路:kruskal算法的模板题,先将连接起来的机器的点并起来就可以解决了,记得数组开大点#include#include#include#includeusing namespace std;#define maxn 755#define maxl
原创
2023-04-07 10:38:17
18阅读
Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the g
转载
2018-07-10 22:36:00
113阅读