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 |
---|---|---|---|---|---|---|
1735 | Codeforces Round 824 (Div. 2) | FINISHED | False | 8100 | 67101899 | Oct. 2, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5551 ) | D | Meta-set | PROGRAMMING | brute force combinatorics data structures hashing math |
B'You like the card board game "Set". Each card contains k features, each of which is equal to a value from the set {0, 1, 2 } . The deck contains all possible variants of cards, that is, there are 3^k different cards in total. A feature for three cards is called good if it is the same for these cards or pairwise distinct. Three cards are called a set if all k features are good for them. For example, the cards (0, 0, 0) , (0, 2, 1) , and (0, 1, 2) form a set, but the cards (0, 2, 2) , (2, 1, 2) , and (1, 2, 0) do not, as, for example, the last feature is not good. A group of five cards is called a meta-set, if there is strictly more than one set among them. How many meta-sets there are among given n distinct cards? The first line of the input contains two integers n and k ( 1 <= n <= 10^3 , 1 <= k <= 20 ) -- the number of cards on a table and the number of card features. The description of the cards follows in the next n lines. Each line describing a card contains k integers c_{i, 1}, c_{i, 2}, ldots, c_{i, k} ( 0 <= c_{i, j} <= 2 ) -- card features. It is guaranteed that all cards are distinct. Output one integer -- the number of meta-sets. Let 's draw the cards indicating the first four features. The first feature will indicate the number of objects on a card: 1 , 2 , 3 . The second one is the color: red, green, purple. The third is the shape: oval, diamond, squiggle. The fourth is filling: open, striped, solid. You can see the first three tests below. For the first two tests, the meta-sets are highlighted. In the first test, the only meta-set is the five cards (0000, 0001, 0002, 0010, 0020) . The sets in it are the triples (0000, 0001, 0002) and (0000, 0010, 0020) . Also, a set is the triple (0100, 1000, 2200) which does not belong to any meta-set. In the second test, the following groups of fiv'... |
Codeforces Round #824 — editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
174416587 | DmitriyAnikeyev | D | Oct. 2, 2022, 4:05 p.m. | OK | C# 10 | TESTS | 51 | 124 | 5529600 | ||
174423736 | LostTemple | D | Oct. 2, 2022, 4:33 p.m. | OK | C# 10 | TESTS | 51 | 186 | 37990400 | ||
174461002 | TEoS | D | Oct. 3, 2022, 2:41 a.m. | OK | GNU C++14 | TESTS | 54 | 46 | 307200 | ||
174414768 | TEoS | D | Oct. 2, 2022, 3:59 p.m. | OK | GNU C++14 | TESTS | 51 | 46 | 307200 | ||
174420553 | 2022hanscome | D | Oct. 2, 2022, 4:20 p.m. | OK | GNU C++14 | TESTS | 51 | 46 | 409600 | ||
174459133 | TEoS | D | Oct. 3, 2022, 2:02 a.m. | OK | GNU C++14 | TESTS | 54 | 61 | 307200 | ||
174432854 | Catmeat | D | Oct. 2, 2022, 5:34 p.m. | OK | GNU C++14 | TESTS | 51 | 62 | 307200 | ||
174417122 | _mr__robot_ | D | Oct. 2, 2022, 4:07 p.m. | OK | GNU C++14 | TESTS | 51 | 62 | 307200 | ||
174420204 | Obsession_de_Population | D | Oct. 2, 2022, 4:19 p.m. | OK | GNU C++14 | TESTS | 51 | 62 | 921600 | ||
174415292 | LBRhhhh | D | Oct. 2, 2022, 4 p.m. | OK | GNU C++14 | TESTS | 51 | 62 | 1740800 | ||
174427233 | Saber__Master | D | Oct. 2, 2022, 4:46 p.m. | OK | GNU C++14 | TESTS | 51 | 62 | 8089600 | ||
174414618 | blade_dance | D | Oct. 2, 2022, 3:58 p.m. | OK | GNU C++14 | TESTS | 51 | 62 | 20172800 |
Back to search problems