Educational Codeforces Round 186 (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
2182 Educational Codeforces Round 186 (Rated for Div. 2) FINISHED False 7200 9386723 Dec. 29, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 5504 ) E New Year's Gifts PROGRAMMING data structures greedy implementation sortings two pointers

Monocarp has (n) friends and decided to give a New Year's gift to each of them. He has also prepared (m) boxes to place the gifts in; the beauty of the (i)-th box is (a_i). Every box can contain at most one gift. Monocarp wants to give a gift worth at least (y_i) coins to the (i)-th friend. Additionally, he knows that the (i)-th friend will be happy if at least one of the following conditions holds: the gift is in a box with beauty at least (x_i); the gift is worth at least (z_i) ((z_i > y_i)). Your task is to help Monocarp calculate the maximum possible number of friends he can make happy if he has (k) coins. Note that Monocarp must purchase a gift for each friend, and the gift may not necessarily come in a box . The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The first line of each test case contains three integers (n), (m) and (k) ((1 \le n, m \le 2 \cdot 10^5); (1 \le k \le 10^{15})). The second line contains (m) integers (a_1, a_2, \dots, a_m) ((1 \le a_i \le m)). Then (n) lines follow; the (i)-th of them contains three integers (x_i), (y_i) and (z_i) ((1 \le x_i \le m); (1 \le y_i < z_i \le 10^9)). Additional constraints on the input: (\sum\limits_{i=1}^{n} y_i \le k). the sum of (n) over all test cases doesn't exceed (2 \cdot 10^5); the sum of (m) over all test cases doesn't exceed (2 \cdot 10^5); For each test case, print a single integer — the maximum possible number of friends Monocarp can make happy if he has (k) coins. In the first example, Monocarp can make both friends happy as follows: give the first friend a gift for (3) coins, and give the second friend a gift for (2) coins in a box with (1) beauty. In the second example, Monocarp cannot make any of his friends happy, because he does not have enough money to buy a gift for (z_i) coins for even o

Tutorials

