P2058海港求助
查看原帖
P2058海港求助
572482
Dream_weavers楼主2021/11/27 11:32
#include<iostream>
#include<queue>
using namespace std;
typedef long long ll;
const ll N=1e8+5;
ll n;
struct node{
	ll t,x;
};
ll t,k,x,cnt,c[N];
queue <node> q; 
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	for(ll i=1;i<=n;i++){
		cin>>t>>k;
		while(!q.empty()&&q.front().t+86400<t){
			node cur=q.front();
			c[cur.x]--;
			if(c[cur.x]==0)cnt--;
			q.pop();
		}
		for(ll j=1;j<=k;j++){
			cin>>x;
			c[x]++;
			if(c[x]==1)cnt++;
			q.push(node{t,x});
		}
		cout<<cnt<<endl;
	}
	return 0;
}

70分 WA了7、8、9、10、11、13 评测记录QAQ求助啊

2021/11/27 11:32
加载中...