-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1200A.c
More file actions
33 lines (33 loc) · 727 Bytes
/
Copy path1200A.c
File metadata and controls
33 lines (33 loc) · 727 Bytes
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
#include<stdio.h>
#include<string.h>
int main(){
int n;
scanf("%d",&n);
char s[n+1];
scanf("%s",&s);
char s1[11]={'0','0','0','0','0','0','0','0','0','0'};
for(int i=0;i<n;i++){
if(s[i]=='L'){
for(int j=0;j<10;j++){
if(s1[j]=='0'){
s1[j]='1';
break;
}
}
}
else if(s[i]=='R'){
for(int j=9;j>=0;j--){
if(s1[j]=='0'){
s1[j]='1';
break;
}
}
}
if(s[i]>='0' && s[i]<='9'){
int x=s[i]-48;
s1[x]='0';
}
}
printf("%s\n",s1);
return 0;
}