結果

問題 No.2201 p@$$w0rd
ユーザー lam6er
提出日時 2025-03-31 17:29:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 821 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 61,032 KB
最終ジャッジ日時 2025-03-31 17:30:21
合計ジャッジ時間 2,079 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

S = input().strip()

# Generate possible replacements for each character
choices = []
for c in S:
    if c == 'l':
        choices.append(['l', '1'])
    elif c == 'o':
        choices.append(['o', '0'])
    elif c == 'a':
        choices.append(['a', '@'])
    elif c == 's':
        choices.append(['s', '$'])
    else:
        choices.append([c])

count = 0

# Iterate over all possible combinations of replacements
for chars in itertools.product(*choices):
    has_lower = False
    has_digit = False
    has_symbol = False
    for c in chars:
        if c.islower():
            has_lower = True
        elif c.isdigit():
            has_digit = True
        else:  # c must be '@' or '$'
            has_symbol = True
    if has_lower and has_digit and has_symbol:
        count += 1

print(count)
0