#include<iostream> #include<string> #include<cctype> using namespace std; int main() { int a; while(cin>>a) { cin.get(); int l=0,r=0,f=0,b=0,i,j; string c; for(int k=0;k<a;k++) { getline(cin,c); if(c[0]=='L')l=l+c[1]-'0'; else if(c[0]=='F')f=f+c[1]-'0'; else if(c[0]=='R')r=r+c[1]-'0'; else if(c[0]=='B')b=b+c[1]-'0'; } cin>>i>>j; if(i==r-l&&j==f-b)cout<<"MEME IS SO LUCKY"<<endl; else cout<<"GPS ERROR"<<endl; } } |
Double click to view unformatted code.