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 |
---|---|---|---|---|---|---|
1552 | Codeforces Global Round 15 | FINISHED | False | 9900 | 110129111 | July 25, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 130 ) | I | Organizing a Music Festival | PROGRAMMING | dfs and similar math |
B'You are the organizer of the famous "Zurich Music Festival". There will be n singers who will perform at the festival, identified by the integers 1 , 2 , ... , n . You must choose in which order they are going to perform on stage. You have m friends and each of them has a set of favourite singers. More precisely, for each 1 <= i <= m , the i -th friend likes singers s_{i,1}, , s_{i, 2}, , ... , ,s_{i, q_i} . A friend of yours is happy if the singers he likes perform consecutively (in an arbitrary order). An ordering of the singers is valid if it makes all your friends happy. Compute the number of valid orderings modulo 998 ,244 ,353 . The first line contains two integers n and m ( 1 <= n, ,m <= 100 ) -- the number of singers and the number of friends correspondingly. The i -th of the next m lines contains the integer q_i ( 1 <= q_i <= n ) -- the number of favorite singers of the i -th friend xe2 x80 x93 followed by the q_i integers s_{i,1}, , s_{i, 2}, , ... , ,s_{i, q_i} ( 1 <= s_{i,1}<s_{i,2}< cdots<s_{i,q_i} <= n ) -- the indexes of his favorite singers. Print the number of valid orderings of the singers modulo 998 ,244 ,353 . Explanation of the first sample: There are 3 singers and only 1 friend. The friend likes the two singers 1 and 3 . Thus, the 4 valid orderings are: Explanation of the second sample: There are 5 singers and 5 friends. One can show that no ordering is valid. Explanation of the third sample: There are 100 singers and only 1 friend. The friend likes only singer 50 , hence all the 100! possible orderings are valid. Explanation of the fourth sample: There are 5 singers and only 1 friend. The friend likes all the singers, hence all the 5!=120 possible orderings are valid. '... |
Editorial of Global Round 15 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
123771718 | rainboy | I | July 25, 2021, 6:24 p.m. | OK | GNU C11 | TESTS | 162 | 31 | 3788800 | ||
123771499 | rainboy | I | July 25, 2021, 6:21 p.m. | OK | GNU C11 | TESTS | 162 | 46 | 3788800 | ||
123784892 | BSBandme | I | July 26, 2021, 12:09 a.m. | OK | GNU C++14 | TESTS | 162 | 31 | 4403200 | ||
123793350 | show_karthi | I | July 26, 2021, 3:36 a.m. | OK | GNU C++14 | TESTS | 162 | 46 | 8192000 | ||
123781735 | Radewoosh | I | July 25, 2021, 10:03 p.m. | OK | GNU C++14 | TESTS | 162 | 233 | 43315200 | ||
123790715 | ugly2333 | I | July 26, 2021, 2:44 a.m. | OK | GNU C++17 | TESTS | 162 | 31 | 3788800 | ||
123762192 | skywalkert | I | July 25, 2021, 5:01 p.m. | OK | GNU C++17 | TESTS | 162 | 31 | 3993600 | ||
123771467 | cip999 | I | July 25, 2021, 6:21 p.m. | OK | GNU C++17 | TESTS | 162 | 31 | 4096000 | ||
123779700 | SpyCheese | I | July 25, 2021, 8:59 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 4403200 | ||
123761155 | aid | I | July 25, 2021, 4:56 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 4403200 | ||
123758281 | kefaa2 | I | July 25, 2021, 4:44 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 4710400 | ||
123754854 | never_giveup | I | July 25, 2021, 4:30 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 4915200 | ||
123770232 | yosupo | I | July 25, 2021, 6:07 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 4915200 | ||
123773256 | infint | I | July 25, 2021, 6:47 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 5939200 | ||
123769177 | Egor.Lifar | I | July 25, 2021, 5:59 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 8601600 | ||
123755986 | Benq | I | July 25, 2021, 4:34 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 46 | 13824000 | ||
123769296 | heno239 | I | July 25, 2021, 6 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 77 | 4915200 | ||
123778379 | Benq | I | July 25, 2021, 8:26 p.m. | OK | GNU C++17 (64) | TESTS | 162 | 312 | 4505600 | ||
123780006 | mmaxio | I | July 25, 2021, 9:08 p.m. | OK | Java 11 | TESTS | 162 | 187 | 23756800 | ||
123771757 | eatmore | I | July 25, 2021, 6:25 p.m. | OK | Java 11 | TESTS | 162 | 390 | 24473600 |
Back to search problems