結果
| 問題 | No.2715 Unique Chimatagram | 
| コンテスト | |
| ユーザー |  mint | 
| 提出日時 | 2024-04-06 00:39:17 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 17 ms / 2,000 ms | 
| コード長 | 556 bytes | 
| コンパイル時間 | 2,535 ms | 
| コンパイル使用メモリ | 204,360 KB | 
| 最終ジャッジ日時 | 2025-02-20 22:17:08 | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 40 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    map<string, int> m;
    string abc = "abcdefghijklmnopqrstuvwxyz";
    while(n--){
        string s; cin >> s;
        for(int i = 0; i < 26; i++){
            string ss = s + abc[i];
            sort(ss.begin(), ss.end());
            m[ss]++;
        }
    }
    for(auto e : m){
        if(e.second == 1){
            cout << e.first << '\n';
            return 0;
        }
    }
    cout << -1 << '\n';
    return 0;
}
            
            
            
        