求助!!!P2058 40分
  • 板块学术版
  • 楼主包包
  • 当前回复1
  • 已保存回复1
  • 发布时间2021/7/30 15:40
  • 上次更新2023/11/4 12:39:37
查看原帖
求助!!!P2058 40分
224045
包包楼主2021/7/30 15:40
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
long long n,sum,t,p,s,s1;
long long people[1000010],country[1000010],shijian[1000010];
using namespace std;
int main()
{
	freopen("port.in","r",stdin);
	freopen("port.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>t>>p;
		for(int j=1;j<=p;j++)
		{
			cin>>people[++s];
			shijian[s]=t;
			if(country[people[s]]++==0) sum++;
		}
		while(t-shijian[s1]>=86400)
		{
			if(--country[shijian[s1]]==0) sum--;
			i++;
		}
		cout<<sum<<endl;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
2021/7/30 15:40
加载中...