| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 2048 MB | 74 | 36 | 31 | 46.269% |
You are browsing a website that lists items for sale. The website has a paging UI that displays a fixed number of items per page, one page at a time.
For example, if there are 55ドル$ items and the page displays exactly 20ドル$ at a time, then there are 3ドル$ pages in total. Items 1ドル$ through 20ドル$ are on page 1ドル,ドル items 21ドル$ through 40ドル$ are on page 2ドル,ドル and items 41ドル$ through 55ドル$ are on page 3ドル$.
You may navigate and select items using these UI elements:
The website has pre-selected some items for you based on its machine learning recommendation algorithm. The recommendation may or may not work for you. You know exactly the items that you want to purchase, which may differ from the pre-selected items. What is the minimum number of checkbox and button clicks required to select exactly the items you actually want?
The first line of input has five integers $n, m$ (1ドル \leq m \leq n \leq 10^3$), $s$ (1ドル \leq s \leq \lceil \frac{n}{m} \rceil$), $p, q$ (0ドル \leq p, q \leq n$), where:
Each of the next $p$ lines contains an integer $i$ (1ドル \le i \le n$). These are the item numbers of the preselected items. These $p$ items are distinct and are listed in increasing order. It is possible that the website has pre-selected none of the items ($p = 0$), in which case the input has no lines for pre-selected items.
Each of the next $q$ lines contains an integer $j$ (1ドル \le j \le n$). These are the item numbers of the items you want to buy. These $q$ items are distinct and are listed in increasing order. It is possible that you want to buy none of the items ($q = 0$), in which case the input has no lines for items you want.
Output a single integer, which is the minimum number of checkbox and button clicks required to select exactly the items you want.
11 4 1 5 5 1 4 9 10 11 1 3 6 7 8
7
ICPC > Regionals > North America > Pacific Northwest Regional > 2023 ICPC Pacific Northwest Region > Division 1 F번
ICPC > Regionals > North America > Pacific Northwest Regional > 2023 ICPC Pacific Northwest Region > Division 2 K번
ICPC > Regionals > North America > South Central USA Regional > 2023 South Central USA Regional Contest > Division 1 I번
ICPC > Regionals > North America > South Central USA Regional > 2023 South Central USA Regional Contest > Division 2 I번
ICPC > Regionals > North America > Mid-Atlantic Regional > 2023 Mid-Atlantic USA Regional Contest > Division 1 I번
ICPC > Regionals > North America > Mid-Atlantic Regional > 2023 Mid-Atlantic USA Regional Contest > Division 2 I번
ICPC > Regionals > North America > Southeast USA Regional > 2023 Southeast USA Regional Programming Contest > Division 1 I번
ICPC > Regionals > North America > Southeast USA Regional > 2023 Southeast USA Regional Programming Contest > Division 2 I번