文章

93

粉丝

56

获赞

263

访问

18.9k

头像
日志排序 题解:暴力(部分坑点有注释)
P1227 北京大学机考题
发布于2025年3月23日 12:03
阅读数 159

#include <bits/stdc++.h>
using namespace std;

struct node
{
    string zong;
    string name;
    string day;
    string sec;
    double tim;
}fk[10005];

bool cmp(node a,node b)
{
    if(a.tim!=b.tim)return a.tim<b.tim;
    else if(a.day!=b.day)return a.day<b.day;
    else if(a.sec!=b.sec)return a.sec<b.sec;
    else return a.name<b.name;
}

int main()
{
    int i=0;
    string str;
    while(getline(cin,str))
    {
        fk[i].zong=str;
        if(str.empty())break;//有故意输入空行的坑,这时候跳过
        int a=str.size();
        int bg=-1;
        int jl=0;
        for(int j...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发