Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<iostream>
- #include<cmath>
- #include<iomanip>
- #include<algorithm>
- #include<cstdlib>
- #include<cstring>
- #include<vector>
- #include<utility>
- using namespace std;
- #define ll long long
- #define nl '\n'
- #define sz(x) int(x.size())
- #define all(x) x.begin(),x.end()
- #define rall(s) s.rbegin(), s.rend()
- #define getline(s) getline(cin>>ws,s)
- #define ceill(n, m) (((n) / (m)) + ((n) % (m) ? 1 : 0))
- #define pi 3.141592653589793
- /*
- ███╗░░██╗███████╗░██████╗░███╗░░░███╗
- ████╗░██║██╔════╝██╔════╝░████╗░████║
- ██╔██╗██║█████╗░░██║░░██╗░██╔████╔██║
- ██║╚████║██╔══╝░░██║░░╚██╗██║╚██╔╝██║
- ██║░╚███║███████╗╚██████╔╝██║░╚═╝░██║
- ╚═╝░░╚══╝╚══════╝░╚═════╝░╚═╝░░░░░╚═╝
- */
- void Fast_IO(){
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- freopen("files.in", "r", stdin);
- // #ifndef ONLINE_JUDGE
- // freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- // #endif
- }
- void solve(){
- ll n,id; cin>>n;
- string s;
- map<string,set<ll>>mp;
- while(n--){
- cin>>s>>id;
- mp[s].emplace(id);
- }
- for(auto &x:mp){
- cout<<*x.second.begin()<<' ';
- }
- cout<<nl;
- }
- int main(){
- Fast_IO();
- int t =1;
- cin>>t;
- while(t--){
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement