Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. typedef long double ld;
  5. #define X first
  6. #define Y second
  7. #define pb push_back
  8.  
  9. ll ind = 1, t, lastind = 1;
  10.  
  11. int main() {
  12. ios_base::sync_with_stdio(0), cin.tie(0);
  13. cin >> t;
  14. if (t == 0) cout << "S" << endl;
  15. while(1) {
  16. cout << "R" << endl;
  17. while(cin >> t) {
  18. ++ind;
  19. if (t == 1) {
  20. lastind = ind;
  21. cout << "S" << endl;
  22. break;
  23. }
  24. cout << "R" << endl;
  25. }
  26. while(ind > 1) {
  27. cout << "L" << endl;
  28. cin >> t;
  29. --ind;
  30. }
  31. if (t == 0) {
  32. cout << lastind - 1 << endl;
  33. return 0;
  34. }
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement