B1006 Sign In and Sign Out (水题)

B1006 Sign In and Sign Out (25分)

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define lowbit(i)((i)&(-i))
using namespace std;
typedef long long ll;
const int MAX=1e5+10;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
const int SQR=633;
struct node
{
    string id;
    int in;
    int out;
};
vectorvt;
bool cmp(node a,node b)
{
    return a.inb.out;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i>id;
        int h,m,s,in;
        scanf("%d:%d:%d",&h,&m,&s);
        in=h*3600+m*60+s;
        int h2,m2,s2,out;
        scanf("%d:%d:%d",&h2,&m2,&s2);
        out=h2*3600+m2*60+s2;
        temp.id=id;
        temp.in=in;
        temp.out=out;
        vt.push_back(temp);
    }
    sort(vt.begin(),vt.end(),cmp);
    cout<

你可能感兴趣的:(B1006 Sign In and Sign Out (水题))