Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1139 | Codeforces Round 548 (Div. 2) | FINISHED | False | 7200 | 178640699 | March 21, 2019, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 439 ) | F | Dish Shopping | PROGRAMMING | data structures divide and conquer | 2800 |
B"There are m people living in a city. There are n dishes sold in the city. Each dish i has a price p_i , a standard s_i and a beauty b_i . Each person j has an income of inc_j and a preferred beauty pref_j . A person would never buy a dish whose standard is less than the person's income. Also, a person can't afford a dish with a price greater than the income of the person. In other words, a person j can buy a dish i only if p_i <= q inc_j <= q s_i . Also, a person j can buy a dish i , only if |b_i-pref_j| <= q (inc_j-p_i) . In other words, if the price of the dish is less than the person's income by k , the person will only allow the absolute difference of at most k between the beauty of the dish and his/her preferred beauty. Print the number of dishes that can be bought by each person in the city. The first line contains two integers n and m ( 1 <= q n <= q 10^5 , 1 <= q m <= q 10^5 ), the number of dishes available in the city and the number of people living in the city. The second line contains n integers p_i ( 1 <= q p_i <= q 10^9 ), the price of each dish. The third line contains n integers s_i ( 1 <= q s_i <= q 10^9 ), the standard of each dish. The fourth line contains n integers b_i ( 1 <= q b_i <= q 10^9 ), the beauty of each dish. The fifth line contains m integers inc_j ( 1 <= q inc_j <= q 10^9 ), the income of every person. The sixth line contains m integers pref_j ( 1 <= q pref_j <= q 10^9 ), the preferred beauty of every person. It is guaranteed that for all integers i from 1 to n , the following condition holds: p_i <= q s_i . Print m integers, the number of dishes that can be bought by every person living in the city. In the first example, the first person can buy dish 2 , the second person can buy dishes 1 a"... |
Codeforces Round #548 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
52136942 | luogu_bot5 | F | April 1, 2019, 3:41 a.m. | OK | GNU C++11 | TESTS | 34 | 186 | 15257600 | 2800 | |
52136934 | shuidi | F | April 1, 2019, 3:40 a.m. | OK | GNU C++11 | TESTS | 34 | 186 | 15257600 | 2800 | |
52484176 | nantf | F | April 8, 2019, 7:52 a.m. | OK | GNU C++11 | TESTS | 34 | 186 | 22425600 | 2800 | |
63907141 | mlby | F | Oct. 31, 2019, 6:58 a.m. | OK | GNU C++11 | TESTS | 34 | 202 | 15257600 | 2800 | |
52293302 | LLL_2820 | F | April 4, 2019, 4:12 a.m. | OK | GNU C++11 | TESTS | 34 | 202 | 15257600 | 2800 | |
51858420 | stal_xy23z7b8 | F | March 26, 2019, 12:09 p.m. | OK | GNU C++11 | TESTS | 34 | 202 | 15257600 | 2800 | |
52467456 | LJC00118 | F | April 7, 2019, 4:31 p.m. | OK | GNU C++11 | TESTS | 34 | 202 | 16896000 | 2800 | |
51760553 | LJC00118 | F | March 23, 2019, 1:35 p.m. | OK | GNU C++11 | TESTS | 34 | 217 | 16896000 | 2800 | |
52137763 | cuizhuyefei | F | April 1, 2019, 4:30 a.m. | OK | GNU C++11 | TESTS | 34 | 218 | 12185600 | 2800 | |
65435119 | vjudge5 | F | Nov. 20, 2019, 1:11 p.m. | OK | GNU C++11 | TESTS | 34 | 234 | 14745600 | 2800 | |
51642339 | Giver | F | March 21, 2019, 4:47 p.m. | OK | GNU C++14 | TESTS | 34 | 280 | 8089600 | 2800 | |
52913788 | Quang | F | April 17, 2019, 3:03 p.m. | OK | GNU C++14 | TESTS | 34 | 295 | 12697600 | 2800 | |
51665534 | RobeZH | F | March 22, 2019, 5:49 a.m. | OK | GNU C++14 | TESTS | 34 | 296 | 15052800 | 2800 | |
51666434 | Gromah | F | March 22, 2019, 6:16 a.m. | OK | GNU C++14 | TESTS | 34 | 311 | 16793600 | 2800 | |
51745778 | Jian_Ron | F | March 23, 2019, 7:35 a.m. | OK | GNU C++14 | TESTS | 34 | 327 | 45158400 | 2800 | |
51942678 | ..vince | F | March 28, 2019, 3:12 p.m. | OK | GNU C++14 | TESTS | 34 | 342 | 12185600 | 2800 | |
51655074 | tusg25 | F | March 21, 2019, 8:56 p.m. | OK | GNU C++14 | TESTS | 34 | 342 | 16998400 | 2800 | |
52641408 | icecuber | F | April 12, 2019, 12:38 p.m. | OK | GNU C++14 | TESTS | 34 | 358 | 21094400 | 2800 | |
52551908 | hank55663 | F | April 10, 2019, 5:16 a.m. | OK | GNU C++14 | TESTS | 34 | 374 | 18636800 | 2800 | |
51643102 | kmjp | F | March 21, 2019, 4:53 p.m. | OK | GNU C++14 | TESTS | 34 | 374 | 22630400 | 2800 | |
52721252 | markotee | F | April 13, 2019, 7:59 p.m. | OK | GNU C++17 | TESTS | 34 | 280 | 13926400 | 2800 | |
52060157 | spetsnaz | F | March 30, 2019, 11:38 p.m. | OK | GNU C++17 | TESTS | 34 | 295 | 18124800 | 2800 | |
51649891 | lelkok220 | F | March 21, 2019, 6:24 p.m. | OK | GNU C++17 | TESTS | 34 | 296 | 9318400 | 2800 | |
52012578 | cjnwq | F | March 30, 2019, 9:13 a.m. | OK | GNU C++17 | TESTS | 34 | 296 | 10444800 | 2800 | |
51761931 | Gene_INNOCENT | F | March 23, 2019, 2:07 p.m. | OK | GNU C++17 | TESTS | 34 | 311 | 24064000 | 2800 | |
68233690 | hjk1030 | F | Jan. 5, 2020, 10:08 a.m. | OK | GNU C++17 | TESTS | 34 | 358 | 21811200 | 2800 | |
51795025 | szfck | F | March 24, 2019, 2:40 p.m. | OK | GNU C++17 | TESTS | 34 | 358 | 24576000 | 2800 | |
63754054 | limabeans | F | Oct. 29, 2019, 9:57 p.m. | OK | GNU C++17 | TESTS | 34 | 358 | 42803200 | 2800 | |
51682311 | F0_0H | F | March 22, 2019, 1:10 p.m. | OK | GNU C++17 | TESTS | 34 | 358 | 68915200 | 2800 | |
51732417 | kessido | F | March 22, 2019, 10:19 p.m. | OK | GNU C++17 | TESTS | 34 | 373 | 22630400 | 2800 | |
51645569 | uwi | F | March 21, 2019, 5:13 p.m. | OK | Java 8 | TESTS | 34 | 498 | 23449600 | 2800 | |
67273929 | dalt | F | Dec. 20, 2019, 9:27 a.m. | OK | Java 8 | TESTS | 34 | 670 | 47513600 | 2800 | |
52498440 | sweiss | F | April 8, 2019, 2:50 p.m. | OK | Java 8 | TESTS | 34 | 1123 | 83456000 | 2800 | |
51652020 | Jeel_Vaishnav | F | March 21, 2019, 7:17 p.m. | OK | Java 8 | TESTS | 34 | 1824 | 30003200 | 2800 | |
51950581 | yevhenii_kanivets | F | March 28, 2019, 7:53 p.m. | OK | Java 8 | TESTS | 34 | 1871 | 30003200 | 2800 | |
54733445 | camypaper | F | May 28, 2019, 2:54 a.m. | OK | Mono C# | TESTS | 34 | 638 | 55193600 | 2800 | |
52548516 | PanShiLiang_GG | F | April 10, 2019, 1:03 a.m. | OK | MS C++ 2017 | TESTS | 34 | 327 | 25907200 | 2800 |
Back to search problems