Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- vector<pair<int,int>> rodendeni(n);
- for(int i=0;i<n;i++)
- {
- int d,m;
- cin>>d>>m;
- rodendeni[i]={m,d};
- }
- sort(rodendeni.begin(),rodendeni.end());
- vector<int> rodendeni_vo_mesec(13,0);
- for(int i=0;i<n;i++)
- {
- if(i==0||rodendeni[i]!=rodendeni[i-1])
- rodendeni_vo_mesec[rodendeni[i].first]++;
- }
- int max_rodendeni=-1;
- for(int i=1;i<=12;i++)
- {
- if(rodendeni_vo_mesec[i]>max_rodendeni)
- max_rodendeni=rodendeni_vo_mesec[i];
- }
- for(int i=1;i<=12;i++)
- {
- if(rodendeni_vo_mesec[i]==max_rodendeni)
- cout<<i<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment