結果

問題 No.2201 p@$$w0rd
ユーザー tombolo1729tombolo1729
提出日時 2023-03-10 15:36:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 883 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 10,040 KB
最終ジャッジ日時 2023-10-18 06:44:38
合計ジャッジ時間 1,902 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,024 KB
testcase_01 AC 28 ms
10,028 KB
testcase_02 AC 28 ms
10,024 KB
testcase_03 AC 28 ms
10,024 KB
testcase_04 AC 29 ms
10,040 KB
testcase_05 AC 28 ms
10,024 KB
testcase_06 AC 30 ms
10,040 KB
testcase_07 AC 28 ms
10,040 KB
testcase_08 AC 28 ms
10,024 KB
testcase_09 AC 29 ms
10,024 KB
testcase_10 AC 29 ms
10,040 KB
testcase_11 AC 29 ms
10,032 KB
testcase_12 AC 31 ms
10,040 KB
testcase_13 AC 29 ms
10,024 KB
testcase_14 AC 29 ms
10,024 KB
testcase_15 AC 30 ms
10,040 KB
testcase_16 AC 30 ms
10,040 KB
testcase_17 AC 30 ms
10,024 KB
testcase_18 AC 29 ms
10,024 KB
testcase_19 AC 28 ms
10,024 KB
testcase_20 AC 29 ms
10,024 KB
testcase_21 AC 28 ms
10,040 KB
testcase_22 AC 29 ms
10,040 KB
testcase_23 AC 28 ms
10,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


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)
0