View Code of Problem 135

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	char ch;
	while(cin>>n){
		getchar();
		int x=0,y=0;
		for(int i=0;i<n;++i){
			scanf("%c%d",&ch,&m);
			if(ch=='L')x-=m;
			else if(ch=='R')x+=m;
			else if(ch=='F')y+=m;
			else if(ch=='B')y-=m;
			getchar();
		}
		int x1,y1;
		cin>>x1>>y1;
		if(x1==x&&y1==y)
		cout<<"MEME IS SO LUCKY"<<endl;
		else
		cout<<"GPS ERROR"<<endl;
	}
}

Double click to view unformatted code.


Back to problem 135