結果

問題 No.2201 p@$$w0rd
ユーザー nyst
提出日時 2023-02-03 21:43:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,454 bytes
コンパイル時間 2,897 ms
コンパイル使用メモリ 182,232 KB
最終ジャッジ日時 2025-02-10 09:00:03
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <map>
#include <cmath>
#include <bitset>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <tuple>
#include <atcoder/all>
#include <sstream> // std::stringstream
#include <regex>
using namespace atcoder;
//using mint = modint998244353;
using mint = modint1000000007;
using namespace std;
using ll = long long;
static const double pi = 3.141592653589793;
const int INF = (1<<29);
const ll mod = 998244353;
bool check(char ch){
return ch=='l' || ch=='o' || ch=='a' || ch=='s';
}
void change(string& s,int i){
if(s[i]=='l') s[i]='1';
else if(s[i]=='o') s[i]='0';
else if(s[i]=='a') s[i]='@';
else if(s[i]=='s') s[i]='$';
}
bool check(string s){
bool ch = false;
bool nu = false;
bool sy = false;
for(auto x:s){
if('0' <= x && x <= '9') nu = true;
else if('a' <= x && x<='z') ch = true;
else if('A' <= x && x<='Z');
else sy = true;
}
return ch && nu && sy;
}
int main() {
string s;cin >> s;
vector<int> index;
for(int i=0;i<s.size();i++){
if(check(s[i])) index.push_back(i);
}
int ans = 0;
for(int bit=0;bit<(1<<index.size());bit++){
int tmp = bit;
auto ss = s;
for(int i=0;i<index.size();i++){
if(tmp%2){
change(ss,index[i]);
}
tmp/=2;
}
if(check(ss)) ans++;
}
cout << ans << endl;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0