Codeforces Round 185 (Div. 1)

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
311 Codeforces Round 185 (Div. 1) FINISHED False 7200 406823423 May 26, 2013, 3:30 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 544 ) C Fetch the Treasure PROGRAMMING brute force data structures graphs shortest paths 2600

Rainbow built h cells in a row that are numbered from 1 to h from left to right. There are n cells with treasure. We call each of these n cells "Treasure Cell". The i -th "Treasure Cell" is the a i -th cell and the value of treasure in it is c i dollars. Then, Freda went in the first cell. For now, she can go just k cells forward, or return to the first cell. That means Freda was able to reach the 1st, ( k + 1 )-th, ( 2· k + 1 )-th, ( 3· k + 1 )-th cells and so on. Then Rainbow gave Freda m operations. Each operation is one of the following three types: Add another method x : she can also go just x cells forward at any moment. For example, initially she has only one method k . If at some moment she has methods a 1 , a 2 , ..., a r then she can reach all the cells with number in form , where v i — some non-negative integer. Reduce the value of the treasure in the x -th "Treasure Cell" by y dollars. In other words, to apply assignment c x = c x - y . Ask the value of the most valuable treasure among the cells Freda can reach. If Freda cannot reach any cell with the treasure then consider the value of the most valuable treasure equal to 0, and do nothing. Otherwise take the most valuable treasure away. If several "Treasure Cells" have the most valuable treasure, take the "Treasure Cell" with the minimum number (not necessarily with the minimum number of cell). After that the total number of cells with a treasure is decreased by one. As a programmer, you are asked by Freda to write a program to answer each query. The first line of the input contains four integers: h (1 ≤ h ≤ 10 18 ), n , m (1 ≤ n , m ≤ 10 5 ) and k (1 ≤ k ≤ 10 4 ) . Each of the next n lines contains two integers: a i (1 ≤ a i ≤ h ), c i (1 ≤ c i ≤ 10 9 ) . That means the i -th "Treasure Cell" is the a i -th cell and cost of the treasure in that cell is c i dollars. All the a i are distinct. Each of the next m lines is in one of the three following formats: "1 x " — an operation of type 1, 1 ≤

Tutorials

