| DVDs |
| Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB |
| Total submit users: 12, Accepted users: 4 |
| Problem 12935 : No special judgement |
| Problem description |
| DVD Rental shops are disappearing because of online video streaming. However, a very popular series has just been released and the shops are hoping that this series will boost their popularity. This series consists of n DVDs (numbered from
0 to N-1). You own a rental shop and have a specific shelf for this series. There are N slots in this shelf (numbered from 0 to N-1 as well). When you first get this series, you place the DVD number i into the slot number i, obviously. A customer who is a fan of this series will want to rent a sequence of DVDs numbered l to r. Knowing that you have a shelf for this series, the customer will just pick up all DVDs from slot l to r, without checking the actual index of the DVDs. However, there is one crazy customer who comes into your shop just to swap two DVDs in the slots, i.e., this customer takes a DVD from the slot a and exchanges it with the DVD in the slot b. This causes lots of problems for normal customers since normal customer do not check the index of the DVDs. For no reason, this crazy customer comes to your shop quite often and you don't have enough time to chase him away. Your task is to write a program that monitors the activities in this shop and indicates whether a renting customer actually get the DVDs she wants, i.e., the customer actually get the DVDs numbered l to r. Be noted that the DVDs may be in any order, we just want to know if the customer get the DVDs numbered l to r. For example, let us assume that a customer comes to get DVDs from slot 2 to 4 and the slot 2, 3 and 4 have DVDs numbered 4, 2, and 3, respectively, we will say that the customer get what she wants. For simplicity, we will assume that when a customer rents the DVDs, she will immediately watch all of it and place it back into the same slot they are taken. In other words, renting DVDs has no effect on the position of the DVDs at all. |
| Input |
|
First line of input is a number of test cases T ≤ 20. |
| Output |
|
For each renting activity, display a line with a word “YES” when the customer gets what she wants, i.e., when slot a to b have DVDs numbered a to b, and display a word “NO” in any other case. |
| Sample Input |
2 5 8 1 0 4 1 1 2 0 1 3 1 2 2 1 1 3 1 0 0 1 0 2 1 2 4 5 5 0 1 2 0 2 3 0 1 3 1 0 1 1 0 2 |
| Sample Output |
YES YES YES YES YES NO NO YES NO |
| Problem Source |
| 2013 ACM-ICPC Thailand National Programming Contest
|
HUNAN 2014 暑期培训训练赛之十二 F题 (线段树)
最新推荐文章于 2022-01-21 15:54:44 发布
本文深入探讨了游戏开发领域的关键技术和实践,从Unity到CryEngine,涵盖了动画、游戏引擎、AR、VR等前沿技术。同时,文章还涉及了技术美术在游戏开发过程中的重要作用,包括UV贴图、材质设计、3D模型制作等。通过丰富的案例分析,读者可以了解到如何将创意转化为实际的游戏作品。
573

被折叠的 条评论
为什么被折叠?



