Codeforces Round 1084 (Div. 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
2200 Codeforces Round 1084 (Div. 3) FINISHED False 8100 4202723 Feb. 27, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2754 ) F Mooclear Reactor 2 PROGRAMMING data structures greedy implementation sortings

Bessie needs to produce energy as possible in her mooclear reactor. She has (n) different particles. Each particle is defined by two integers (x) and (y). The particle generates (x) units of energy but has a reactivity (y), meaning that it can only exist together with at most (y) other particles in the reactor. Formally, if this particle is chosen to generate energy, then at most (y) particles (other than itself) can also be chosen to generate energy. Bessie must choose a subset of particles that satisfy this constraint to generate energy. The amount of energy that she generates is equal to the sum of the energies of the particles in the subset. There is a shop with (m) particles. Bessie can buy exactly one particle from the shop. For each particle in the shop , determine the maximum total energy that Bessie would be able to produce if she were to buy only that particle from the shop. Bessie is not required to use the particle that is purchased from the shop. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains two integers (n) and (m) ((1 \leq n, m \leq 2 \cdot 10^5)) — the number of particles that Bessie has and the number of particles in the shop, respectively. The (i)-th of the next (n) lines contains two integers (x) and (y) ((1 \leq x \leq 10^9), (0 \leq y \leq n)) — the energy and reactivity of Bessie's (i)-th particle. The (j)-th of the next (m) lines contains two integers (x) and (y) ((1 \leq x \leq 10^9), (0 \leq y \leq n)) — the energy and reactivity of the shop's (j)-th particle. It is guaranteed that the sum of (n) over all test cases and the sum of (m) over all test cases do not exceed (2 \cdot 10^5). For each test case, print (m) integers. The (i)-th integer should be the maximum total energy that Bessie can produce if she purchases

Tutorials

