hiho week 182 register

Ended

Participants:171

Verdict:Accepted
Score:100 / 100
Submitted:2017-12-27 09:25:50

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <bits/stdc++.h>
using namespace std;
using psd = pair<string, double>;
int main(void) {
    ios::sync_with_stdio(false);
    set<psd> vis;
    int N;
    cin >> N;
    for (int i = 0; i < N; ++ i) {
        int M;
        cin >> M;
        set<psd> tmp;
        for (int j = 0; j < M; ++ j) {
            string id, date;
            double price;
            cin >> id >> date >> price;
            tmp.insert(psd(id, price));
        }
        if (i == 0) vis = tmp;
        else {
            for (auto &p: vis) if (tmp.find(p) == end(tmp)) vis.erase(p);
        }
    }
    for (auto &p: vis) cout << p.first << endl;
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX