- #include<bits/stdc++.h>
- using namespace std;
- const int N=110;
- string s,t;
- int main(){
- cin>>s>>t;
- reverse(s.begin(),s.end());//STL
- if(s==t){
- puts("YES");
- }
- else puts("NO");
- return 0;
- }

- #include<bits/stdc++.h>
- using namespace std;
-
- int main(){
- unordered_map <char,int> mp;
- char c;
- while(cin>>c) mp[c]++;
- long long res=0;
- //如果有两个1 组合由第一个1与第一个1 第一个1与第二个1 第二个1与第一个1 第二个1与第二个1
- //规律为每个数个数的平方
- for(int i='a';i<='z';i++) res+=(long long)mp[i]*mp[i];
- for(int i='0';i<='9';i++) res+=(long long )mp[i]*mp[i];
- cout<<res<<endl;
- return 0;
- }
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int N=100010;
- int a[N];
- string s;
- int main(){
- cin>>s;
- for(int i=0;i<s.size();i++) a[s[i]]++;
- LL res=0;
- for(int i=48;i<=128;i++) res+=(LL)a[i]*a[i];
- cout<<res<<endl;
- return 0;
- }