154062025-02-19 12:08:13PKBVetélkedő (75 pont)cpp17Accepted 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;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/01ms316 KiB
2Accepted0/064ms2476 KiB
3Accepted5/51ms500 KiB
4Accepted5/51ms316 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms316 KiB
7Accepted5/52ms316 KiB
8Accepted5/52ms316 KiB
9Accepted5/52ms316 KiB
10Accepted5/532ms1524 KiB
11Accepted5/539ms1456 KiB
12Accepted5/545ms1616 KiB
13Accepted5/552ms1708 KiB
14Accepted5/557ms1708 KiB
15Accepted5/564ms2472 KiB
16Accepted5/563ms2096 KiB
17Accepted5/557ms1960 KiB