結果

問題 No.2201 p@$$w0rd
ユーザー
提出日時 2023-02-03 21:35:05
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,949 bytes
コンパイル時間 3,346 ms
コンパイル使用メモリ 250,372 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 17:08:58
合計ジャッジ時間 4,416 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ull = uint64_t;
using ll = int64_t;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using ld = long double;
using P = pair<ll,ll>;
using G = vector<vector<int>>;

#define LO(...) (void)0
#define debug(x) (void)0

#define reps(i,a,n) for(ll i##_len = (ll)(n), i = (a); i < i##_len; ++i)
#define rep(i,n) reps(i,0,(n))
#define rrep(i,n) reps(i,1,(n)+1)
#define repd(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrepd(i,n) for(ll i=(n);i>=1;i--)

#define inp(i) ll i; cin >> i;
#define inps(s) string s; cin >> s;
#define inpp(p) cin >> (p).first >> (p).second
#define inpv(v,N) vll v(N);rep(i,N)cin>>v[i];
#define inpvs(v,N) vs v(N);rep(i,N)cin>>v[i];
#define all(v) begin(v),end(v)
#define Yes cout<<"Yes\n"
#define No cout<<"No\n"
#define allok(i,N,pred) [&]()->bool{bool allok_=1;rep(i,N)if(!(pred))allok_=0;return allok_;}()
#define anyok(i,N,pred) [&]()->bool{bool anyok_=0;rep(i,N)if(pred)anyok_=1;return anyok_;}()
void YESNO(bool b){cout<<(b?"YES\n":"NO\n");}void yesno(bool b){cout<<(b?"yes\n":"no\n");}void YesNo(bool b){cout<<(b?"Yes\n":"No\n");}

#define SP cout << " "
#define ENDL cout << "\n"
#define setfp cout << fixed << setprecision(16)
template<typename C>void ou(const C&v){cout<<v;}
template<typename C>void ous(const C&v){cout<<v<<" ";}
template<typename C>void oul(const C&v){cout<<v<<"\n";}

template<typename C>void ouv(const C &v){for(auto &&e:v){cout << e;if(&e != &v.back()) cout << ' ';}cout << "\n";}
template<typename C>void ouvadd(const C &v){for(auto &&e:v){cout << e+1;if(&e != &v.back()) cout << ' ';}cout << "\n";}

template<typename T>bool chmax(T &a, const T &b){return a<b?(a=b,1):0;}
template<typename T>bool chmin(T &a, const T &b){return b<a?(a=b,1):0;}

template<typename T>void so(T &a){sort(begin(a),end(a));}
template<typename T,typename C>void so(T &a,C c){sort(begin(a),end(a),c);}
template<typename T>void rso(T &a){sort(rbegin(a),rend(a));}
template<typename T,typename C>void rso(T &a,C c){sort(rbegin(a),rend(a),c);}

constexpr ll INF = 1e18;

int main() {
    inps(S);
    ll ans = 0;
    set<string> se;
    rep(i,1L<<S.size()){
        string t = S;
        rep(j,S.size()){
            if(i>>j&1){
                if(S[j] == 'l'){
                    t[j] = '1';
                }
                if(S[j] == 'o'){
                    t[j] = '0';
                }
                if(S[j] == 'a'){
                    t[j] = '@';
                }
                if(S[j] == 's'){
                    t[j] = '$';
                }
            }
        }
        ll a=0,b=0,c=0;
        rep(j,S.size()){
            if(isalpha(t[j])){
                a++;
            }else if(isdigit(t[j])){
                b++;
            }else{
                c++;
            }
        }
        LO("check: %s : %ld,%ld,%ld\n", t.c_str(), a,b,c);
        if(a&&b&&c){
            se.insert(t);
        }
    }
    oul(se.size());
}
0