結果
問題 |
No.2715 Unique Chimatagram
|
ユーザー |
![]() |
提出日時 | 2024-04-06 19:35:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 801 bytes |
コンパイル時間 | 1,363 ms |
コンパイル使用メモリ | 123,396 KB |
最終ジャッジ日時 | 2025-02-20 22:37:19 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
#define _USE_MATH_DEFINES #include <iostream> #include <string> #include <algorithm> #include <vector> #include <queue> #include <math.h> #include <cmath> #include <stack> #include <map> #include <set> #include <numeric> #include <iomanip> #include <climits> #include <functional> #include <cassert> #include <tuple> using namespace std; using ll = long long; int N; int main() { cin >> N; map<string, int> mp; for(int i = 0; i < N; ++i) { string s; cin >> s; for(char c = 'a'; c <= 'z'; ++c) { string t = s; t.push_back(c); sort(t.begin(),t.end()); mp[t]++; } } for(auto [s,v] : mp) { if(v == 1) { cout << s << endl; return 0; } } cout << -1 << endl; }