#include <bits/stdc++.h>
using namespace std;
bool canWin(int n, int m, bool isMaxPlayer) {
if (n == 0 && m == 0) {
return false;
}
for (int i = 1; i <= n; ++i) {
if (!canWin(n - i, m, !isMaxPlayer)) {
return true;
}
}
for (int i = 1; i <= m; ++i) {
if (!canWin(n, m - i, !isMaxPlayer)) {
return true;
}
}
return false;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
while (cin >> n >> m) {
bool isMaxPlayer = true;
bool canFirstPlayerWin = canWin(n, m, isMaxPlayer);
if (canFirstPlayerWin) {
cout << ">\\\\\\<" << '\n';
} else {
cout << "= =\"" << '\n';
}
}
}
#include
using namespace std;
bool canWin(int n, int m, bool isMaxPlayer) {
if (n == 0 && m == 0) {
return false;
}
for (int i = 1; i <= n; ++i) {
if (!canWin(n - i, m, !isMaxPlayer)) {
return true;
}
}
for (int i = 1; i <= m; ++i) {
if (!canWin(n, m - i, !isMaxPlayer)) {
return true;
}
}return false;
}int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
while (cin >> n >> m) {
bool isMaxPlayer = true;
bool canFirstPlayerWin = canWin(n, m, isMaxPlayer);if (canFirstPlayerWin) {
cout << ">\\\\\\<" << '\n';
} else {
cout << "= =\"" << '\n';
}
}
}
想不到怎麼剪枝了