文章
13
粉丝
120
获赞
1
访问
6.4k
#include <iostream>
#include <map>
#include <vector>
#include <set>
using namespace std;
int main()
{
int m;
cin >> m;
while (m--)
{
int n, t;
cin >> n;
map<int, vector<int>> mp;
set<int> key;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
key.insert(a[i]);
}
for (int i = 0; i < n; i++)
{
cin >> t;
mp[t].push_back(a[i]);
}
for (auto it : mp)
{
map<int, int> count;
cout << it.first << "={";
for (auto i : it.second)
count[i]++;
for (auto i = key.begin(); i != key.end(); i++)
{
if (i != key.begin())
cout << "," << *i << "=" << count[*i];
el...
登录后发布评论
暂无评论,来抢沙发