代码
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
using namespace std;
map<vector<int>,int>mp;
vector<int>temp;
int main(){
int n, m;
cin >> n >> m;
temp.resize(m);
for(int i = 1; i <= n; i++){
for(int j = 0; j < m; j++) cin >> temp[j];
mp[temp]++;
}
multimap<int,vector<int>,greater<int>>mpp;
int cnt = 0;
for(auto it : mp){
mpp.insert({it.second,it.first});
cnt++;
}
cout << cnt << endl;
for(auto it : mpp){
cout << it.first;
for(int i = 0; i < m;i++)
cout <<" " << it.second[i];
cout << endl;
}
return 0;
}
标签:cnt,temp,int,代码,清点,mp,L2,include
From: https://www.cnblogs.com/index-12/p/17339819.html