結果
| 問題 |
No.2268 NGワード回避
|
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-04-15 00:29:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 845 bytes |
| コンパイル時間 | 4,538 ms |
| コンパイル使用メモリ | 258,496 KB |
| 最終ジャッジ日時 | 2025-02-12 08:31:39 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 52 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=144494;
ll mod=1000000007;
int main(){
ll n;
cin >> n;
map<string,ll>memo;
for (ll i = 0; i < n; i++)
{
string s;
cin >> s;
memo[s]+=1;
}
string s;
for (ll i = 0; i < n; i++)
{
s.push_back('a');
}
vector<ll>two(50,1);
for (ll i = 1; i < 50; i++)
{
two[i]=two[i-1]*2;
}
for (ll i = 0; i >=0; i++)
{
string t=s;
for (ll j = 0; j < 50; j++)
{
if (i&two[j])
{
t[j]='b';
}
}
if (memo[t]==0)
{
cout << t << endl;
return 0;
}
}
}
hiro71687k