Skip to content

Commit 7ea98e7

Browse files
committed
H_hotelier
1 parent d8adc42 commit 7ea98e7

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

Free/H_hotelier.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include <bits/stdc++.h>
2+
#define all(x) x.begin(),x.end()
3+
#define msg(str,str2) cout << str << str2<< endl
4+
using namespace std;
5+
6+
using ll = long long;
7+
using ld = long double;
8+
using uint = unsigned int;
9+
using ull = unsigned long long;
10+
template<typename T>
11+
using pair2 = pair<T, T>;
12+
using pii = pair<int, int>;
13+
using pli = pair<ll, int>;
14+
using pll = pair<ll, ll>;
15+
16+
#define pb push_back
17+
#define mp make_pair
18+
19+
int gcd(int a,int b){
20+
if(a%b==0) return b;
21+
else return gcd(b,a%b);
22+
}
23+
24+
clock_t startTime;
25+
double getCurrentTime() {
26+
return (double)(clock() - startTime) / CLOCKS_PER_SEC;
27+
}
28+
bitset<10> status;
29+
30+
void solve(){
31+
int n;cin>>n;
32+
string s; cin>>s;
33+
for(int e = 0 ; e < n; e++){
34+
if(s[e] == 'L'){
35+
for(int j = 9; j>=0; j--){
36+
if(status[j] == false){
37+
status.set(j,1);
38+
break;
39+
}
40+
}
41+
}else if(s[e] == 'R'){
42+
for(int j = 0 ; j < 10 ; j++){
43+
if(status[j] == false){
44+
status.set(j,1);
45+
break;
46+
}
47+
}
48+
}else{
49+
// cout << 9-(s[e]-'0') << endl;
50+
status.set( 9-(s[e]-'0'),0);
51+
}
52+
}
53+
cout << status << endl;
54+
}
55+
int main(){
56+
ios_base::sync_with_stdio(false);
57+
cin.tie(0);
58+
solve();
59+
// bitset<4> any;
60+
// any.set(3,1);
61+
// cout << any << endl;
62+
return 0;
63+
}

0 commit comments

Comments
 (0)