For this Question: You are given a grid having N*M elements. Find the index of the row (1-base indexing) which has the maximum sum of elements.
Note: if more than two rows have the same sum of elements, then return the smallest index.The first line of the input contains two integers N and M.
The next N lines each contain M space separated integers.

<b>Constraints:</b>
1 <= N, M <= 10<sup>3</sup>
1 <= A<sub>i, j</sub> <= 10<sup>9Print the index of the row (1-base indexing) which has the maximum sum of elements.Sample Input:
4 3
3 4 2
5 1 7
2 8 1
2 3 3
Sample Output:
2
<b>Explaination:</b>
Row number 2 has sum = 5 + 1 + 7 = 13 which is the maximum among all rows., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    int n, m;
    cin >> n >> m;
    vector<vector<int>> a(n, vector<int> (m));
    vector<int> sum(n);
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cin >> a[i][j];
            sum[i] += a[i][j];
        }
    }
    int mx = 0, ans = 0;
    for(int i = 0; i < n; i++){
        if(mx < sum[i]){
            mx = sum[i];
            ans = i;
        }
    }
    cout << ans + 1;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?