#include<iostream> #include<cstring> #include<cstdio> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int x=0, y=0; long long int n; while (cin >> n) { char z; int d; while (n--) { cin >> z >> d; if (z == 'L') { x -= d; } else if (z == 'R') { x += d; } else if (z == 'F') { y += d; } else if (z == 'B') { y -= d; } } long long int a, b; cin >> a >> b; if (x == a && y == b) { cout << "MEME IS SO LUCKY" << endl; } else { cout << "GPS ERROR" << endl; } } return 0; } |
Double click to view unformatted code.