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