QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#425520#8302. Incoming AsteroidsDaiRuiChen007Compile Error//C++141.1kb2024-05-30 12:36:302024-05-30 12:36:31

Judging History

你现在查看的是最新测评结果

  • [2024-05-30 12:36:31]
  • 评测
  • [2024-05-30 12:36:30]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN=2e5+5;
ll lim[MAXN],up[MAXN],sum[MAXN];
vector <int> pos[MAXN];
priority_queue <array<ll,2>,vector<array<ll,2>>,greater<array<ll,2>>> f[MAXN];
signed main() {
	int n,m=0,q,lst=0;
	ios::sync_with_stdio(false);
	cin>>n>>q;
	while(q--) {
		int op;
		cin>>op;
		if(op==1) {
			int k,c;
			cin>>k>>c,k^=lst,lim[++m]=k,pos[m].resize(c),up[m]=(k+c-1)/c;
			for(int &i:pos[m]) cin>>i,i^=lst,lim[m]+=sum[i],f[i].push({up[m],m});
		} else {
			int u,w;
			cin>>u>>w,u^=lst,w^=lst,sum[u]+=w;
			vector <int> ans;
			while(f[u].size()) {
				while(f[u].size()&&f[u].top()[0]!=up[f[u].top()[1]]) f[u].pop();
				if(f[u].empty()||f[u].top()[0]>sum[u]) break;
				int i=f[u].top()[1]; f[u].pop();
				ll rem=lim[i];
				for(int j:pos[i]) rem-=sum[j];
				if(rem<=0) ans.push_back(i),up[i]=-1;
				else up[i]=(rem-1)/pos[i].size()+1;
			}
			for(int i:oth) for(int j:pos[i]) f[j].push({up[i],i});
			sort(ans.begin(),ans.end()),cout<<(lst=ans.size());
			for(int x:ans) cout<<" "<<x; cout<<"\n";
		}
	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:32:35: error: ‘oth’ was not declared in this scope
   32 |                         for(int i:oth) for(int j:pos[i]) f[j].push({up[i],i});
      |                                   ^~~