結果
問題 |
No.2201 p@$$w0rd
|
ユーザー |
|
提出日時 | 2023-12-02 14:14:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 920 bytes |
コンパイル時間 | 1,741 ms |
コンパイル使用メモリ | 176,440 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-26 16:35:27 |
合計ジャッジ時間 | 2,628 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#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; }