結果

問題 No.2715 Unique Chimatagram
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2024-04-05 21:31:18
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 2,367 ms
コンパイル使用メモリ 213,032 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 01:44:39
合計ジャッジ時間 3,915 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
	int N;
	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 + c;
			sort(t.begin(), t.end());
			mp[t] ++;
		}
	}
	for (auto& [k, v] : mp) {
		if (v == 1) {
			cout << k << endl;
			return 0;
		}
	}
	puts("-1");
}
0