結果

問題 No.2201 p@$$w0rd
ユーザー satoyuyapyaasatoyuyapyaa
提出日時 2023-08-11 23:44:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 1,119 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-29 14:58:13
合計ジャッジ時間 1,817 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def is_include_num(s):
    return "1" in s or "0" in s

def is_include_symbol(s):
    return "@" in s or "$" in s

def is_include_alphabet(s):
    flag = False
    for c in "abcdefghijklmnopqrstuvwxyz":
        if c in s:
            flag = True
            break
    return flag


def main():
    s = input()
    temp = []
    counter = 0
    def dfs(i):
        nonlocal counter
        if i == 8:
            ans = "".join(temp)
            #print(ans)
            if is_include_num(ans) and is_include_symbol(ans) and is_include_alphabet(ans):
                counter += 1
            return

        if s[i] == "l":
            temp.append("1")
            dfs(i+1)
            temp.pop()
        if s[i] == "o":
            temp.append("0")
            dfs(i+1)
            temp.pop()
        if s[i] == "a":
            temp.append("@")
            dfs(i+1)
            temp.pop()
        if s[i] == "s":
            temp.append("$")
            dfs(i+1)
            temp.pop()
        temp.append(s[i])
        dfs(i+1)
        temp.pop()
    dfs(0)
    print(counter)



if __name__ == '__main__':
    main()
0