xT30x

Untitled

Oct 13th, 2022
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll=long long;
  5.  
  6. int main()
  7. {
  8.     string x;
  9.     cin>>x;
  10.     string t;
  11.     cin>>t;
  12.     int p=10;
  13.     for(auto cl:t)
  14.     {
  15.         bool w=false;
  16.         while(x.find(cl)!=string::npos)
  17.         {
  18.             x.erase(x.begin()+x.find(cl));
  19.             w=true;
  20.         }
  21.         if(w==false){
  22.             p--;
  23.         }
  24.         if(x.size()==0)
  25.         {
  26.             cout<<"WIN";
  27.             return 0;
  28.         }
  29.         if(p==0)
  30.         {
  31.             cout<<"LOSE";
  32.             return 0;
  33.         }
  34.     }
  35.     cout<<"LOSE";
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment