結果
| 問題 |
No.2715 Unique Chimatagram
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-05 21:30:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| コード長 | 961 bytes |
| コンパイル時間 | 4,221 ms |
| コンパイル使用メモリ | 240,624 KB |
| 実行使用メモリ | 5,632 KB |
| 最終ジャッジ日時 | 2024-10-01 01:44:35 |
| 合計ジャッジ時間 | 5,438 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using vl = vector<long long>;
using vb = vector<bool>;
#define REP(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define PER(i, n, s) for (int i = (int)(n)-1; i >= (int)(s); i--)
#define INT(n) int n;cin>>n;
#define LL(n) long long n;cin>>n;
#define STR(s) string s;cin>>s;
#define VLL(a, n) vector<long long>a(n);for(int i=0;i<(int)(n);i++){cin>>a[i];}
#define VSTR(a, n) vector<string>a(n);for(int i=0;i<(int)(n);i++){cin>>a[i];}
int main()
{
LL(n);
VSTR(s,n);
map<string,ll>mp;
REP(i,0,n)
{
for(char c='a';c<='z';c++)
{
string tmp=s[i]+c;
sort(tmp.begin(),tmp.end());
mp[tmp]++;
}
}
for(auto p:mp)
{
if(p.second==1)
{
cout<<p.first<<endl;
return 0;
}
}
cout<<-1<<endl;
return 0;
}