結果

問題 No.2201 p@$$w0rd
ユーザー lmxyue
提出日時 2025-08-25 12:56:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,209 bytes
コンパイル時間 4,415 ms
コンパイル使用メモリ 264,176 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-08-25 12:56:34
合計ジャッジ時間 5,224 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001

int main(){
        
        string s;
        cin>>s;
        int n = s.size();
        map<char,char> mp;
        mp['o'] = '0';
        mp['l'] = '1';
        mp['a'] = '@';
        mp['s'] = '$';
        int ans = 0;
        rep(i,1<<n){
                string t = "";
                rep(j,n){
                        if((i>>j)&1){
                                t += s[j];
                        }
                        else{
                                if(!mp.count(s[j]))break;
                                t += mp[s[j]];
                        }
                }
                if(t.size()!=n)continue;
                set<int> ss;
                rep(j,n){
                        if(isdigit(t[j]))ss.insert(0);
                        else if(islower(t[j]))ss.insert(1);
                        else ss.insert(2);
                }
                if(ss.size()==3)ans++;
        }
        cout<<ans<<endl;
        
        return 0;
}
0