problemscpp
A collection of my answers to algorithm problems in c++.
|
#include <leetcode.h>
Public 成员函数 | |
UndergroundSystem ()=default | |
void | checkIn (int id, const string &stationName, int t) |
通行卡 ID 等于 id 的乘客,在时间 t ,从 stationName 站进入 乘客一次只能从一个站进入 更多... | |
void | checkOut (int id, const string &stationName, int t) |
通行卡 ID 等于 id 的乘客,在时间 t ,从 stationName 站离开 更多... | |
double | getAverageTime (const string &startStation, const string &endStation) |
平均时间会根据截至目前所有从 startStation 站 直接 到达 endStation 站的行程进行计算,也就是从 startStation 站进入并从 endStation 离开的行程 从 startStation 到 endStation 的行程时间与从 endStation 到 startStation 的行程时间可能不同 在调用 getAverageTime 之前,至少有一名乘客从 startStation 站到达 endStation 站 更多... | |
Private 属性 | |
unordered_map< int, pair< string, int > > | records |
unordered_map< string, unordered_map< string, vector< int > > > | um |
在文件 leetcode.h 第 3263 行定义.
|
default |
void leetcode::design_underground_system::UndergroundSystem::checkIn | ( | int | id, |
const string & | stationName, | ||
int | t | ||
) |
通行卡 ID 等于 id 的乘客,在时间 t ,从 stationName 站进入 乘客一次只能从一个站进入
在文件 leetcode.cpp 第 9359 行定义.
引用了 records.
void leetcode::design_underground_system::UndergroundSystem::checkOut | ( | int | id, |
const string & | stationName, | ||
int | t | ||
) |
通行卡 ID 等于 id 的乘客,在时间 t ,从 stationName 站离开
在文件 leetcode.cpp 第 9360 行定义.
double leetcode::design_underground_system::UndergroundSystem::getAverageTime | ( | const string & | startStation, |
const string & | endStation | ||
) |
平均时间会根据截至目前所有从 startStation 站 直接 到达 endStation 站的行程进行计算,也就是从 startStation 站进入并从 endStation 离开的行程 从 startStation 到 endStation 的行程时间与从 endStation 到 startStation 的行程时间可能不同 在调用 getAverageTime 之前,至少有一名乘客从 startStation 站到达 endStation 站
在文件 leetcode.cpp 第 9362 行定义.
引用了 um.
|
private |
在文件 leetcode.h 第 3265 行定义.
被这些函数引用 checkIn() , 以及 checkOut().
|
private |
在文件 leetcode.h 第 3264 行定义.
被这些函数引用 checkOut() , 以及 getAverageTime().