题目描述
blablabla
样例
blablabla
算法1
#include <iostream>
using namespace std;
int main()
{
int n, x, y;
string a, b, c[] = {"Hunter", "Bear", "Gun"};
cin >> n;
while(n--)
{
cin >> a >> b;
for(int i = 0; i < 3; i++)
{
if(a == c[i]) x = i;
if(b == c[i]) y = i;
}
if(x == y) cout << "Tie" << endl;
else if(x-y == 1 || y-x == 2) cout << "Player1" << endl;
else if(y-x == 1 || x-y == 2) cout << "Player2" << endl;
}
return 0;
}
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
blablabla hhh