#include "collapse.h"
#include<vector>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
std::vector<int> simulateCollapse(
int N,
std::vector<int> T,
std::vector<int> X,
std::vector<int> Y,
std::vector<int> W,
std::vector<int> P
) {
int C=T.size();
int Q=P.size();
pair<pair<int,int>,int> arr[Q];
for(int i=0;i<Q;i++){
arr[i].first.first=W[i];
arr[i].first.second=P[i];
arr[i].second=i;
}
sort(arr,arr+Q);
int pnt=0;
vector<pair<int,bool> >nei[N];
vector<pair<int,int> > ans ;
for(int i=0;i<C;i++){
if(T[i]==0){
nei[X[i]].push_back(pair<int,bool>(Y[i],true));
nei[Y[i]].push_back(pair<int,bool>(X[i],true));
}else{
for(int j=0;j<nei[X[i]].size();j++){
if(nei[X[i]][j].first==Y[i]){
nei[X[i]][j].second=false;
}
}for(int j=0;j<nei[Y[i]].size();j++){
if(nei[Y[i]][j].first==X[i]){
nei[Y[i]][j].second=false;
}
}
}
while(pnt<Q && arr[pnt].first.first==i){
bool visited[N];
for(int j=0;j<N;j++){
visited[j]=false;
}int CC=0;
for(int strt=0;strt<N;strt++){
if(!visited[strt]){
visited[strt]=true;
CC++;
queue<int>q;
q.push(strt);
while(!q.empty()){
int u=q.front();q.pop();
for(int j=0;j<nei[u].size();j++){
int v=nei[u][j].first;
if(nei[u][j].second && !visited[v] && !(arr[pnt].first.second>=v ^ arr[pnt].first.second>=u)){
visited[v]=true;
q.push(v);
}
}
}
}
}ans.push_back(pair<int,int>(arr[pnt].second,CC));
pnt++;
}
}sort(ans.begin(),ans.end());
vector<int> R;
for(int i=0;i<Q;i++){
R.push_back(ans[i].second);
}
return R;
}
Compilation message
bubblesort2.cpp:1:10: fatal error: collapse.h: No such file or directory
#include "collapse.h"
^~~~~~~~~~~~
compilation terminated.