#include<iostream> using namespace std; int main() { int M, x,y, x0, y0; while(cin>>M) { char s; int a; x0=y0=0; for(int i=0; i<M; i++) { cin>>s>>a; if(s=='L') { x0-=a; }else if(s=='R') { x0+=a; }else if(s=='F') { y0+=a; }else { y0-=a; } } cin>>x>>y; if(x0==x&&y0==y) cout<<"MEME IS SO LUCKY"<<endl; else cout<<"GPS ERROR"<<endl; } } |
Double click to view unformatted code.