forked from SaruarChy/Codeforces-Solution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1200 A. Hotelier.cpp
43 lines (41 loc) · 963 Bytes
/
1200 A. Hotelier.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
using namespace std;
int main()
{
fastread();
ll n,a[11];
string s;
cin>>n>>s;
fill(a,a+11,0);
for(int i=0; i<n; i++){
if(s[i] == 'L'){
for(int j=0; j<n; j++){
if(a[j] != 1){
a[j] = 1;
break;
}
}
}
else if(s[i] == 'R'){
for(int j=9; j>=0; j--){
if(a[j] != 1){
a[j] = 1;
break;
}
}
}
else{
a[s[i] - '0'] = 0;
}
}
for(int i=0; i<=9; i++){
cout<<a[i];
}
cout<<endl;
return 0;
}