Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ID: fahadpa1
- TASK: ride
- LANG: C++14
- */
- #include <bits/stdc++.h>
- using namespace std;
- //
- #define ll long long
- #define ull unsigned long long
- #define mx 100010
- #define mod 1000000007
- #define inf INT_MAX
- #define pi acos(-1)
- #define endl '\n'
- #define pb push_back
- #define Fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
- //
- int main() {
- ofstream cout ("ride.out");
- ifstream cin ("ride.in");
- string str, str1;
- cin >> str >> str1;
- int x = 1, y = 1;
- for (int i = 0; i < str.length(); i++) {
- x = ((x % 47) * ((str[i] - 'A' + 1) % 47)) % 47;
- }
- for (int i = 0; i < str1.length(); i++) {
- y = ((y % 47) * ((str1[i] - 'A' + 1) % 47)) % 47;
- }
- if (x == y) cout << "GO" << endl;
- else cout << "STAY" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement