洛谷:https://www.luogu.com.cn/record/35118931
XJOI:https://dev.xjoi.net/contest/detail/446514
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
struct node
{
int s,t;
};
int n,t,m,ans,a[1000008];
queue<node>sh;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>t>>m;
while(!sh.empty())
{
node h=sh.front();
if(h.t+86400<t)
{
a[h.s]--;
if(a[h.s]==0)ans--;
sh.pop();
continue;
}
else break;
}
for(int i=1;i<=m;i++)
{
node h;
int x;
cin>>x;
h.s=x;
h.t=t;
sh.push(h);
if(a[h.s]==0)ans++;
a[h.s]++;
}
cout<<ans<<endl;
}
return 0;
}