Codeforces 755B???PolandBall and Game???map+?????????

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces 755B???PolandBall and Game???map+?????????相关的知识,希望对你有一定的参考价值。

?????????map   main   stack   targe   code   str   name   algorithm   algo   

http://codeforces.com/problemset/problem/755/B

?????????A????????????n???????????????B????????????m????????????????????????????????????????????????????????????????????????????????????A?????????????????????????????????????????????

????????????map??????A???B????????????????????????????????????A?????????????????????B?????????????????????????????????????????????cnt / 2?????????????????????A????????????????????????????????????????????????????????????n<=m???A????????????A??????????????????????????????A?????????B??????????????????A?????????

 1 #include <cstdio>
 2 #include <cstring>
 3 #include <cmath>
 4 #include <cstdlib>
 5 #include <algorithm>
 6 #include <string>
 7 #include <iostream>
 8 #include <stack>
 9 #include <map>
10 #include <queue>
11 #include <set>
12 using namespace std;
13 typedef long long LL;
14 #define N 100010
15 #define INF 0x3f3f3f3f
16 string s1[1010];
17 string s2[1010];
18 map<string, int> mp;
19 
20 int main()
21 {
22     int n,m;
23     cin >> n >> m;
24     for(int i = 1; i <= n; i++) cin >> s1[i];
25     for(int i = 1; i <= m; i++) cin >> s2[i];
26     int f = 0;
27     for(int i = 1; i <= n; i++) mp[s1[i]] = 1;
28     for(int i = 1; i <= m; i++) if(mp[s2[i]]) f++;
29     n -= (f / 2); m -= (f - f / 2);
30     if(n > m) puts("YES");
31     else puts("NO");
32     return 0;
33 }

 

以上是关于Codeforces 755B???PolandBall and Game???map+?????????的主要内容,如果未能解决你的问题,请参考以下文章

codeforce 755 B

Codeforces 755D(思维+线段树)

CodeForces755F PolandBall and Gifts

Codeforces 755C:PolandBall and Forest(并查集)

Codeforces Round #755 Div. 2 ABCD

CodeForces755F 贪心 + 多重背包二进制优化