結果

問題 No.2201 p@$$w0rd
ユーザー hanagehanage
提出日時 2023-12-02 14:14:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 920 bytes
コンパイル時間 1,631 ms
コンパイル使用メモリ 177,136 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 14:14:31
合計ジャッジ時間 2,754 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  string S2, T;
  for (int i = 0; i < 8; i++) {
    if (S[i] == 'l' || S[i] == 'o' || S[i] == 'a' || S[i] == 's') {
      T.push_back(S[i]);
    } else {
      S2.push_back(S[i]);
    }
  }
  int c1 = (int)S2.size();
  map<char, char> mp;
  mp['l'] = '1';
  mp['o'] = '0';
  mp['a'] = '@';
  mp['s'] = '$';
  int ans = 0;
  for (int i = 0; i < (1 << (int)T.size()); i++) {
    string T2;
    for (int j = 0; j < (int)T.size(); j++) {
      if (i & (1 << j)) {
        T2 += T[j];
      } else {
        T2 += mp[T[j]];
      }
    }
    int c2 = 0, c3 = 0, c4 = 0;
    for (auto c : T2) {
      if ('a' <= c && c <= 'z') {
        c2++;
      } else if ('0' <= c && c <= '9') {
        c3++;
      } else {
        c4++;
      }
    }
    if (c1 + c2 > 0 && c3 > 0 && c4 > 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
0