Codeforces Round #185 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
8857511 SHUXK C Nov. 26, 2014, 9 a.m. OK FPC TESTS 50 218 3379200 2600
5040101 vietdoan C Nov. 10, 2013, 5:34 a.m. OK FPC TESTS 50 592 9728000 2600
8773895 hta C Nov. 21, 2014, 12:41 p.m. OK GNU C++ TESTS 50 77 4710400 2600
22877257 worcher C Dec. 11, 2016, 11:54 a.m. OK GNU C++ TESTS 50 78 2969600 2600
40989870 ReaLNero1 C July 30, 2018, 11:22 p.m. OK GNU C++ TESTS 50 93 2969600 2600
9572344 faebdc C Jan. 27, 2015, 1:31 p.m. OK GNU C++ TESTS 50 109 2969600 2600
11602190 unknown_shadow C June 16, 2015, 4:41 a.m. OK GNU C++ TESTS 50 109 12185600 2600
15929091 El_Shaarawy C Feb. 10, 2016, 12:57 p.m. OK GNU C++ TESTS 50 124 3788800 2600
13601059 HJWJBSR C Oct. 14, 2015, 2:36 a.m. OK GNU C++ TESTS 50 124 39731200 2600
9433777 Stilwell C Jan. 15, 2015, 6:07 a.m. OK GNU C++ TESTS 50 139 3481600 2600
9359767 wwx C Jan. 4, 2015, 12:24 p.m. OK GNU C++ TESTS 50 139 5529600 2600
8446377 qwer_zcc C Oct. 28, 2014, 5:53 a.m. OK GNU C++ TESTS 50 140 7270400 2600
3786992 mruxim C May 28, 2013, 10:21 a.m. OK GNU C++0x TESTS 50 203 3379200 2600
8902611 equation314 C Dec. 1, 2014, 6:28 a.m. OK GNU C++0x TESTS 50 296 164556800 2600
8902620 equation314 C Dec. 1, 2014, 6:30 a.m. OK GNU C++0x TESTS 50 311 164556800 2600
8902436 equation314 C Dec. 1, 2014, 5:57 a.m. OK GNU C++0x TESTS 50 311 164556800 2600
9974298 _iris_ C Feb. 23, 2015, 9:38 p.m. OK GNU C++0x TESTS 50 436 9728000 2600
9933495 No_Use_Anymore C Feb. 20, 2015, 3:48 a.m. OK GNU C++0x TESTS 50 608 11980800 2600
9442258 Man C Jan. 16, 2015, 10:38 a.m. OK GNU C++0x TESTS 50 686 11468800 2600
3785998 Riatre C May 28, 2013, 3:47 a.m. OK GNU C++0x TESTS 50 687 7372800 2600
9980987 zxc901 C Feb. 24, 2015, 1:43 p.m. OK GNU C++0x TESTS 50 733 8192000 2600
3788492 boleyn.su C May 28, 2013, 3:32 p.m. OK GNU C++0x TESTS 50 765 52224000 2600
54404594 time_interspace C May 20, 2019, 5:02 a.m. OK GNU C++11 TESTS 50 108 8192000 2600
55106394 SoiMae C June 5, 2019, 3:05 a.m. OK GNU C++11 TESTS 50 109 3788800 2600
54500647 WOSHIGEPACHONG2 C May 22, 2019, 8:37 p.m. OK GNU C++11 TESTS 50 109 8192000 2600
55547302 luogu_bot3 C June 14, 2019, 4:14 a.m. OK GNU C++11 TESTS 50 109 23449600 2600
55547197 Dilute C June 14, 2019, 4:09 a.m. OK GNU C++11 TESTS 50 109 23449600 2600
12028036 conflict C July 13, 2015, 10:32 a.m. OK GNU C++11 TESTS 50 140 5734400 2600
10847039 Invisble C April 24, 2015, 12:51 p.m. OK GNU C++11 TESTS 50 155 22323200 2600
11484440 FizzyDavid C June 7, 2015, 9:32 a.m. OK GNU C++11 TESTS 50 187 3584000 2600
10525672 dojiboy9 C March 30, 2015, 2:50 p.m. OK GNU C++11 TESTS 50 202 5017600 2600
15761000 Quang C Feb. 3, 2016, 2:23 a.m. OK GNU C++11 TESTS 50 202 5222400 2600
54441899 NotNight C May 21, 2019, 9:06 a.m. OK GNU C++14 TESTS 50 202 7475200 2600
41968129 X_emad_X C Aug. 22, 2018, 1:27 p.m. OK GNU C++14 TESTS 50 249 10854400 2600
28269299 mjhun C July 4, 2017, 3:33 a.m. OK GNU C++14 TESTS 50 280 7372800 2600
27790737 Batman C June 15, 2017, 9:45 a.m. OK GNU C++14 TESTS 50 311 11980800 2600
23647497 MohammadJA C Jan. 8, 2017, 2:08 p.m. OK GNU C++14 TESTS 50 326 81203200 2600
27926362 -mmd- C June 20, 2017, 1:45 p.m. OK GNU C++14 TESTS 50 327 13926400 2600
56067830 AghaTizi C June 26, 2019, 8:52 a.m. OK GNU C++14 TESTS 50 358 5836800 2600
69520701 ErfanMirshams C Jan. 25, 2020, 1:21 p.m. OK GNU C++14 TESTS 50 514 6246400 2600
25361072 DEGwer C March 9, 2017, 1:35 p.m. OK GNU C++14 TESTS 50 546 8192000 2600
68092917 pikmike C Jan. 2, 2020, 7:01 p.m. OK GNU C++14 TESTS 50 576 6041600 2600
62460394 hjk1030 C Oct. 13, 2019, 8:03 a.m. OK GNU C++17 TESTS 50 140 5939200 2600
63618972 tfg C Oct. 27, 2019, 9:14 p.m. OK GNU C++17 TESTS 50 202 5120000 2600
65313099 jyf111 C Nov. 18, 2019, 4:07 p.m. OK GNU C++17 TESTS 50 202 17408000 2600
46485281 vjudge2 C Dec. 2, 2018, 9:21 a.m. OK GNU C++17 TESTS 50 218 6963200 2600
46483398 Hitler C Dec. 2, 2018, 9:10 a.m. OK GNU C++17 TESTS 50 218 6963200 2600
56175776 MAMBA C June 27, 2019, 7:03 p.m. OK GNU C++17 TESTS 50 218 8192000 2600
45917761 jah_melon C Nov. 18, 2018, 2:50 p.m. OK GNU C++17 TESTS 50 249 7475200 2600
68940576 P.Alizadeh C Jan. 16, 2020, 2:18 p.m. OK GNU C++17 TESTS 50 249 12390400 2600
49389845 AliShahali1382 C Feb. 3, 2019, 9:13 a.m. OK GNU C++17 TESTS 50 265 12288000 2600
49389909 AliShahali1382 C Feb. 3, 2019, 9:15 a.m. OK GNU C++17 TESTS 50 280 12083200 2600
3785185 uwi C May 27, 2013, 5:42 p.m. OK Java 6 TESTS 50 359 307200 2600
3785178 uwi C May 27, 2013, 5:39 p.m. OK Java 6 TESTS 50 406 2662400 2600
3819858 wistful23 C June 3, 2013, 7:33 p.m. OK Java 6 TESTS 50 500 2764800 2600
3960080 jayfcwong C June 25, 2013, 1:49 p.m. OK Java 6 TESTS 50 1062 614400 2600
3779453 mmaxio C May 26, 2013, 5:20 p.m. OK Java 7 TESTS 50 546 307200 2600
65112836 Ahmad C Nov. 16, 2019, 12:46 a.m. OK Java 8 TESTS 50 389 6656000 2600
54774742 ko_osaga C May 28, 2019, 6:31 p.m. OK Kotlin TESTS 50 1372 7065600 2600
11398836 waltz C June 3, 2015, 8:45 a.m. OK MS C++ TESTS 50 514 6348800 2600
11393165 swenyoo C June 2, 2015, 5:19 p.m. OK MS C++ TESTS 50 514 6348800 2600
4706259 lzsb C Oct. 8, 2013, 5:44 a.m. OK MS C++ TESTS 50 560 9318400 2600
3783409 19891101 C May 27, 2013, 10:22 a.m. OK MS C++ TESTS 50 656 12697600 2600
4706244 lzsb C Oct. 8, 2013, 5:42 a.m. OK MS C++ TESTS 50 716 10342400 2600
4706213 lzsb C Oct. 8, 2013, 5:38 a.m. OK MS C++ TESTS 50 716 10342400 2600
3850807 AleX C June 9, 2013, 1:12 p.m. OK MS C++ TESTS 50 1078 6553600 2600
3787659 Angor C May 28, 2013, 11:32 a.m. OK MS C++ TESTS 50 1250 8601600 2600

remove filters

Back to search problems