mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 19:08:47 +00:00
Your Ride Is Here
This commit is contained in:
parent
1a72738cb6
commit
3bb7f2693e
36
USACO-Training/1.2/2/2.cpp
Normal file
36
USACO-Training/1.2/2/2.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
ID: baoshuo1
|
||||
PROG: ride
|
||||
LANG: C++
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
freopen("ride.in", "r", stdin);
|
||||
freopen("ride.out", "w", stdout);
|
||||
int us = 1, zs = 1;
|
||||
string a, b;
|
||||
getline(cin, a);
|
||||
getline(cin, b);
|
||||
for (int i = 0; i < 7; i++) {
|
||||
if (a[i] <= 0) break;
|
||||
us *= a[i] - 64;
|
||||
}
|
||||
for (int i = 0; i < 7; i++) {
|
||||
if (b[i] <= 0) break;
|
||||
zs *= b[i] - '@';
|
||||
}
|
||||
us %= 47;
|
||||
zs %= 47;
|
||||
if (us == zs) {
|
||||
cout << "GO" << endl;
|
||||
} else {
|
||||
cout << "STAY" << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user