AC

Bryson · 发布于 2025-10-02 · 浏览 325 回复 0
#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;
}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复