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 |
|---|---|---|---|---|---|---|
| 500 | Good Bye 2014 | FINISHED | False | 9000 | 356454023 | Dec. 30, 2014, 3 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 828 ) | F | New Year Shopping | PROGRAMMING | divide and conquer dp | 2600 |
Dohyun is running a grocery store. He sells n items numbered by integers from 1 to n . The i -th ( 1 ≤ i ≤ n ) of them costs c i dollars, and if I buy it, my happiness increases by h i . Each item can be displayed only for p units of time because of freshness. As Dohyun displays the i -th item at time t i , the customers can buy the i -th item only from time t i to time t i + ( p - 1) inclusively. Also, each customer cannot buy the same item more than once. I'd like to visit Dohyun's grocery store and buy some items for the New Year Party, and maximize my happiness. Because I am a really busy person, I can visit the store only once, and for very short period of time. In other words, if I visit the store at time t , I can only buy the items available at time t . But I can buy as many items as possible, if the budget holds. I can't buy same item several times due to store rules. It is not necessary to use the whole budget. I made a list of q pairs of integers ( a j , b j ) , which means I may visit the store at time a j , and spend at most b j dollars at the store. For each pair, I'd like to know the maximum happiness I can obtain. But there are so many pairs that I can't handle them. Can you help me? The first line contains two space-separated integers n and p ( 1 ≤ n ≤ 4000 , 1 ≤ p ≤ 10 000 ) — the number of items, and the display time of each item. Next n lines describe the items. The i -th ( 1 ≤ i ≤ n ) of them contains three space-separated integers c i , h i , t i ( 1 ≤ c i , h i ≤ 4000 , 1 ≤ t i ≤ 10 000 ) — the cost of the i -th item, the happiness of the i -th item, and the time when the i -th item starts to be displayed. The next line contains an integer q ( 1 ≤ q ≤ 20 000 )— the number of candidates. Next q lines describe the candidates. The j -th ( 1 ≤ j ≤ q ) of them contains two space-separated integers a j , b j ( 1 ≤ a j ≤ 20 000 , 1 ≤ b j ≤ 4000 ) — the visit time and the budget for j -th visit of store. For each candidate, print a single li |
| Tutorial 2 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 28073091 | black_horse2014 | F | June 27, 2017, 9:10 a.m. | OK | GNU C++ | TESTS | 39 | 109 | 131072000 | 2600 | |
| 16229424 | bnuvjudge2 | F | Feb. 20, 2016, 1:17 p.m. | OK | GNU C++ | TESTS | 39 | 124 | 67072000 | 2600 | |
| 17604922 | bnuvjudge2 | F | May 1, 2016, 8:13 a.m. | OK | GNU C++ | TESTS | 39 | 124 | 69222400 | 2600 | |
| 18664902 | YummyJay | F | June 23, 2016, 1:58 p.m. | OK | GNU C++ | TESTS | 39 | 124 | 128409600 | 2600 | |
| 22990504 | 12190140 | F | Dec. 14, 2016, 11:39 p.m. | OK | GNU C++ | TESTS | 39 | 124 | 128614400 | 2600 | |
| 18910488 | ShinFeb | F | July 6, 2016, 3:07 a.m. | OK | GNU C++ | TESTS | 39 | 124 | 128614400 | 2600 | |
| 34042779 | lyx_cjz | F | Jan. 9, 2018, 7:11 a.m. | OK | GNU C++ | TESTS | 39 | 124 | 130969600 | 2600 | |
| 16229398 | bnuvjudge3 | F | Feb. 20, 2016, 1:16 p.m. | OK | GNU C++ | TESTS | 39 | 140 | 67072000 | 2600 | |
| 15142596 | HappyNewYearMike | F | Dec. 31, 2015, 10:36 p.m. | OK | GNU C++ | TESTS | 39 | 140 | 128409600 | 2600 | |
| 18661871 | vjudge1 | F | June 23, 2016, 10:52 a.m. | OK | GNU C++ | TESTS | 39 | 155 | 128409600 | 2600 | |
| 61898854 | _ppp204 | F | Oct. 5, 2019, 8:02 a.m. | OK | GNU C++11 | TESTS | 39 | 93 | 128614400 | 2600 | |
| 50558152 | dengyixuan | F | Feb. 27, 2019, 9:16 a.m. | OK | GNU C++11 | TESTS | 39 | 93 | 129945600 | 2600 | |
| 61895009 | luogu_bot3 | F | Oct. 5, 2019, 6:59 a.m. | OK | GNU C++11 | TESTS | 39 | 108 | 128614400 | 2600 | |
| 44446903 | 1849285087 | F | Oct. 17, 2018, 2:16 p.m. | OK | GNU C++11 | TESTS | 39 | 108 | 128614400 | 2600 | |
| 62117275 | gudu | F | Oct. 8, 2019, 1:42 p.m. | OK | GNU C++11 | TESTS | 39 | 108 | 202752000 | 2600 | |
| 61898191 | luogu_bot4 | F | Oct. 5, 2019, 7:51 a.m. | OK | GNU C++11 | TESTS | 39 | 109 | 128614400 | 2600 | |
| 44446827 | 1849285087 | F | Oct. 17, 2018, 2:14 p.m. | OK | GNU C++11 | TESTS | 39 | 109 | 128614400 | 2600 | |
| 61898929 | ___JOKER___ | F | Oct. 5, 2019, 8:03 a.m. | OK | GNU C++11 | TESTS | 39 | 109 | 128819200 | 2600 | |
| 44440802 | vjudge5 | F | Oct. 17, 2018, 12:02 p.m. | OK | GNU C++11 | TESTS | 39 | 109 | 128921600 | 2600 | |
| 44440680 | CalvinJin | F | Oct. 17, 2018, 11:59 a.m. | OK | GNU C++11 | TESTS | 39 | 109 | 128921600 | 2600 | |
| 25943047 | la1la1la | F | March 30, 2017, 6:42 a.m. | OK | GNU C++14 | TESTS | 39 | 124 | 70451200 | 2600 | |
| 44442074 | Solashiro | F | Oct. 17, 2018, 12:32 p.m. | OK | GNU C++14 | TESTS | 39 | 124 | 128819200 | 2600 | |
| 58147122 | the_art_of_war | F | Aug. 1, 2019, 10:39 p.m. | OK | GNU C++14 | TESTS | 39 | 140 | 66662400 | 2600 | |
| 50555947 | zhou888 | F | Feb. 27, 2019, 8 a.m. | OK | GNU C++14 | TESTS | 39 | 140 | 129126400 | 2600 | |
| 50555845 | zjB_shadow | F | Feb. 27, 2019, 7:55 a.m. | OK | GNU C++14 | TESTS | 39 | 140 | 144691200 | 2600 | |
| 58147132 | the_art_of_war | F | Aug. 1, 2019, 10:40 p.m. | OK | GNU C++14 | TESTS | 39 | 155 | 66662400 | 2600 | |
| 41434919 | tender_green | F | Aug. 10, 2018, 2:31 p.m. | OK | GNU C++14 | TESTS | 39 | 155 | 241254400 | 2600 | |
| 65223826 | Yousef_Salama | F | Nov. 16, 2019, 11:24 p.m. | OK | GNU C++14 | TESTS | 39 | 156 | 2457600 | 2600 | |
| 27265825 | Stupid_cdd | F | May 21, 2017, 11:32 a.m. | OK | GNU C++14 | TESTS | 39 | 171 | 68710400 | 2600 | |
| 60386072 | ccsu_cat_love_jiejie | F | Sept. 11, 2019, 11:33 a.m. | OK | GNU C++14 | TESTS | 39 | 171 | 161587200 | 2600 | |
| 61894768 | luogu_bot2 | F | Oct. 5, 2019, 6:55 a.m. | OK | GNU C++17 | TESTS | 39 | 124 | 129024000 | 2600 | |
| 44481777 | Zerokei | F | Oct. 18, 2018, 10:42 a.m. | OK | GNU C++17 | TESTS | 39 | 124 | 129433600 | 2600 | |
| 44471808 | vjudge4 | F | Oct. 18, 2018, 6:45 a.m. | OK | GNU C++17 | TESTS | 39 | 140 | 129536000 | 2600 | |
| 44471788 | vjudge1 | F | Oct. 18, 2018, 6:45 a.m. | OK | GNU C++17 | TESTS | 39 | 140 | 129740800 | 2600 | |
| 63666623 | noelcowm | F | Oct. 28, 2019, 3:33 p.m. | OK | GNU C++17 | TESTS | 39 | 171 | 149606400 | 2600 | |
| 62656301 | Polygon-yg | F | Oct. 16, 2019, 1:57 a.m. | OK | GNU C++17 | TESTS | 39 | 186 | 6246400 | 2600 | |
| 44464139 | linljy | F | Oct. 17, 2018, 11:40 p.m. | OK | GNU C++17 | TESTS | 39 | 186 | 128921600 | 2600 | |
| 62211720 | ruo | F | Oct. 9, 2019, 2:42 p.m. | OK | GNU C++17 | TESTS | 39 | 187 | 129536000 | 2600 | |
| 45428674 | RUSH_D_CAT | F | Nov. 8, 2018, 12:43 a.m. | OK | GNU C++17 | TESTS | 39 | 187 | 131891200 | 2600 | |
| 62096184 | hjk1030 | F | Oct. 8, 2019, 7:36 a.m. | OK | GNU C++17 | TESTS | 39 | 202 | 128921600 | 2600 | |
| 22154412 | tbuzzelli | F | Nov. 10, 2016, 7:44 p.m. | OK | Java 8 | TESTS | 39 | 483 | 118579200 | 2600 | |
| 16284243 | antonkov | F | Feb. 22, 2016, 9:37 p.m. | OK | Java 8 | TESTS | 39 | 919 | 181145600 | 2600 |
Back to search problems