結果
問題 | No.2715 Unique Chimatagram |
ユーザー |
![]() |
提出日時 | 2024-04-06 08:41:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 2,389 ms |
コンパイル使用メモリ | 204,336 KB |
最終ジャッジ日時 | 2025-02-20 22:28:23 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
#include<bits/stdc++.h> using namespace std; int N; map<string,int>cnt; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N; for(;N--;) { string S; cin>>S; for(char c='a';c<='z';c++) { string T=S; T.push_back(c); sort(T.begin(),T.end()); cnt[T]++; } } for(auto[key,val]:cnt)if(val==1) { cout<<key<<endl; return 0; } cout<<"-1"<<endl; }