-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1200A.cpp
More file actions
61 lines (58 loc) · 1.6 KB
/
1200A.cpp
File metadata and controls
61 lines (58 loc) · 1.6 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define int long long
#define mod 1000000007
#define maxN 1000001
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pip pair<int,pii>
#define vi vector<int>
#define vpi vector<pii >
#define endl
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define FOR(a,b,c) for(int(a) = b;a<=c;a++)
#define repr(a,b,c) for(int(a) = b;a>=c;a--)
#define rep(i,n) for(int(i) = 0;i<n;i++)
#define fir first
#define sec second
#define beg begin()
#define e end()
#define len length()
using namespace std;
//using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f3f3f3f3fll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
main(){
fastIO;
int n;
cin>>n;
string s;
cin>>s;
int rooms[10];
memset(rooms,0,sizeof(rooms));
rep(i,n){
if(s[i]=='L'){
rep(j,n){
if(rooms[j])
continue;
rooms[j]=1;
break;
}
}
else if(s[i]=='R'){
repr(j,9,0){
if(rooms[j])
continue;
rooms[j]=1;
break;
}
}
else{
rooms[s[i]-'0']=0;
}
}
rep(i,10)cout<<rooms[i];
}