A1006. Sign In and Sign Out(25)

25/25,一遍过了,很开心。

#include<bits/stdc++.h>
using namespace std;
struct record{
    string id;
    string in_time;
    string out_time;
};
vector<record> records;
void solve(){
    int m;
    cin>>m;
    int t=0;
    int unlockman=0;
    int lockman=0;
    string earliest_in,latest_out;
    earliest_in="23:59:59";
    latest_out="00:00:00";
    while(m--){
        record r;
        cin>>r.id>>r.in_time>>r.out_time;
        records.push_back(r);
        if(r.in_time<earliest_in){unlockman=t;earliest_in=r.in_time;}
        if(r.out_time>latest_out){lockman=t;latest_out=r.out_time;}
        t++;
    }
    cout<<records[unlockman].id<<" "<<records[lockman].id;
}
int main(){
    solve();
    return 0;
}

这样的题多做其实也无益,所以为了节省时间,不妨只做通过率在0.35以下的题。挑战稍微有点难度的题。

posted @   MarkKobs  阅读(200)  评论(0编辑  收藏  举报
编辑推荐:
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
阅读排行:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
点击右上角即可分享
微信分享提示