注:最后一个测试用例没过,只有29分,以后再看。。
#include#include struct record{ int atime;//arrive time int utime;//use time:p int isvip;//is vip? int wtime;//waitting time int isplayed;}s[10001];int viptag[101];int comp(const void*a,const void*b){ struct record *p=(struct record*)a,*q=(struct record*)b; return p->atime-q->atime;}int comps(const void*a,const void*b){ struct record *p=(struct record*)a,*q=(struct record*)b; return (p->atime+p->wtime)-(q->atime+q->wtime);}void InitTable(int table[],int k){ for(int i=1;i<=k;++i) table[i]=8*3600;}void dalao(int table[],int k,int time){ for(int i=1;i<=k;++i) if(table[i]