For the risk problem in april starters I have written this code, it’s compiling successfully but not giving any output. Can anyone point out why, and also check if my function is correct (although I guess it is). Thanks very much if you spared a moment for this (I’m just a beginner )

#include <bits/stdc++.h>

using namespace std;

vector <vector> a;

int f(int x, int y)

{ int c=1;

`a[x][y] = 0; if(a[x][y+1]==1) {a[x][y+1]=0 ; c += f(x,y+1);} if(a[x+1][y]==1) {a[x+1][y]=0 ; c += f(x+1,y);} return c;`

}

int main() {

`int t; cin>>t; while(t--) { int N,M; cin>>N>>M; for(int i=0;i<N;i++) { for(int j=0;j<M;j++) cin>>a[i][j]; } vector <int> d; int l=0; for(int i=0;i<N;i++) { for(int j=0;j<M;j++) { if(a[i][j]==1) {d[l]=f(i,j);l++;} } } sort(d.begin(),d.end()); int b=0; for(int i=0;i<d.size();i+=2) b+=d[i]; cout<<b; }`

}