Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,n,m,d=0,c=1;
- vector<int>v,v1;
- cin>>t;
- for(int i=0;i<t;i++){
- cin>>m;
- v.push_back(m);
- }
- sort(v.begin(),v.end());
- cin>>n;
- for(int j=0;j<t-1;j++){
- if(v[j]==v[j+1])c++;
- else {
- if(c==n){
- cout<<v[j]<<endl;
- d++;
- break;
- }
- c=1;
- }
- }
- if(d==0)cout<<v[0]<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement