Plz expalin where i am getting wrong

#include
#include
#include
using namespace std;
typedef pair<int,pair<int,int>> custompair;
vector mergeksortedarray(vector<vector> arr)
{
vector result; // hold the result
priority_queue<custompair,vector,greater> pq;
for(int i=0;i<arr.size();i++)
{
pq.push({arr[i][0],{i,0}}); // insert 0th element in pq
custompair curr=pq.top();
int x=curr.second.first;
int y = curr.second.second;
result.push_back(curr.first);// insert element to result vector
if(y+1<arr[x].size())
{
pq.push({arr[x][y+1],{x,y+1}});
}

	}
return result;

}

int main() {
int k,n;
cin>>k>>n;
vector<int,vector> arr={{2,3,4,5},{3,4,5,7},{1,3,6,9}};
/for(int i=0;i<k;i++)
{
for(int j=0;j<n;j++)
{
cin>>arr[i][j];
}
}
/
vector output=mergeksortedarray(arr);
for(auto x:arr)
cout<<x<<" ";
return 0;
}

hi @Mihir163

instead of pasting code here
you can also paste code at


and send the link generated

the mistake that i can see is this
but may be it is due to special effect
so send me link of code

@Mihir163

you have take input for vector of vector in wrong way
correct is:

vector<vector<int>> arr;
    for (int i = 0; i < k; i++)
    {
        std::vector<int> v;
        for (int j = 0; j < n; j++)
        {
            int temp;cin>>temp;
            v.push_back(temp);
        }
        arr.push_back(v);
    }

Modified Code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course

didnt run your code its saying timelimit exceeds plz coreect

@Mihir163 check again my code(Modified Code) is passing all testcase
i have tried again