莫名其妙的编译错误
查看原帖
莫名其妙的编译错误
672360
Ch35楼主2022/6/19 20:51

结果

#include<bits/stdc++.h>
using namespace std;
int n,m,q,u,v,st,fi,l,r;
static bool a[200005][200005],b[200005];
bool e;
void dfs(int z,bool can){
    if(z==fi&&!can)e=1;
    if(e==1)return;
    if(z<=r&&can)dfs(z,0);
    for(int i=0;i<n;i++){
        if(b[i]==0&&a[i][z]==1){
            if((can&&i>=l)||(!can&&i<=r)){
                b[i]=1;
                dfs(i,can);
                b[i]=0;
            }
        }
    }
}
int main(){
	cin>>n>>m>>q;
	for(int i=1;i<=m;i++){
	    cin>>u>>v;
	    a[u][v]=1;
	    a[v][u]=1;
    }
    while(q--){
        cin>>st>>fi>>l>>r;
        e=0;
        st--;
        fi--;
        l--;
        r--;
        b[st]=1;
        dfs(st,1);
        cout<<e<<endl;
        for(int i=0;i<n;i++)b[i]=0;
    }
	return 0;
}
2022/6/19 20:51
加载中...