Codeforces Round 1084 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
364733032 SEPILBOARD F Feb. 27, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 7 218 3993600
364739360 utkarshver11 F Feb. 27, 2026, 5:26 p.m. OK C++17 (GCC 7-32) TESTS 7 250 5632000
364733178 Lukita_Highmore F Feb. 27, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 7 250 9318400
364728258 kakcode F Feb. 27, 2026, 4:38 p.m. OK C++17 (GCC 7-32) TESTS 7 265 7168000
364748899 Ermiooo159 F Feb. 27, 2026, 6:54 p.m. OK C++17 (GCC 7-32) TESTS 7 265 11366400
364731017 Wind_love F Feb. 27, 2026, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 7 265 12288000
364731943 IsaacPang2526 F Feb. 27, 2026, 4:47 p.m. OK C++17 (GCC 7-32) TESTS 7 281 13107200
364737287 Argentum47 F Feb. 27, 2026, 5:11 p.m. OK C++17 (GCC 7-32) TESTS 7 281 13619200
364727648 VaiseIamHere F Feb. 27, 2026, 4:37 p.m. OK C++17 (GCC 7-32) TESTS 7 296 5324800
364733309 jhlee12_ F Feb. 27, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 7 296 5939200
364763690 alex_rider123 F Feb. 27, 2026, 9:29 p.m. OK C++20 (GCC 13-64) TESTS 7 187 8294400
364783354 TranVinhHuy2010 F Feb. 28, 2026, 4:24 a.m. OK C++20 (GCC 13-64) TESTS 7 187 8806400
364767421 nono00 F Feb. 27, 2026, 10:30 p.m. OK C++20 (GCC 13-64) TESTS 7 187 12800000
364730987 ryanbloureiro F Feb. 27, 2026, 4:45 p.m. OK C++20 (GCC 13-64) TESTS 7 203 4096000
364779091 Jamshen F Feb. 28, 2026, 3:05 a.m. OK C++20 (GCC 13-64) TESTS 7 203 4710400
364743450 lovish8320 F Feb. 27, 2026, 6:03 p.m. OK C++20 (GCC 13-64) TESTS 7 203 5120000
364723025 thawan F Feb. 27, 2026, 4:25 p.m. OK C++20 (GCC 13-64) TESTS 7 203 7270400
364734803 Manas_DixiT F Feb. 27, 2026, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 7 203 7782400
364723964 pjz_pjz F Feb. 27, 2026, 4:28 p.m. OK C++20 (GCC 13-64) TESTS 7 203 10547200
364759649 Tenham F Feb. 27, 2026, 8:38 p.m. OK C++20 (GCC 13-64) TESTS 7 203 11059200
364739126 Kaedemaple F Feb. 27, 2026, 5:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 140 19456000
364739704 qingfengmxy F Feb. 27, 2026, 5:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 171 21299200
364732198 T_Danh F Feb. 27, 2026, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 3174400
364767730 rasoulist F Feb. 27, 2026, 10:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 3993600
364729703 Z_L_G F Feb. 27, 2026, 4:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 5222400
364741366 yrlpiao F Feb. 27, 2026, 5:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 5836800
364782974 alphoenix F Feb. 28, 2026, 4:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 6758400
364743019 Legend4321 F Feb. 27, 2026, 5:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 9523200
364781310 George_Rubio F Feb. 28, 2026, 3:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 10035200
364745373 lakshyatyagi F Feb. 27, 2026, 6:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 12697600
364733204 LittleGopher F Feb. 27, 2026, 4:49 p.m. OK Go TESTS 7 531 31232000
364724007 BiggestFish06 F Feb. 27, 2026, 4:28 p.m. OK Java 21 TESTS 7 500 17203200
364728169 bluberry12 F Feb. 27, 2026, 4:38 p.m. OK Java 21 TESTS 7 687 33996800
364726086 ayushs05 F Feb. 27, 2026, 4:33 p.m. OK Java 21 TESTS 7 765 18329600
364731179 earendel0184 F Feb. 27, 2026, 4:45 p.m. OK Java 21 TESTS 7 781 39526400
364773052 GaleStarr F Feb. 28, 2026, 12:51 a.m. OK Java 21 TESTS 7 828 41574400
364722901 aravind_dyapa F Feb. 27, 2026, 4:25 p.m. OK Java 21 TESTS 7 859 27443200
364729537 savinthalari446 F Feb. 27, 2026, 4:41 p.m. OK Java 21 TESTS 7 890 60313600
364732982 pranavjh F Feb. 27, 2026, 4:49 p.m. OK Java 21 TESTS 7 1859 819200
364724049 tanmaygarg021103 F Feb. 27, 2026, 4:28 p.m. OK Java 21 TESTS 7 1937 23961600
364747873 ironman263 F Feb. 27, 2026, 6:45 p.m. OK Java 21 TESTS 7 2703 69017600
364741860 kevin_0911 F Feb. 27, 2026, 5:49 p.m. OK Java 8 TESTS 7 718 36249600
364723109 2310080064 F Feb. 27, 2026, 4:25 p.m. OK Java 8 TESTS 7 734 28467200
364741016 bu_gye_jeong F Feb. 27, 2026, 5:40 p.m. OK Node.js TESTS 7 1031 119091200
364732390 bu_gye_jeong F Feb. 27, 2026, 4:48 p.m. OK Node.js TESTS 7 1609 179609600
364730508 vignesh13022005 F Feb. 27, 2026, 4:43 p.m. OK PyPy 3-64 TESTS 7 531 97177600
364777587 gardengnome F Feb. 28, 2026, 2:36 a.m. OK PyPy 3-64 TESTS 7 546 39424000
364774471 Little_Sheep_Yawn F Feb. 28, 2026, 1:24 a.m. OK PyPy 3-64 TESTS 7 609 46694400
364749422 salablecurrency F Feb. 27, 2026, 7 p.m. OK PyPy 3-64 TESTS 7 687 45363200
364737029 kazukun1311 F Feb. 27, 2026, 5:09 p.m. OK PyPy 3-64 TESTS 7 703 38809600
364731879 Rupam_sen F Feb. 27, 2026, 4:47 p.m. OK PyPy 3-64 TESTS 7 703 92672000
364743115 mnkp F Feb. 27, 2026, 6 p.m. OK PyPy 3-64 TESTS 7 734 62566400
364776878 gardengnome F Feb. 28, 2026, 2:21 a.m. OK PyPy 3-64 TESTS 7 750 46284800
364734902 GoldbangE F Feb. 27, 2026, 4:56 p.m. OK PyPy 3-64 TESTS 7 750 86630400
364737292 _samit_ F Feb. 27, 2026, 5:11 p.m. OK PyPy 3-64 TESTS 7 781 44441600
364725864 omkarthote2006 F Feb. 27, 2026, 4:32 p.m. OK Python 3 TESTS 7 1046 92569600
364733066 Sasha193 F Feb. 27, 2026, 4:49 p.m. OK Python 3 TESTS 7 1109 72806400
364730505 hachiko2026 F Feb. 27, 2026, 4:43 p.m. OK Ruby 3 TESTS 7 1421 212787200
364730126 vanshit F Feb. 27, 2026, 4:42 p.m. OK Rust 2024 TESTS 7 109 21708800
364739269 pohzipohzi F Feb. 27, 2026, 5:25 p.m. OK Rust 2024 TESTS 7 250 14336000

remove filters

Back to search problems