Please correct this code.This is giving an error which i am unable to understand.Please correct it and notify me what was wrong.The link of my solution is given
You have done many major mistakes
Mistakes
- taking input for vector of vector is completely wrong
correct way is
int x;
for(int i=0;i<k;i++){
vector<int>temp;
for(int j=0;j<n;j++){
cin>>x;
temp.push_back(x);
}
arr.push_back(temp);
}
-
you can’t pass greater to priority queue
because it doesn’t exist greater exist only of premitive data types not for user define data types
for your own classes you have to make comparators -
in main first you have to take k and then N
you can see all the mistakes in modified Code below
if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with
and don’t forgot to mark doubt as resolved