禾木,答案在这

jichenkai007 2020-11-28 11:24:29 8 返回题目

#include <bits/stdc++.h> using namespace std; queue q; int a[10000]; bool vis[10000]; int main() { int n,s,e; cin>>n>>s>>e; for(int i=1;i<=n;i++) cin>>a[i]; q.push(s); vis[s]=1; int x=0,size=0,cnt=-1; while(x!=e) { size=q.size(); if(!size) { cout<<-1; return 0; }

}
cout<<cnt;

}

{{ vote && vote.total.up }}