| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 79 | 60 | 59 | 79.730% |
When the UCF Programming Team travels, the coaches would like to get hotel rooms that are close to each other. There is a hotel where rooms are numbered 1 through n and these rooms are in a straight line, i.e., Room 2 is next to Room 1, Room 3 is next to Room 2, and so on. So, it is easier to find large number of available rooms that are close to each other.
Given the room reservations, you are to determine the availability of rooms to accommodate the UCF Programing Team (a large group).
The first input line contains two integers: n (1 ≤ n ≤ 5 ×105), indicating the number of hotel rooms and t (1 ≤ t ≤ 105), indicating the number of transactions. Each of the next t input lines contains a transaction to be processed. There will be two types of transactions:
There is no output required for the room-reservation transactions. For each group-roomavailability transaction, output a separate line providing the total number of available rooms in the requested range.
20 8 A 5 10 R 6 R 9 R 3 A 5 10 R 13 R 18 A 1 20
6 4 15