0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 01:38:48 +00:00
OI-codes/Luogu/P1200/P1200.cpp

29 lines
525 B
C++
Raw Normal View History

#include <bits/stdc++.h>
using namespace std;
int main() {
int us = 1, zs = 1;
string a, b;
getline(cin, a);
getline(cin, b);
for (int i = 0; i < 7; i++) {
2021-11-19 09:01:13 +00:00
if (a[i] <= 0)
break;
else
us *= a[i] - 64;
}
for (int i = 0; i < 7; i++) {
2021-11-19 09:01:13 +00:00
if (b[i] <= 0)
break;
else
zs *= b[i] - '@';
}
us %= 47;
zs %= 47;
2021-11-19 09:01:13 +00:00
if (us == zs)
cout << "GO" << endl;
else
cout << "STAY" << endl;
return 0;
}