Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define INF 1 << 30
  6. #define mp make_pair
  7. #define pb push_back
  8. #define ii pair<int,int>
  9. #define OK cout<<"OK"<<endl
  10. #define debug(x) cout << #x " = " << (x) << endl
  11. #define ff first
  12. #define ss second
  13. #define int long long
  14.  
  15. int adj[6][256];   
  16. signed main () {
  17.    
  18.     ios_base::sync_with_stdio(false);
  19.     cin.tie(NULL);
  20.  
  21.     for(int i = 0; i < 6; i++)
  22.         adj[i]['z'] = 1;
  23.  
  24.     int arr[] = {'#', 'e', 'l', 'd', 'a'};
  25.  
  26.     for(int i = 1; i < 5; i++) {
  27.         adj[i][arr[i]] = i+1;
  28.     }
  29.  
  30.     string x;
  31.  
  32.     cin >> x;
  33.  
  34.     for(char &c: x) {
  35.         c = tolower(c);
  36.     }
  37.  
  38.     int state = 0;
  39.  
  40.     for(int i = 0; i < x.size(); i++) {
  41.         state = adj[state][x[i]];
  42.         if(state == 5) {
  43.             cout << "Link Bolado" << endl;
  44.             return 0;
  45.         }
  46.     }
  47.  
  48.     cout << "Link Tranquilo" << endl;
  49.  
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement