A. Hotelier 题意:一家有10间房间的旅馆(10个房间排成一排),在旅馆的左右两端都有一个办理入住的前台,L代表在左端办理入住,R代表在右端办理入住,顾客都会挑选距离最近的空房间入住,数字 i 表示房间号为 i 的顾客退房,问最后房间的入住情况 题解:用set保存每个空房间的房间号(房间号从0开始),然后每次对set的两端进行操作 #include<iostream> #include<string.h> #include<string> #…
门面,系统,客户端~ from django.test import TestCase class Hotelier: def __init__(self): print('Arranging the Hotel for Marriage? ---') def _is_available(self): print('Is the Hotel free for the event on given dat?') return True def book_hotel(self): if self._…
Codeforces Round #578 (Div. 2) 传送门 A. Hotelier 暴力即可. Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int n; char s[N]; int res[10]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n;…
codeforces #578(Div.2) A. Hotelier Amugae has a hotel consisting of 1010 rooms. The rooms are numbered from 00 to 99 from left to right. The hotel has two entrances - one from the left end, and another from the right end. When a customer arrives to t…
Problem A Hotelier 直接模拟即可~~ 复杂度是$O(10 \times n)$ # include<bits/stdc++.h> using namespace std; ; char s[N]; ]; int main() { int n; scanf("%d",&n); scanf("%s",s); ;i<n;i++) { if (s[i]=='L') { ;j<=;j++) if (!a[j]) { a[j]=…