結果
問題 |
No.2268 NGワード回避
|
ユーザー |
|
提出日時 | 2023-04-14 21:59:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 623 bytes |
コンパイル時間 | 2,031 ms |
コンパイル使用メモリ | 199,036 KB |
最終ジャッジ日時 | 2025-02-12 06:40:23 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 52 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; // typedef unsigned long long ull; // const ll INF = numeric_limits<ll>::max() / 4; // const int INF = numeric_limits<int>::max() / 4; // cout << std::fixed << std::setprecision(15); int main() { int N; cin >> N; set<string> S; for(int i = 0; i < N; i++){ string s; cin >> s; S.insert(s); } string r = *S.begin(); for(int i = 0; i < N; i++){ if(S.empty()) break; string s = *S.begin(); if(s[i] == 'a') r[i] = 'b'; else r[i] = 'a'; while(!S.empty() && S.begin()->at(i) == s[i]) S.erase(S.begin()); } cout << r << endl; return 0; }