結果
問題 |
No.2715 Unique Chimatagram
|
ユーザー |
|
提出日時 | 2024-04-05 21:29:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 81 ms / 2,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 4,798 ms |
コンパイル使用メモリ | 260,832 KB |
最終ジャッジ日時 | 2025-02-20 20:51:22 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
#include <bits/stdc++.h> #include <type_traits> using namespace std; #include <atcoder/all> using namespace atcoder; using ll = long long; int n; vector<string> S; void solve(){ map<string, int> mp; for(int i = 0;i<n;i++){ for(int j = 0;j<26;j++){ string t = S[i]; t.push_back('a'+j); sort(t.begin(), t.end()); mp[t]++; } } for(auto &i:mp){ if(i.second==1){ cout<<i.first<<endl; return; } } cout<<-1<<endl; } signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n; S = vector<string>(n); for(auto &i: S) cin >> i; solve(); }