40分求助
查看原帖
40分求助
126053
qqqevinxxz楼主2020/8/10 17:42
#include<bits/stdc++.h>
using namespace std;
const int MAXN=300000+50;
int tim[MAXN],cnt[MAXN],cou[MAXN];
int n,t,k,ans,i;
int main()
{
	cin>>n;
	while(n--)
	{
		cin>>t>>k;
		while(k--)
		{
			tim[++i]=t;//第i个人的时间
			cin>>cou[i];
			if(cnt[cou[i]]==0) ans++;
			cnt[cou[i]]++;  
		}
		int j=0;
		while(t-tim[++j]>=86400)
		{
			if(cnt[cou[j]]-1==0) {
				ans--;
				cnt[cou[j]]--;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}
2020/8/10 17:42
加载中...