結果
問題 | No.2201 p@$$w0rd |
ユーザー |
![]() |
提出日時 | 2023-03-10 15:36:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 883 bytes |
コンパイル時間 | 86 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-18 03:19:42 |
合計ジャッジ時間 | 1,667 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
def judge_pass(password: str): i = 0 j = 0 k = 0 for l in range(len(password)): if password[l].isdecimal(): i = i + 1 elif password[l].isalpha(): j = j + 1 else: k = k + 1 if i > 0 and j > 0 and k > 0: return 1 else: return -1 def replace(chara: str): 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"] password = input() pass_num = 0 pass_l = [password] counter = 0 for i in range(len(password)): if password[i] in chara_l: for j in range(len(pass_l)): temp_password = pass_l[j] temp_password = temp_password[0:i] + replace(temp_password[i]) + temp_password[i+1:len(password)] pass_l.append(temp_password) for i in range(len(pass_l)): if judge_pass(pass_l[i]) == 1: counter = counter + 1 print(counter)