Advertisement
hasib_mo

Untitled

Jul 4th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.47 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<cstdlib>
  5. #include<cmath>
  6.  
  7. #include<algorithm>
  8. #include<vector>
  9. #include<queue>
  10. #include<stack>
  11. #include<map>
  12. #include<utility>
  13. #include<set>
  14.  
  15.  
  16. #define FOR(i, s, e) for(int i=s; i<e; i++)
  17. #define loop(i, n) FOR(i, 0, n)
  18. #define sf scanf
  19. #define pf printf
  20. #define pb push_back
  21. #define MP make_pair
  22. #define fr first
  23. #define sc second
  24. #define ll long long
  25. #define dd double
  26. #define all(v) v.begin(), v.end()
  27. #define PI acos(-1.0)
  28. #define mem(ara, value) memset(ara, value, sizeof(ara))
  29. #define paii pair<int, int>
  30. #define pall pair<ll, ll>
  31. #define SZ(a) int(a.size())
  32. #define read(nm) freopen(nm, "r", stdin)
  33. #define write(nm) freopen(nm, "w", stdout)
  34. #define dump(x) cout<<#x<<" = "<<x<<endl
  35.  
  36. using namespace std;
  37.  
  38. #define take(args...) asdf,args
  39. #define debug(args...) asdfg,args; cout<<endl
  40. struct ASDF{
  41.     ASDF& operator,(int &a) {
  42.         sf("%d", &a);
  43.         return *this;
  44.     }
  45.     ASDF& operator,(long int &a){
  46.         sf("%ld", &a);
  47.         return *this;
  48.     }
  49.     ASDF& operator,(long long int &a){
  50.         sf("%lld", &a);
  51.         return *this;
  52.     }
  53.     ASDF& operator,(char &c){
  54.         sf("%c", &c);
  55.         return *this;
  56.     }
  57.     ASDF& operator,(double &d){
  58.         sf("%lf", &d);
  59.         return *this;
  60.     }
  61.  
  62.     template<typename T>
  63.     ASDF& operator,(T &a){
  64.         cin>>a;
  65.         return *this;
  66.     }
  67. }asdf;
  68. struct ASDFG{
  69.     template<typename T>
  70.     ASDFG& operator,(vector<T> &v){
  71.         pf("[");
  72.         cout<<v[0];
  73.         FOR(i, 1, SZ(v)){
  74.             cout<<", "<<v[i];
  75.         }
  76.         pf("]");
  77.         return *this;
  78.     }
  79.  
  80.     template<typename T>
  81.     ASDFG& operator,(T x) {
  82.         cout<<x<<" ";
  83.         return *this;
  84.     }
  85.  
  86.  
  87. }asdfg;
  88.  
  89.  
  90.  
  91. //Header ends here
  92.  
  93. int main()
  94. {
  95.     paii lastPos;
  96.     string str;
  97.  
  98.     take(lastPos.fr, lastPos.sc, str);
  99.  
  100.     paii currentPos;
  101.     currentPos.fr = 0;
  102.     currentPos.sc = 0;
  103.  
  104.     vector<paii>allPos;
  105.     allPos.pb(currentPos);
  106.     loop(i, SZ(str))
  107.     {
  108.         switch(str[i])
  109.         {
  110.             case 'U':
  111.                 currentPos.sc++;
  112.             case 'D':
  113.                 currentPos.sc--;
  114.             case 'L':
  115.                 currentPos.fr--;
  116.             case 'R':
  117.                 currentPos.fr++;
  118.         }
  119.        
  120.         allPos.pb(currentPos);
  121.     }
  122.    
  123.    
  124.     bool ifPossible = false;
  125.    
  126.     loop(i, SZ(allPos))
  127.     {
  128.        
  129.     }
  130.  
  131.  
  132.  
  133.     return 0;
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement