题目描述
blablabla
样例
#include<iostream>
using namespace std;
const int N=1010;
string name[N],pwd[N];
int m=0;
string change(string s)
{
string str;
for(auto c:s)
{
if(c == '1') str+='@';
else if(c == '0') str+='%';
else if(c == 'l') str+='L';
else if(c == 'O') str+='o';
else str+=c;
}
return str;
}
int main()
{
int n;
cin>>n;
string cur_id,cur_pwd;
string change_pwd;
for(int i=0;i < n;i++)
{
cin>>cur_id>>cur_pwd;
change_pwd=change(cur_pwd);
//cout<<change_pwd<<" "<<"111";
if(change_pwd != cur_pwd)
{
name[m]=cur_id;
pwd[m]=change_pwd;
m++;
}
}
if(m == 0)
{
if(n != 1) printf("There are %d accounts and no account is modified\n",n);
else printf("There is 1 account and no account is modified");
}
else
{
cout<<m<<endl;
for(int i=0;i < m;i++)
{
cout<<name[i]<<" "<<pwd[i]<<endl;
}
}
return 0;
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla