#include<bits/stdc++.h> using namespace std; int main(){ int n,x0,y0,x,y,i; while(~scanf("%d",&n)){ x=0,y=0; char c;int s; getchar(); for(int i=0;i<n;i++){ scanf("%c%d",&c,&s); getchar(); if(c=='L'){ x-=s; } else if(c=='R'){ x+=s; } else if(c=='F'){ y+=s; } else if(c=='B'){ y-=s; } } scanf("%d%d",&x0,&y0); if(x==x0&&y==y0) printf("MEME IS SO LUCKY\n"); else printf("GPS ERROR\n"); } return 0; } |
Double click to view unformatted code.