当前位置:Gxlcms > 数据库问题 > Codeforces 755B:PolandBall and Game(map+思维)

Codeforces 755B:PolandBall and Game(map+思维)

时间:2021-07-01 10:21:17 帮助过:24人阅读

#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+思维)

标签:map   main   stack   targe   code   str   name   algorithm   algo   

人气教程排行