https://www.spoj.com/problems/AKBAR/

Please tell me the mistake in this
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector
#define vll vector
#define forr(i, n) for(int i = 0; i < n; i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,b) for(int i=1;i<=b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define ms(s, n) memset(s, n, sizeof(s))
#define F first
#define S second
ll po(ll a, ll x,ll m){ if(x==0){return 1;}ll ans=1;ll k=1; while(k<=x) {if(x&k){ans=((ansa)%m);} k<<=1; a=a; a%=m; }return ans; }
map<int,vector>l;
int n;
bool bfs(int src,int power,int d[]){
listq;
q.push_back(src);
bool visited[n+1];
visited[src] = true;
while(!q.empty() && power>0){
int node = q.front();
q.pop_front();
power–;
for(auto i:l[node]){
if(!visited[i]){
q.push_back(i);
d[i]++;
visited[i] = true;
if(d[i]>1)
return true;
}
}
}
return false;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“result.txt”, “w”, stdout);
#endif
int test;
cin>>test;
while(test–){
l.clear();
int t,k;
cin>>n>>t>>k;

while(t–){
int a,b;
cin>>a>>b;
l[a].pb(b);
l[b].pb(a);
}
//int arr[n+1];
int d[n+1]={0};
//memset(a,-1,sizeof(a));
bool res=true;
forr(i,k){
int a,b;
cin>>a>>b;
d[a]++;
if(bfs(a,b,d)){
res = false;
}
if(!res)
break;
}
for(int i=1;i<=n;i++){
if(d[i]!=1)
{res = false;break;}
}
for(int i=1;i<=n;i++)
cout<<d[i]<<" , “;
cout<<”\n";
if(res){
cout<<“Yes”<<"\n";
}else{
cout<<“No”<<"\n";
}
}
return 0;
}