3 条题解

  • 1
    @ 2023-5-28 18:02:17
    #include<bits/stdc++.h>
    
    using namespace std;
    
    int n,v,w,ans=1;
    
    pair<char,int> f[1003];
    
    int main() {
    	scanf("%d %d %d\n",&n,&v,&w);
    	for(int h,m,i=1;i<=n;i++) {
    		scanf("%c-%d:%d\n",&f[i].first,&h,&m);
            f[i].second=h*60+m;
    	}
    	sort(f+1,f+1+n);
    	for(auto cur=1,i=2;i<=n;i++) {
            if(f[i].first!=f[i-1].first || i-cur>v || f[i].second>f[cur].second+w) {
                cur=i;
                ans++;
            }
    	}
    	printf("%d\n",ans);
    	return 0;
    }
    

    信息

    ID
    833
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    递交数
    372
    已通过
    35
    上传者