好麻烦啊。。。没写完先放一放吧
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <string.h>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
int hourcost[30];
class node
{
public:
string name,tim,typee;
}
int getCost(string start,string en,ll &lon)
{
int starttime=0,endtime=0;
for(int i=3;i<=4;i++)
{
starttime*=10;
starttime*=
}
}
bool cmp(const node &x,const node &y)
{
if(x.name!=y.name)return x.name<y.name;
if(x.tim!=y.tim)return x.tim<y.tim;
return x.typee>y.typee;
}
vector<node>v;
vector<node>lin[1200];
int main()
{
for(int i=1;i<=24;i++)
cin>>hourcost[i];
int n;
cin>>n;
for(int i=0;i<n;i++)
{
node tmp;
cin>>tmp.name>>tmp.tim>>tmp.typee;
v.push_back(tmp);
}
sort(v.begin(),v,end(),cmp);
map<string,bool>isshow;
int cot=0;
for(int i=0;i<v.size();i++)
{
if(!isshow[v[i].name])cot++,isshow[v[i].name]=true;
lin[cot].push_back(v[i]);
}
for(int i=0;i<=cot;i++)
{
int flag=0;
double all=0;
for(int j=0;j<lin[cot].size();j++)
{
if(lin[cot][j].typee=="off-line"&&j+1<lin[cot].size()&&lin[cot][j+1].typee=="on-line")
{
if(!flag)
{
flag=1;
cout<<lin[cot][j].name<<" "<<lin[cot][j].tim[0]<<lin[cot][j].tim[1];
}
cout<<lin[cot][j].tim.substr(2)<<" "<<lin[cot][j+1].tim.substr(2);
int lon;
int cos=getCost(lin[cot][j].tim,lin[cot][j+1].tim,lon);
all+=cos*1.0/100;
printf(" %d %.2f\n",lon,cos*1.0/100);
}
}
}
}