forked from MukulCode/CodingClubIndia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeforces_WordGame.cpp
More file actions
42 lines (37 loc) · 942 Bytes
/
Codeforces_WordGame.cpp
File metadata and controls
42 lines (37 loc) · 942 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
// https://codeforces.com/contest/1722/problem/C
#include <bits/stdc++.h>
#include <map>
#include <iterator>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
map<string,int>mp;
vector<vector<string>>v;
// vector of vector
for(int i=0;i<3;i++){
vector <string> s;
for(int j=0;j<n;j++){
string ss;
cin>>ss;
mp[ss]++;
s.push_back(ss);
}
v.push_back(s);
}
vector<int>v1(3,0);
for(int i=0;i<3;i++){
for(int j=0;j<n;j++){
if(mp[v[i][j]]==1) v1[i]=v1[i]+3;
else if(mp[v[i][j]]==2) v1[i]=v1[i]+1;
}
}
for(int i=0;i<3;i++){
cout<<v1[i]<<" ";
}
cout<<endl;
}
}