文章

33

粉丝

42

获赞

3

访问

8.1k

头像
日志排序 题解:
P1227 北京大学机考题
发布于2024年3月14日 15:31
阅读数 307

//借鉴nicooy
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
struct record {
    string name;
    string start;
    double time;
};
bool asc(record a,record b){
    if (a.time == b.time)
        return a.start < b.start;
    else
        return a.time < b.time;
}
int main() {
    int count = 0;
    record rec[10000];
    string temp;
    while (getline(cin, temp)) {
        if (temp == "")
            break;
        rec[count].name = temp;
        rec[count].start = temp.substr(13,23);
        rec[count].time = stod(...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发