Educational Codeforces Round 124 (Rated for Div. 2)

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
1651 Educational Codeforces Round 124 (Rated for Div. 2) FINISHED False 7200 90257063 March 10, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 388 ) F Tower Defense PROGRAMMING binary search brute force data structures

B"Monocarp is playing a tower defense game. A level in the game can be represented as an OX axis, where each lattice point from 1 to n contains a tower in it. The tower in the i -th point has c_i mana capacity and r_i mana regeneration rate. In the beginning, before the 0 -th second, each tower has full mana. If, at the end of some second, the i -th tower has x mana, then it becomes mathit{min}(x + r_i, c_i) mana for the next second. There are q monsters spawning on a level. The j -th monster spawns at point 1 at the beginning of t_j -th second, and it has h_j health. Every monster is moving 1 point per second in the direction of increasing coordinate. When a monster passes the tower, the tower deals mathit{min}(H, M) damage to it, where H is the current health of the monster and M is the current mana amount of the tower. This amount gets subtracted from both monster's health and tower's mana. Unfortunately, sometimes some monsters can pass all n towers and remain alive. Monocarp wants to know what will be the total health of the monsters after they pass all towers. The first line contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of towers. The i -th of the next n lines contains two integers c_i and r_i ( 1 <= r_i <= c_i <= 10^9 ) -- the mana capacity and the mana regeneration rate of the i -th tower. The next line contains a single integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of monsters. The j -th of the next q lines contains two integers t_j and h_j ( 0 <= t_j <= 2 cdot 10^5 ; 1 <= h_j <= 10^{12} ) -- the time the j -th monster spawns and its health. The monsters are listed in the increasing order of their spawn time, so t_j < t_{j+1} for all 1 <= j <= q-1 . Print a single integer -- the total health"...

Tutorials

Educational Codeforces Round 124 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
149179464 rainboy F March 10, 2022, 5:46 p.m. OK GNU C11 TESTS 31 858 112230400
149202407 L7-56 F March 11, 2022, 2:27 a.m. OK GNU C++14 TESTS 31 1091 493977600
149206812 Areus F March 11, 2022, 3:56 a.m. OK GNU C++14 TESTS 31 2168 210944000
149206567 Areus F March 11, 2022, 3:52 a.m. OK GNU C++14 TESTS 31 2417 210944000
149199479 Tyyyyyy F March 11, 2022, 1:02 a.m. OK GNU C++14 TESTS 31 2448 159641600
149163400 meyi F March 10, 2022, 4:22 p.m. OK GNU C++14 TESTS 31 2776 160665600
149200397 Tyyyyyy F March 11, 2022, 1:31 a.m. OK GNU C++14 TESTS 31 2808 14028800
149200308 Tyyyyyy F March 11, 2022, 1:28 a.m. OK GNU C++14 TESTS 31 2901 13824000
149203061 Tyyyyyy F March 11, 2022, 2:43 a.m. OK GNU C++14 TESTS 31 2979 13926400
149200387 Tyyyyyy F March 11, 2022, 1:31 a.m. OK GNU C++14 TESTS 31 3696 13926400
149207387 gkc_chaitu F March 11, 2022, 4:07 a.m. OK GNU C++17 TESTS 31 623 127180800
149166983 yp155136 F March 10, 2022, 4:30 p.m. OK GNU C++17 TESTS 31 1762 296857600
149193255 jbc_qfi F March 10, 2022, 9:19 p.m. OK GNU C++17 TESTS 31 2059 469708800
149193267 jbc_qfi F March 10, 2022, 9:19 p.m. OK GNU C++17 TESTS 31 2230 333516800
149193280 jbc_qfi F March 10, 2022, 9:19 p.m. OK GNU C++17 TESTS 31 3322 173158400
149206061 basic_string F March 11, 2022, 3:44 a.m. OK GNU C++17 TESTS 31 3977 181760000
149204209 basic_string F March 11, 2022, 3:06 a.m. OK GNU C++17 (64) TESTS 31 576 128716800
149202403 kal013 F March 11, 2022, 2:27 a.m. OK GNU C++17 (64) TESTS 31 794 10444800
149202640 kal013 F March 11, 2022, 2:33 a.m. OK GNU C++17 (64) TESTS 31 811 10444800
149202422 kal013 F March 11, 2022, 2:27 a.m. OK GNU C++17 (64) TESTS 31 826 75059200
149179491 rainboy F March 10, 2022, 5:46 p.m. OK GNU C++17 (64) TESTS 31 888 112128000
149202439 kal013 F March 11, 2022, 2:28 a.m. OK GNU C++17 (64) TESTS 31 919 46080000
149204148 He_Ren F March 11, 2022, 3:05 a.m. OK GNU C++17 (64) TESTS 31 1060 104243200
149204911 yzy1 F March 11, 2022, 3:20 a.m. OK GNU C++17 (64) TESTS 31 2183 56115200
149206879 yzy1 F March 11, 2022, 3:57 a.m. OK GNU C++17 (64) TESTS 31 2401 56115200
149206091 basic_string F March 11, 2022, 3:44 a.m. OK GNU C++17 (64) TESTS 31 3541 215961600
149198871 Everule F March 11, 2022, 12:43 a.m. OK GNU C++20 (64) TESTS 31 920 219340800
149174070 DeadlyPillow F March 10, 2022, 4:59 p.m. OK GNU C++20 (64) TESTS 31 1590 12902400
149202891 WHC-MIK-7521X F March 11, 2022, 2:39 a.m. OK GNU C++20 (64) TESTS 31 1855 159539200
149174263 DeadlyPillow F March 10, 2022, 5 p.m. OK GNU C++20 (64) TESTS 31 1934 12902400
149197281 Jamey F March 10, 2022, 11:42 p.m. OK GNU C++20 (64) TESTS 31 1934 160460800
149197108 Jamey F March 10, 2022, 11:36 p.m. OK GNU C++20 (64) TESTS 31 1934 160460800
149164091 meyi F March 10, 2022, 4:24 p.m. OK GNU C++20 (64) TESTS 31 1934 160460800
149201001 Jamey F March 11, 2022, 1:50 a.m. OK GNU C++20 (64) TESTS 31 1934 160460800
149165026 meyi F March 10, 2022, 4:26 p.m. OK GNU C++20 (64) TESTS 31 2058 160460800
149205106 dXqwq F March 11, 2022, 3:24 a.m. OK GNU C++20 (64) TESTS 31 2729 216473600

remove filters

Back to search problems