結果
| 問題 |
No.2715 Unique Chimatagram
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-05 23:23:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 431 bytes |
| コンパイル時間 | 2,301 ms |
| コンパイル使用メモリ | 205,980 KB |
| 最終ジャッジ日時 | 2025-02-20 22:04:05 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll n;
cin>>n;
vector<string> s(n);
for(ll i=0;i<n;i++){
cin>>s[i];
}
map<string,ll> mp;
for(ll i=0;i<n;i++){
for(char c='a';c<='z';c++){
string t=s[i]+c;
sort(t.begin(),t.end());
mp[t]++;
}
}
for(auto p:mp){
auto [k,v]=p;
if(v==1){
cout<<k<<endl;
exit(0);
}
}
cout<<-1<<endl;
}