[Offer收割]编程练习赛7 register

Ended

Participants:506

Verdict:Accepted
Score:100 / 100
Submitted:2016-08-28 12:19:07

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <sstream>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main(){
         int n;
         while(cin>>n){
             string *s=new string[n];
             unordered_map<string,bool> mp;
             int size=0;
             for(int i=0;i<n;i++){
                 cin>>s[i];
                 if(mp.count(s[i])){
                     size++;
                     continue;
                 }
                 reverse(s[i].begin(),s[i].end());
                 mp[s[i]]=true;
             }
             cout<<size<<endl;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX