PAT 1095 Cars on Campus】的更多相关文章

1095 Cars on Campus (30 分) Zhejiang 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 information available, you are supposed to tell, at…
PAT甲级1095. Cars on Campus 题意: 浙江大学有6个校区和很多门.从每个门口,我们可以收集穿过大门的汽车的进/出时间和车牌号码.现在有了所有的信息,你应该在任何特定的时间点告诉在校园停车的数量, 在一天结束时,发现停车时间最长的汽车. 输入规格: 每个输入文件包含一个测试用例.每个案例从两个正整数N(<= 10000)开始,记录数,K(<= 80000)查询次数.然后按N行,每个都以格式记录 plate_number hh:mm:ss status 其中plate_num…
本文同步发布在CSDN:https://blog.csdn.net/weixin_44385565/article/details/93135047 1095 Cars on Campus (30 分)   Zhejiang 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 t…
1095 Cars on Campus 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 gate. Now with all the information available, you are supposed to tell, at any sp…
Cars on Campus (30) 时间限制 1000 ms 内存限制 65536 KB 代码长度限制 100 KB 判断程序 Standard  题目描述 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 gate. Now with all t…
http://www.patest.cn/contests/pat-a-practise/1095 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 gate. Now with all the information available, you a…
模拟题.仔细一些即可. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<map> #include<queue> #include<cstring> #include<stack> #include<vector> #include<iostream> using namesp…
题意:给出n个车辆进出校园的记录,以及k个时间点,让你回答每个时间点校园内的车辆数,最后输出在校园内停留的总时间最长的车牌号和停留时间,如果不止一个,车牌号按字典序输出. 几个注意点: 1.如果一个车连续多次进入,只取最后一个 2.如果一个车连续多次出去,只取第一个 3.一个车可能出入校园内好几次,停留时间取总和 实际上题目就是让我们求某个时间段内的车辆总和,时间段其实就相当于一个区间,区间求和的话,很快就联想到树状数组和线段树.然而怎么将时间段和区间联系起来呢,那就存储出现在记录和询问里的所有…
题意:输入两个正整数N和K(N<=1e4,K<=8e4),接着输入N行数据每行包括三个字符串表示车牌号,当前时间,进入或离开的状态.接着输入K次询问,输出当下停留在学校里的车辆数量.最后一行输出总计停留时间最长的车牌号(字典序升序输出)和停留总时. AAAAAccepted code: //因为一天只有86400秒,所以可以用一个car数组在统计车辆停留时间时在进入时间+1,离开时间-1.再用一个sum数组扫一遍,sum[i]=sum[i-1]+car[i],即可表示当下时间有多少辆车还在停留…
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 gate. Now with all the information available, you are supposed to tell, at any specific time point, t…