154062025-02-19 12:08:13PKBVetélkedő (75 pont)cpp17Elfogadva 75/7564ms2476 KiB
#include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n;
    cin >> n;

    unordered_map<string, int> team_count;
    vector<string> team_ids;

    for (int i = 0; i < n; i++) {
        string player_id;
        cin >> player_id;
        string sorted_id = player_id;
        sort(sorted_id.begin(), sorted_id.end());
        team_count[sorted_id]++;
        if (team_count[sorted_id] == 1) {
            team_ids.push_back(sorted_id);
        }
    }

    for (const string &team_id : team_ids) {
        if (team_count[team_id] % 2 == 1) {
            cout << team_id << endl;
            break;
        }
    }

    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base75/75
1Elfogadva0/01ms316 KiB
2Elfogadva0/064ms2476 KiB
3Elfogadva5/51ms500 KiB
4Elfogadva5/51ms316 KiB
5Elfogadva5/51ms316 KiB
6Elfogadva5/51ms316 KiB
7Elfogadva5/52ms316 KiB
8Elfogadva5/52ms316 KiB
9Elfogadva5/52ms316 KiB
10Elfogadva5/532ms1524 KiB
11Elfogadva5/539ms1456 KiB
12Elfogadva5/545ms1616 KiB
13Elfogadva5/552ms1708 KiB
14Elfogadva5/557ms1708 KiB
15Elfogadva5/564ms2472 KiB
16Elfogadva5/563ms2096 KiB
17Elfogadva5/557ms1960 KiB