???why RE
查看原帖
???why RE
895044
break_for_dream楼主2023/1/6 10:43
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstdio>
//#include<windows.h>
//#include<bits/stdc++.h>
using namespace std;
long long n,a[7][2005],p,t,h,f[7],ans;
int main() {
	cin>>n;
	for(int i=1; i<=n; i++) {
		cin>>p>>t;
		a[p][++f[p]]=t;
	}
	for(int i=1; i<=6; i++) {
		sort(a[i]+1,a[i]+f[i]+1);
	}
	for(int i=1; i<=6; i++) {
		if(f[i]==0){
			continue; 
		}
		else{
			int x=1; 
			while(x<=f[i]){
				ans++;
				int y=x; 
				while(a[i][y]<a[i][x]+60){
					y++;
				}
				x=y;
			}
		}
	}
	cout<<ans;
	return 0;
}
2023/1/6 10:43
加载中...