题目链接
https://www.nowcoder.com/acm/contest/85/J
思路
用 MAP 标记 哪一个 打败哪一个 输出的时候 输出对应的 就可以了
AC代码
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <limits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;
int main()
{
map <string, string> m;
map <string, int> vis;
string s1, s2;
for (int i = 0; i < 3; i++)
{
cin >> s1 >> s2;
m[s2] = s1;
vis[s1] = 1;
vis[s2] = 1;
}
int n;
scanf("%d", &n);
while (n--)
{
cin >> s1;
if (vis[s1])
cout << m[s1] << endl;
else
cout << "Fake
";
}
}