結果

問題 No.2201 p@$$w0rd
ユーザー MAHAYANAMAHAYANA
提出日時 2023-11-04 17:05:00
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 968 bytes
コンパイル時間 3,251 ms
コンパイル使用メモリ 251,972 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-11-04 17:05:05
合計ジャッジ時間 5,057 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 2 ms
4,372 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 2 ms
4,372 KB
testcase_09 AC 2 ms
4,372 KB
testcase_10 AC 2 ms
4,372 KB
testcase_11 AC 2 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 2 ms
4,372 KB
testcase_14 AC 2 ms
4,372 KB
testcase_15 AC 2 ms
4,372 KB
testcase_16 AC 2 ms
4,372 KB
testcase_17 AC 2 ms
4,372 KB
testcase_18 AC 2 ms
4,372 KB
testcase_19 AC 2 ms
4,372 KB
testcase_20 AC 2 ms
4,372 KB
testcase_21 AC 2 ms
4,372 KB
testcase_22 AC 2 ms
4,372 KB
testcase_23 AC 2 ms
4,372 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'char change(char)':
main.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repl(i,m,n) for(ll i=m; i<n; ++i)

bool can_change(char c){
    return c == 'l' || c == 'o' || c == 'a' || c == 's';
}

char change(char c){
    if(c == 'l') return '1';
    else if(c == 'o') return '0';
    else if(c == 'a') return '@';
    else if(c == 's') return '$';
}

bool check(string &s){
    bool f1 = false, f2 = false, f3 = false;
    for(char &c : s){
        if('a' <= c && c <= 'z') f1 = true;
        if('0' <= c && c <= '9') f2 = true;
        if(c == '@' || c == '$') f3 = true;
    }
    return f1 & f2 & f3;
}

int main(){
    string S;
    cin >> S;

    set<string> st;
    rep(bit, 0, 1<<8){
        string T = S;
        rep(i, 0, 8){
            if(!can_change(T[i])) continue;
            if(bit & 1 << i) T[i] = change(T[i]);
        }
        if(check(T)) st.insert(T);
    }
    cout << st.size() << endl;

    return 0;
}
0