結果

問題 No.2268 NGワード回避
ユーザー gew1fw
提出日時 2025-06-12 14:17:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,900 KB
実行使用メモリ 76,992 KB
最終ジャッジ日時 2025-06-12 14:18:05
合計ジャッジ時間 4,707 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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