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

Ended

Participants:506

Verdict:Accepted
Score:100 / 100
Submitted:2016-08-28 12:16:26

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 "stdio.h"
#include <vector>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
int Len = 0;
int main(){
   // freopen("C:\\Users\\Zhoulu\\Desktop\\in.txt", "r", stdin);
    //freopen("C:\\Users\\Zhoulu\\Desktop\\out.txt", "w", stdout);
    // ios_base::sync_with_stdio(0);
    int N = 0;
    cin >> N;
    vector<string> vec;
    map<string, int>m;
    int res = 0;
    for (int i = 0; i != N; i++)
    {
        string s;
        cin >> s;
        string sr(s.rbegin(), s.rend());
        if (m.find(s) != m.end())
        {
            res++;
        }
        else{
            m[sr] = 1;
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX