测试点5应该是,同一个人在一天内重复申请的情况,只能输出一次。
用了stable_sort,可以在两项比较相等时,维持原来的顺序。
代码如下:
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
struct person{
std::string name;
std::string id;
int status;
int time;
person(std::string _name, std::string _id, int _status, int _time):
name(_name), id(_id), status(_status), time(_time){}
};
int d, p, t, s, status, hh, mm;
char id[21];
char name[11];
std::map<std::string, int> nextApply, mp;
std::vector<person> ill;
bool cmp(const person &a, const person &b){
return a.time < b.time;
}
int main(){
scanf("%d %d", &d, &p);
for(int i = 1; i <= d; ++i){
scanf("%d %d", &t, &s);
std::vector<person> temp;
for(int j = 0; j < t; ++j){
scanf(&