VK Cup 2012 Round 3

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
164 VK Cup 2012 Round 3 FINISHED False 7200 442508123 April 8, 2012, 3:05 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 73 ) E Polycarpus and Tasks PROGRAMMING 3100

Polycarpus has many tasks. Each task is characterized by three integers l i , r i and t i . Three integers ( l i , r i , t i ) mean that to perform task i , one needs to choose an integer s i ( l i ≤ s i ; s i + t i - 1 ≤ r i ) , then the task will be carried out continuously for t i units of time, starting at time s i and up to time s i + t i - 1 , inclusive. In other words, a task is performed for a continuous period of time lasting t i , should be started no earlier than l i , and completed no later than r i . Polycarpus's tasks have a surprising property: for any task j , k (with j < k ) l j < l k and r j < r k . Let's suppose there is an ordered set of tasks A , containing | A | tasks. We'll assume that a j = ( l j , r j , t j ) (1 ≤ j ≤ | A |) . Also, we'll assume that the tasks are ordered by increasing l j with the increase in number. Let's consider the following recursive function f , whose argument is an ordered set of tasks A , and the result is an integer. The function f ( A ) is defined by the greedy algorithm, which is described below in a pseudo-language of programming. Step 1. , ans = 0 . Step 2. We consider all tasks in the order of increasing of their numbers in the set A . Lets define the current task counter i = 0 . Step 3. Consider the next task: i = i + 1 . If i > | A | fulfilled, then go to the 8 step. Step 4. If you can get the task done starting at time s i = max ( ans + 1, l i ) , then do the task i : s i = max( ans + 1 , l i ), ans = s i + t i - 1 , . Go to the next task (step 3). Step 5. Otherwise, find such task , that first, task a i can be done at time s i = max , and secondly, the value of is positive and takes the maximum value among all b k that satisfy the first condition. If you can choose multiple tasks as b k , choose the one with the maximum number in set A . Step 6. If you managed to choose task b k , then , . Go to the next task (step 3). Step 7. If you didn't manage to choose task b k , then skip task i . Go to the

Tutorials

VK Cup 2012 Round 3 — Разбор

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
5478798 ShyngyS E Dec. 20, 2013, 5:04 a.m. OK GNU C++ TESTS 25 218 4710400 3100
2787796 ghafi007 E Dec. 17, 2012, 3:08 p.m. OK GNU C++ TESTS 25 218 4710400 3100
2697168 konstantanter E Dec. 5, 2012, 1:14 p.m. OK GNU C++ TESTS 25 218 4710400 3100
14178290 130705009 E Nov. 9, 2015, 10:43 p.m. OK GNU C++ TESTS 25 248 4710400 3100
12303004 HappyNewYearMike E Aug. 1, 2015, 11:39 a.m. OK GNU C++ TESTS 25 248 4710400 3100
11337786 Amr_Hassan E May 28, 2015, 7:18 p.m. OK GNU C++ TESTS 25 248 4710400 3100
9385607 Recos E Jan. 8, 2015, 11:23 a.m. OK GNU C++ TESTS 25 248 4710400 3100
2955589 arseny30 E Jan. 18, 2013, 9:08 a.m. OK GNU C++ TESTS 25 265 6246400 3100
40991682 ReaLNero1 E July 31, 2018, 12:47 a.m. OK GNU C++ TESTS 25 280 4710400 3100
5620722 PSDEV E Jan. 5, 2014, 8:42 a.m. OK GNU C++ TESTS 25 280 4710400 3100
9964882 worst_coder E Feb. 23, 2015, 2:34 a.m. OK GNU C++0x TESTS 25 218 4710400 3100
2683291 s-quark E Dec. 1, 2012, 10:14 a.m. OK GNU C++0x TESTS 25 218 4710400 3100
54498304 WOSHIGEPACHONG2 E May 22, 2019, 6:59 p.m. OK GNU C++11 TESTS 25 186 4710400 3100
47651999 Qingyu E Dec. 28, 2018, 4:22 p.m. OK GNU C++11 TESTS 25 186 4710400 3100
10797236 I_love_Ender_Babal66 E April 20, 2015, 11:51 a.m. OK GNU C++11 TESTS 25 248 6758400 3100
17084301 freebsdx E April 1, 2016, 3:31 a.m. OK GNU C++11 TESTS 25 248 6860800 3100
17084312 freebsdx E April 1, 2016, 3:32 a.m. OK GNU C++11 TESTS 25 248 6963200 3100
57822868 py_ultron E July 27, 2019, 12:57 a.m. OK GNU C++11 TESTS 25 842 32051200 3100
57902130 lopare E July 28, 2019, 4:06 p.m. OK GNU C++11 TESTS 25 872 32051200 3100
15725526 WORLD_OF_TANKS E Feb. 1, 2016, 6:14 a.m. OK GNU C++11 TESTS 25 1122 32051200 3100
14755065 Los_Angelos_Laycurse E Dec. 11, 2015, 9:14 a.m. OK GNU C++11 TESTS 25 1434 14438400 3100
18633528 adedalic E June 21, 2016, 4:42 p.m. OK GNU C++11 TESTS 25 2088 9625600 3100
57184156 sorry_im_smurfing E July 17, 2019, 8:11 a.m. OK GNU C++14 TESTS 25 934 32051200 3100
23494096 Ali.Pi E Jan. 2, 2017, 6:42 a.m. OK GNU C++14 TESTS 25 1028 33996800 3100
60649285 Benq E Sept. 15, 2019, 6:26 p.m. OK GNU C++17 TESTS 25 1402 5734400 3100
14755076 Los_Angelos_Laycurse E Dec. 11, 2015, 9:15 a.m. OK MS C++ TESTS 25 2370 14438400 3100
14755070 Los_Angelos_Laycurse E Dec. 11, 2015, 9:14 a.m. OK MS C++ TESTS 25 2370 14438400 3100

remove filters

Back to search problems