Educational Codeforces Round 186 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
355866799 Aknoi_xlj E Dec. 30, 2025, 11:38 a.m. OK C++17 (GCC 7-32) TESTS 26 218 1638400
355947159 Njasoo E Dec. 31, 2025, 6:07 a.m. OK C++17 (GCC 7-32) TESTS 26 234 1126400
355862168 prakhar7472pk E Dec. 30, 2025, 10:56 a.m. OK C++17 (GCC 7-32) TESTS 26 234 1126400
355866354 JakobZ E Dec. 30, 2025, 11:33 a.m. OK C++17 (GCC 7-32) TESTS 26 234 1740800
355869328 little_happy E Dec. 30, 2025, 12:01 p.m. OK C++17 (GCC 7-32) TESTS 26 234 1843200
355874629 CloudDreamLaker E Dec. 30, 2025, 12:53 p.m. OK C++17 (GCC 7-32) TESTS 26 234 3686400
355880911 Xiao_Yu E Dec. 30, 2025, 1:48 p.m. OK C++17 (GCC 7-32) TESTS 26 234 3891200
355859991 tabishfarhan853 E Dec. 30, 2025, 10:36 a.m. OK C++17 (GCC 7-32) TESTS 26 234 3891200
355867114 rohitsk1 E Dec. 30, 2025, 11:40 a.m. OK C++17 (GCC 7-32) TESTS 26 234 4300800
355810003 raaz7 E Dec. 29, 2025, 9:14 p.m. OK C++17 (GCC 7-32) TESTS 26 250 409600
355887860 chirva E Dec. 30, 2025, 2:49 p.m. OK C++20 (GCC 13-64) TESTS 26 171 3276800
355849814 IneedHELPpls E Dec. 30, 2025, 8:57 a.m. OK C++20 (GCC 13-64) TESTS 26 187 8806400
355926943 Hussein_Yasser E Dec. 30, 2025, 10:04 p.m. OK C++20 (GCC 13-64) TESTS 26 187 11468800
355920019 higino E Dec. 30, 2025, 7:49 p.m. OK C++20 (GCC 13-64) TESTS 26 203 1638400
355861924 Inkyo E Dec. 30, 2025, 10:54 a.m. OK C++20 (GCC 13-64) TESTS 26 203 2764800
355829543 nishant_hardy E Dec. 30, 2025, 4:59 a.m. OK C++20 (GCC 13-64) TESTS 26 203 5120000
355942594 noya2 E Dec. 31, 2025, 5:01 a.m. OK C++20 (GCC 13-64) TESTS 26 203 6451200
355911683 BlueMoon. E Dec. 30, 2025, 6:12 p.m. OK C++20 (GCC 13-64) TESTS 26 203 7475200
355797764 kurkure_momos E Dec. 29, 2025, 6:28 p.m. OK C++20 (GCC 13-64) TESTS 26 203 8192000
355804528 brUhdhanmantri E Dec. 29, 2025, 7:45 p.m. OK C++20 (GCC 13-64) TESTS 26 203 9318400
355817587 EternalHeart1314 E Dec. 30, 2025, 12:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 140 7475200
355870455 Sofapuden E Dec. 30, 2025, 12:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 171 2867200
355929031 turkhuu622 E Dec. 30, 2025, 11:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 171 3584000
355838216 riz82 E Dec. 30, 2025, 7:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 171 6041600
355819959 LHaooo E Dec. 30, 2025, 1:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 1331200
355897121 C4ndY E Dec. 30, 2025, 4:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 3584000
355930277 Cjx E Dec. 30, 2025, 11:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 5222400
355826095 TempestMiku E Dec. 30, 2025, 3:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 5222400
355804470 MN3M E Dec. 29, 2025, 7:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 5324800
355894927 lizeeee E Dec. 30, 2025, 3:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 187 5734400
355894615 Leeeee E Dec. 30, 2025, 3:48 p.m. OK Go TESTS 26 453 17612800
355827058 NanDemo E Dec. 30, 2025, 4:16 a.m. OK Java 21 TESTS 26 515 19251200
355796130 Orange905 E Dec. 29, 2025, 6:13 p.m. OK Java 21 TESTS 26 593 31027200
355838892 NpHardcore_05 E Dec. 30, 2025, 7:15 a.m. OK Java 21 TESTS 26 656 18227200
355884315 Aayush.07 E Dec. 30, 2025, 2:18 p.m. OK Java 21 TESTS 26 718 19148800
355794288 Orange905 E Dec. 29, 2025, 5:57 p.m. OK Java 21 TESTS 26 734 34713600
355812241 tobiiiii E Dec. 29, 2025, 10:04 p.m. OK Java 21 TESTS 26 765 5734400
355942002 dzhi E Dec. 31, 2025, 4:50 a.m. OK Java 21 TESTS 26 796 27238400
355819981 man-ray E Dec. 30, 2025, 1:50 a.m. OK Java 21 TESTS 26 812 18944000
355874545 Shreerangss E Dec. 30, 2025, 12:53 p.m. OK Java 21 TESTS 26 843 19763200
355898030 icpc_loser E Dec. 30, 2025, 4:17 p.m. OK Java 21 TESTS 26 859 35020800
355927611 leonlian E Dec. 30, 2025, 10:22 p.m. OK Java 8 TESTS 26 421 12902400
355803173 golions E Dec. 29, 2025, 7:29 p.m. OK Java 8 TESTS 26 828 11878400
355925032 leetgoat_dot_dev E Dec. 30, 2025, 9:21 p.m. OK PyPy 3 TESTS 26 1203 67686400
355924993 leetgoat_dot_dev E Dec. 30, 2025, 9:20 p.m. OK PyPy 3 TESTS 26 1265 67686400
355851085 DKA_X.VII E Dec. 30, 2025, 9:10 a.m. OK PyPy 3 TESTS 26 1968 34918400
355820223 Code.Virtuoso E Dec. 30, 2025, 1:57 a.m. OK PyPy 3 TESTS 26 2000 21811200
355797578 smz.26 E Dec. 29, 2025, 6:26 p.m. OK PyPy 3-64 TESTS 26 421 37376000
355796625 OAY71011 E Dec. 29, 2025, 6:18 p.m. OK PyPy 3-64 TESTS 26 515 37888000
355937261 bentengly E Dec. 31, 2025, 3:12 a.m. OK PyPy 3-64 TESTS 26 625 37273600
355876726 iwonit E Dec. 30, 2025, 1:12 p.m. OK PyPy 3-64 TESTS 26 656 36659200
355935110 bentengly E Dec. 31, 2025, 2:27 a.m. OK PyPy 3-64 TESTS 26 671 36659200
355797719 cappucciyes E Dec. 29, 2025, 6:28 p.m. OK PyPy 3-64 TESTS 26 718 30208000
355850984 Little_Sheep_Yawn E Dec. 30, 2025, 9:09 a.m. OK PyPy 3-64 TESTS 26 718 37478400
355824135 cz_more E Dec. 30, 2025, 3:20 a.m. OK PyPy 3-64 TESTS 26 734 105676800
355847861 von2401 E Dec. 30, 2025, 8:39 a.m. OK PyPy 3-64 TESTS 26 765 39116800
355857186 gardengnome E Dec. 30, 2025, 10:09 a.m. OK PyPy 3-64 TESTS 26 812 37478400
355871941 hhu_yjh E Dec. 30, 2025, 12:27 p.m. OK Python 3 TESTS 26 1046 114892800
355827162 hk_patel_9118 E Dec. 30, 2025, 4:18 a.m. OK Python 3 TESTS 26 1937 50892800
355790728 DreadedHippy E Dec. 29, 2025, 5:23 p.m. OK Rust 2021 TESTS 26 140 14131200
355945200 Spheniscine E Dec. 31, 2025, 5:42 a.m. OK Rust 2021 TESTS 26 203 11366400
355800580 silicalet E Dec. 29, 2025, 6:59 p.m. OK Rust 2024 TESTS 26 218 6246400

remove filters

Back to search problems