Educational Codeforces Round 175 (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
2070 Educational Codeforces Round 175 (Rated for Div. 2) FINISHED False 7200 35738723 Feb. 27, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 367 ) F Friends and Pizza PROGRAMMING

Monocarp has (n) pizzas, the (i)-th pizza consists of (a_i) slices. Pizzas are denoted by uppercase Latin letters from A to the (n)-th letter of the Latin alphabet. Monocarp also has (m) friends, and he wants to invite exactly two of them to eat pizza. For each friend, Monocarp knows which pizzas that friend likes. After the friends arrive at Monocarp's house, for each pizza, the following happens: if the pizza is not liked by any of the two invited friends, Monocarp eats it; if the pizza is liked by exactly one of the two invited friends, that friend eats it; and if the pizza is liked by both friends, they try to split it. If it consists of an even number of slices, they both eat exactly half of the slices. But if the pizza consists of an odd number of slices, they start quarrelling, trying to decide who will eat an extra slice — and Monocarp doesn't like that. For each (k) from (0) to (\sum a_i), calculate the number of ways to choose exactly two friends to invite so that the friends don't quarrel, and Monocarp eats exactly (k) slices. The first line contains two integers (n) and (m) ((1 \le n \le 20); (2 \le m \le 5 \cdot 10^5)) — the number of pizzas and the number of friends, respectively. The second line contains (m) strings (s_1, s_2, \dots, s_m) ((1 \le |s_i| \le n)), where (s_i) is a string consisting of distinct characters from A to the (n)-th letter of the Latin alphabet, denoting which pizzas the (i)-th friend likes. In every string (s_i), the characters are sorted in lexicographical (alphabetic) order. The third line contains (n) integers (a_1, a_2, \dots, a_n) ((1 \le a_i \le 2 \cdot 10^4)) — the sizes of the pizzas. Print (\sum a_i + 1) integers, where the (k)-th integer (starting from (0)) should be the number of ways to choose exactly two friends to invite so that the friends don't quarrel, and Monocarp eats exactly (k) slices. Let's

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
308219301 thangdz2k7 F Feb. 28, 2025, 3:20 a.m. OK C++17 (GCC 7-32) TESTS 72 2140 277401600
308431977 anirudh1317 F March 1, 2025, 2:39 a.m. OK C++17 (GCC 7-32) TESTS 72 2202 271667200
308212341 Noche_6 F Feb. 28, 2025, 12:53 a.m. OK C++17 (GCC 7-32) TESTS 72 2702 272076800
308192890 nishkarsh F Feb. 27, 2025, 7:11 p.m. OK C++17 (GCC 7-32) TESTS 72 2718 274636800
308195063 mina500 F Feb. 27, 2025, 7:33 p.m. OK C++17 (GCC 7-32) TESTS 72 3108 386662400
308425631 coldminded F March 1, 2025, 12:46 a.m. OK C++17 (GCC 7-32) TESTS 72 3592 362496000
308204813 gentleman.1 F Feb. 27, 2025, 9:45 p.m. OK C++17 (GCC 7-32) TESTS 72 3718 408371200
308187393 HeartBlueArchive F Feb. 27, 2025, 6:19 p.m. OK C++17 (GCC 7-32) TESTS 72 3734 382464000
308212232 Noche_6 F Feb. 28, 2025, 12:50 a.m. OK C++17 (GCC 7-32) TESTS 72 3781 360243200
308221753 MintCat F Feb. 28, 2025, 4:02 a.m. OK C++17 (GCC 7-32) TESTS 72 4234 362188800
308219192 thangdz2k7 F Feb. 28, 2025, 3:18 a.m. OK C++20 (GCC 13-64) TESTS 72 1546 277401600
308219062 thangdz2k7 F Feb. 28, 2025, 3:17 a.m. OK C++20 (GCC 13-64) TESTS 72 1578 277401600
308218793 thangdz2k7 F Feb. 28, 2025, 3:12 a.m. OK C++20 (GCC 13-64) TESTS 72 1686 277401600
308263292 SUPHUB F Feb. 28, 2025, 11:02 a.m. OK C++20 (GCC 13-64) TESTS 72 1781 271667200
308181929 RexLapis F Feb. 27, 2025, 5:37 p.m. OK C++20 (GCC 13-64) TESTS 72 1781 271667200
308222465 thangdz2k7 F Feb. 28, 2025, 4:14 a.m. OK C++20 (GCC 13-64) TESTS 72 1812 277401600
308239783 DQ1275 F Feb. 28, 2025, 7:45 a.m. OK C++20 (GCC 13-64) TESTS 72 1968 197017600
308219522 thangdz2k7 F Feb. 28, 2025, 3:24 a.m. OK C++20 (GCC 13-64) TESTS 72 2046 365670400
308202540 kaiboy F Feb. 27, 2025, 9:07 p.m. OK C++20 (GCC 13-64) TESTS 72 2312 184012800
308234911 JaberSH1 F Feb. 28, 2025, 7:01 a.m. OK C++20 (GCC 13-64) TESTS 72 2343 268595200
308235309 JoesSR F Feb. 28, 2025, 7:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 72 1671 364646400
308219445 thangdz2k7 F Feb. 28, 2025, 3:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 72 1749 277401600
308194737 rewhile F Feb. 27, 2025, 7:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 72 1937 369459200
308249446 424479543 F Feb. 28, 2025, 9:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 72 1999 375091200
308248907 424479543 F Feb. 28, 2025, 9:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 72 2186 374988800
308273118 RGB_ICPC6 F Feb. 28, 2025, 12:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 72 2327 381235200
308445488 slashTeen F March 1, 2025, 5:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 72 2467 186572800
308190426 SSerxhs F Feb. 27, 2025, 6:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 72 2640 370688000
308231272 aa2315 F Feb. 28, 2025, 6:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 72 2718 378060800
308192481 MeIoN_is_UMP45 F Feb. 27, 2025, 7:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 72 2734 366694400
308263669 pandeydevil0802 F Feb. 28, 2025, 11:05 a.m. OK Java 21 TESTS 72 3577 437350400
308215059 smilences F Feb. 28, 2025, 1:56 a.m. OK PyPy 3-64 TESTS 72 7624 470937600
308220996 ss104200hamidj F Feb. 28, 2025, 3:49 a.m. OK PyPy 3-64 TESTS 72 7640 198041600
308219088 smilences F Feb. 28, 2025, 3:17 a.m. OK PyPy 3-64 TESTS 72 7640 198041600

remove filters

Back to search problems