結果

問題 No.2268 NGワード回避
ユーザー gew1fw
提出日時 2025-06-12 19:27:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 82,168 KB
実行使用メモリ 77,108 KB
最終ジャッジ日時 2025-06-12 19:27:37
合計ジャッジ時間 5,233 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 51 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ng_words = [input().strip() for _ in range(n)]

result = []
for i in range(n):
    chars = set()
    for word in ng_words:
        chars.add(word[i])
    if len(chars) == 2:
        result.append('a')  # 也可以选择 'b'
    else:
        if 'a' in chars:
            result.append('b')
        else:
            result.append('a')

print(''.join(result))
0