请求大佬帮忙
查看原帖
请求大佬帮忙
522740
Lovesaint_lym2010楼主2022/10/30 16:03
#include <iostream>
#include <queue>
using namespace std;
const int NR = 1e5 + 10;
struct Node
{
	long long t, x;
};
long long cnt[NR];
queue<Node> q;
int main()
{
	long long n, tot = 0;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		long long t, k;
		cin >> t >> k;
		for (int j = 1; j <= k; j++)
		{
			long long x;
			cin >> x;
			q.push(Node{t, x});
			cnt[x]++;
			if (cnt[x] == 1) tot++;
		}
		while (!q.empty() && t - q.front().t > 86400)
		{
			cnt[q.front().x]--;
			if (cnt[q.front().x] == 0) tot--;
			q.pop();
		}
		cout << tot << endl;
	}
	return 0;
}

为啥代码死也过不去?

2022/10/30 16:03
加载中...