結果
問題 |
No.2715 Unique Chimatagram
|
ユーザー |
![]() |
提出日時 | 2024-04-05 23:15:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 596 bytes |
コンパイル時間 | 1,886 ms |
コンパイル使用メモリ | 178,788 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 03:04:10 |
合計ジャッジ時間 | 4,042 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 WA * 6 |
ソースコード
#include<bits/stdc++.h> using namespace std; string S[1010],G[1010]; map<string,int>mp; int main(){ int t; string v; cin>>t; for(int i=0;i<t;i++){ cin>>S[i]; G[i]=S[i]; sort(G[i].begin(),G[i].end()); mp[G[i]]++; } for(int i=0;i<t;i++){ if(mp[G[i]]>1) continue; for(int j=0;j<1;j++){ char ch=j+'a'; string w=G[i]; w.push_back(ch); sort(w.begin(),w.end()); if(mp[w]==0){ G[i].push_back(ch); cout<<G[i]; return 0; } } } cout<<-1; }