Advertisement
Saleh127

UVA 847 / GT

Nov 13th, 2022
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. /***
  2.  created: 2022-11-13-21.03.28
  3. ***/
  4.  
  5. #include <bits/stdc++.h>
  6. #include <ext/pb_ds/assoc_container.hpp>
  7. #include <ext/pb_ds/tree_policy.hpp>
  8. using namespace std;
  9. using namespace __gnu_pbds;
  10. template<typename U> using ordered_set=tree<U, null_type,less<U>,rb_tree_tag,tree_order_statistics_node_update>;
  11. #define ll long long
  12. #define all(we) we.begin(),we.end()
  13. #define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
  14. #define nl '\n'
  15.  
  16. int main()
  17. {
  18.     ios_base::sync_with_stdio(0);
  19.     cin.tie(0);
  20.     cout.tie(0);
  21.  
  22.  
  23.     ll n,m,i,j,k,l;
  24.  
  25.     vector<ll>x;
  26.  
  27.     k=9;
  28.     l=0;
  29.  
  30.     while(k<=4294967295)
  31.     {
  32.         x.push_back(k);
  33.         if(l%2) k*=9;
  34.         else k*=2;
  35.  
  36.         l++;
  37.     }
  38.  
  39.     while(cin>>n && n)
  40.     {
  41.         for(i=0;i<x.size();i++)
  42.         {
  43.             if(x[i]>=n)
  44.             {
  45.                 if(i%2==0) cout<<"Stan wins."<<nl;
  46.                 else cout<<"Ollie wins."<<nl;
  47.                 break;
  48.             }
  49.         }
  50.     }
  51.  
  52.     return 0;
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement