Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef long double ld;
- #define X first
- #define Y second
- #define pb push_back
- ll ind = 1, t, lastind = 1;
- int main() {
- ios_base::sync_with_stdio(0), cin.tie(0);
- cin >> t;
- if (t == 0) cout << "S" << endl;
- while(1) {
- cout << "R" << endl;
- while(cin >> t) {
- ++ind;
- if (t == 1) {
- lastind = ind;
- cout << "S" << endl;
- break;
- }
- cout << "R" << endl;
- }
- while(ind > 1) {
- cout << "L" << endl;
- cin >> t;
- --ind;
- }
- if (t == 0) {
- cout << lastind - 1 << endl;
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement