首页 > TAG信息列表 > Buses

bus

A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a road vehicle designed to carry many passengers. Buses can have a capacity as high as 300 passengers. The most common type is the single-deck rigid bus, with larger loads

CF101B Buses 题解

题意 有 \(n\) 个公交站, \(m\) 辆车,只能从 \([s_i,t_i-1]\) 范围里的公交站上车,问有多少种到第 \(n\) 站的方案。 分析 这显然是一道 dp 题。 \(dp_i\) 表示坐第 \(i\) 辆车到 \(t_i\) 站的方案数。首先将所有公交车按照终点从小到大排序,这样就可以二分找到终点符合条件的一段公交

169:The Buses(翻译)

来源:http://noi.openjudge.cn/ch0407/169/ The Buses 描述 A man arrives at a bus stop at 12:00. He remains there during 12:00-12:59. The bus stop is used by a number of bus routes. The man notes the times of arriving buses. The times when buses arrive are give

LeetCode 815. 公交路线

难度:困难。 标签:广度优先搜索,数组,哈希表。 这个题之前做过,印象深刻,还记得怎么做。 重点是要将公交车作为广搜的节点。使用公交站的话会超时。 正确解法: class Solution { public: int numBusesToDestination(vector<vector<int>>& routes, int source, int target) {

The Buses POJ - 1167

原题链接 考察:搜索 思路:         这道题题目描述略坑,这里简述下题意:        1.所有路线上的公交车形成等差数列,而且等差数列的最后一项再+d>60.        2.存在两个完全一样的路线.        3.求路线最少值.        由于题目提示信息:ans<=17.可以发现搜索

Codeforces Round #111 (Div. 2) E. Buses and People 线段树

这很像一个偏序的问题 但是我们要用线段树来解决它  仔细想想cdq应该也可 但是写起来比较麻烦 我们就写线段树 首先我们把人和车都按上车起始点排序  这样可以减少一维   剩下还有终止点和时间这两维  我们对时间离散化 并且以时间(车辆的信息)开一棵线段树维护终止点的最

Codeforces A. Serval and Bus

inputstandard inputoutputstandard outputIt is raining heavily. But this is the first day for Serval, who just became 3 years old, to go to the kindergarten. Unfortunately, he lives far from kindergarten, and his father is too busy to drive him there. The