結果
問題 |
No.2201 p@$$w0rd
|
ユーザー |
|
提出日時 | 2023-03-14 16:30:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 955 bytes |
コンパイル時間 | 143 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-18 08:15:42 |
合計ジャッジ時間 | 1,458 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
def judge_pass(s: str): i = 0 j = 0 k = 0 for l in range(len(s)): if s[l].isdecimal(): i += 1 elif s[l].isalpha(): j += 1 else: k += 1 if i > 0 and j > 0 and k > 0: return 1 else: return -1 def replacement(chara): if chara == "l": return "1" elif chara == "o": return "0" elif chara == "a": return "@" elif chara == "s": return "$" else: return chara chara_l = ["l", "o", "a", "s"] s = input() pass_num = 0 pass_l = [s] y= 0 for i in range(len(s)): if s[i] in chara_l: for j in range(len(pass_l)): temp_password = pass_l[j] temp_password = temp_password[0:i] + replacement(temp_password[i]) + temp_password[i+1:len(s)] pass_l.append(temp_password) for i in range(len(pass_l)): if judge_pass(pass_l[i]) == 1: y += 1 print(y)