Bryson • 7天前
#include <bits/stdc++.h>
using namespace std;
int n, ans, num[100005];
struct node {
int x, t;
} a;
queue<node> q;
int main() {
cin >> n;
for (int i = 1, t, k; i <= n; i++) {
cin >> t >> k;
for (int j = 1, x; j <= k; j++)
cin >> x,
q.push({x, t}),
ans += (++num[x] == 1);
for (a = q.front(); q.size() && a.t + 86400 <= t; q.pop(), a = q.front())
ans -= (--num[a.x] == 0);
cout << ans << '\n';
}
return 0;
}
评论:
请先登录,才能进行评论