56分求调!!!(还有一个RE
  • 板块P1241 括号序列
  • 楼主gouse
  • 当前回复0
  • 已保存回复1
  • 发布时间2024/7/23 11:53
  • 上次更新2024/7/23 12:00:57
查看原帖
56分求调!!!(还有一个RE
1272629
gouse楼主2024/7/23 11:53
#include<bits/stdc++.h>
using namespace std;
int country[100010]={0},n,m,tmp,ans,ti;
struct z{
	int t,sum;
};
queue<z> boat;
z now;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>ti>>m;
		while(!boat.empty()){
			now=boat.front();
			if(ti-now.t>=86400){
				if(country[now.sum]==1)
					ans--;
				country[now.sum]--;
				boat.pop();
				continue;
			}break;
		}
		for(int j=1;j<=m;j++){
			cin>>tmp;
			if(country[tmp]==0)
				ans++;
			country[tmp]++;
			now.sum=tmp;
			now.t=ti;
			boat.push(now);
		}
  		cout<<ans;
  		if(i!=n) cout<<endl;
	}	
	return 0;
} 
2024/7/23 11:53
加载中...