Any suggestions as how can i reduce time complexity

#include
#include<math.h>
#include
#include
using namespace std;

class dist
{
public:
int x;
int y;
dist(int x,int y)
{
this->x=x;
this->y=y;
}
int dist1()
{
return xx+yy;
}
};

int main() {
int q,k;
cin>>q>>k;
int x[q];
int y[q];
int count1=0;
int i=0;

vector<int> v;
while(i<q)
{
	int n;
	cin>>n;
	if(n==1)
	{
		cin>>x[count1]>>y[count1];
		dist d(x[count1],y[count1]);
		
		
		if(count(v.begin(),v.end(),d.dist1())==0)
		{
        v.push_back(d.dist1());
		
		}
		count1++;
	}
	else if(n==2)
    { 
     sort(v.begin(),v.end());
	 cout<<v[k-1]<<endl;
		  
	}
  i++;

}

return 0;

}


use priority queue this way

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.