結果
| 問題 |
No.2715 Unique Chimatagram
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-05 22:55:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 2,000 ms |
| コード長 | 547 bytes |
| コンパイル時間 | 1,878 ms |
| コンパイル使用メモリ | 177,800 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-01 02:56:35 |
| 合計ジャッジ時間 | 3,846 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
int N;
cin >> N;
map<string,int> m;
REP(i,N){
string s;
cin >> s;
REP(j,26){
string t=s;
t+=char('a'+j);
sort(t.begin(),t.end());
m[t]++;
}
}
for(auto x : m){
string a=x.first;
if(x.second==1){
cout << a << endl;
return 0;
}
}
cout << -1 << endl;
return 0;
}