結果
| 問題 | 
                            No.2268 NGワード回避
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-04-14 21:32:03 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 462 bytes | 
| コンパイル時間 | 1,658 ms | 
| コンパイル使用メモリ | 195,940 KB | 
| 最終ジャッジ日時 | 2025-02-12 06:22:42 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 52 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin>>N;
  vector<string>A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  string ans="";
  for(int i=0;i<N;i++){
    ans.push_back('a');
  }
  for(int i=0;i<N;i++){
    bool ok=true;
    for(int j=0;j<N;j++){
      if(A[j]==ans)ok=false;
    }
    if(ok){
      cout<<ans<<'\n';
      return 0;
    }
    ans[i]='b';
  }
  cout<<ans<<'\n';
}