What is wrong with this code , it is going easy with maps

#include <bits/stdc++.h>

#define ll long long

vectorv;

using namespace std;

int main()

{

ll int t;

cin >> t;

for (int i = 0; i < t; i++)

{

    ll int n, q;

    cin >> n >> q;

    unsigned ll int a[n];

    for (int i = 0; i < n; i++)

    {

        cin >> a[i];

        v[a[i]]++;

    }

    for (int j = 0; j < q; j++)

    {

        ll int k;

        cin >> k;

        cout << v[k] << endl;

    }cout<<endl;

}

}

Please format your code - the forum software has mangled it and it won’t compile! :slight_smile:

2 Likes

thanks buddy but I think this trick doesn’t work on hackerearth :slightly_smiling_face: