View Code of Problem 135

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int t,x0,y0,val;
	char ch;
	while (cin >> t) {
		int x = 0, y = 0;
		while (t--) {
			cin >> ch >> val;
			if (ch == 'L')x -= val;
			else if (ch == 'R')x += val;
			else if (ch == 'F')y += val;
			else y -= val;
		}
		cin >> x0 >> y0;
		if (x == x0 && y == y0)cout << "MEME IS SO LUCKY\n";
		else cout << "GPS ERROR\n";
	}
}

Double click to view unformatted code.


Back to problem 135