結果

問題 No.2268 NGワード回避
ユーザー Nzt3Nzt3
提出日時 2023-04-14 21:32:03
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 2,194 ms
コンパイル使用メモリ 202,116 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-10 12:15:29
合計ジャッジ時間 4,236 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

#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';
}
0