Skip to content

Commit 71d22ee

Browse files
authored
solution for the commit
0 parents  commit 71d22ee

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

41A.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<iostream>
2+
#include<string>
3+
#include<algorithm>
4+
5+
using namespace std;
6+
7+
int main(){
8+
string s1,s2;
9+
cin>>s1;
10+
cin>>s2;
11+
reverse(s2.begin(),s2.end());
12+
if(s1 == s2){
13+
cout<<"YES"<<endl;
14+
}
15+
else{
16+
cout<<"NO"<<endl;
17+
}
18+
}

4C.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include<iostream>
2+
#include<algorithm>
3+
#include<map>
4+
5+
using namespace std;
6+
7+
8+
string s[100010];
9+
map <string,int> mp;
10+
11+
int main(){
12+
int n;
13+
cin >> n;
14+
for (int i = 0; i < n; i++)
15+
{
16+
cin >> s[i];
17+
if (mp.find(s[i]) == mp.end())
18+
{
19+
printf("OK\n");
20+
mp[s[i]] = 1;
21+
}
22+
else
23+
{
24+
cout << s[i] << mp[s[i]] << endl;
25+
mp[s[i]]++;
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)