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

Ended

Participants:506

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

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 <vector>
#include <string>
#include <set>
#include <algorithm>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<string> V;
    set<string> S;
    for(int i = 0; i < N; i++)
    {
        string temp;
        cin >> temp;
        V.push_back(temp);
        S.insert(temp);
    }
    int count = 0;
    for(int i = 0; i < N; i++)
    {
        reverse(V[i].begin(), V[i].end());
        if(S.find(V[i]) != S.end())
        {
            count++;
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX