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 |
|---|---|---|---|---|---|---|
| 704 | Codeforces Round 366 (Div. 1) | FINISHED | False | 7200 | 305826923 | Aug. 7, 2016, 2:05 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 524 ) | C | Black Widow | PROGRAMMING | dp graphs implementation math | 2800 |
Natalia Romanova is trying to test something on the new gun S.H.I.E.L.D gave her. In order to determine the result of the test, she needs to find the number of answers to a certain equation. The equation is of form: Where represents logical OR and represents logical exclusive OR (XOR), and v i , j are some boolean variables or their negations. Natalia calls the left side of the equation a XNF formula. Each statement in brackets is called a clause, and v i , j are called literals. In the equation Natalia has, the left side is actually a 2-XNF-2 containing variables x 1 , x 2 , ..., x m and their negations. An XNF formula is 2-XNF-2 if: For each 1 ≤ i ≤ n , k i ≤ 2 , i.e. the size of each clause doesn't exceed two. Each variable occurs in the formula at most two times (with negation and without negation in total). Please note that it's possible that a variable occurs twice but its negation doesn't occur in any clause (or vice versa). Natalia is given a formula of m variables, consisting of n clauses. Please, make sure to check the samples in order to properly understand how the formula looks like. Natalia is more into fight than theory, so she asked you to tell her the number of answers to this equation. More precisely, you need to find the number of ways to set x 1 , ..., x m with true and false (out of total of 2 m ways) so that the equation is satisfied. Since this number can be extremely large, you need to print the answer modulo 10 9 + 7 . Please, note that some variable may appear twice in one clause, or not appear in the equation at all (but still, setting it to false or true gives different ways to set variables). The first line of input contains two integers n and m ( 1 ≤ n , m ≤ 100 000 ) — the number of clauses and the number of variables respectively. The next n lines contain the formula. The i -th of them starts with an integer k i — the number of literals in the i -th clause. It is followed by k i non-zero integers a i , 1 , ..., a i , k i . If |
| Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 27574897 | Chloe_fan | C | June 5, 2017, 3:35 a.m. | OK | GNU C++ | TESTS | 74 | 31 | 6860800 | 2800 | |
| 20046290 | Talon_F | C | Aug. 22, 2016, 12:52 p.m. | OK | GNU C++ | TESTS | 74 | 31 | 11878400 | 2800 | |
| 27575848 | Skytemple | C | June 5, 2017, 5:04 a.m. | OK | GNU C++ | TESTS | 74 | 46 | 2048000 | 2800 | |
| 40983909 | ReaLNero1 | C | July 30, 2018, 7:06 p.m. | OK | GNU C++ | TESTS | 74 | 46 | 6860800 | 2800 | |
| 26302362 | jiyutian | C | April 11, 2017, 3:12 p.m. | OK | GNU C++ | TESTS | 74 | 46 | 10342400 | 2800 | |
| 26801680 | stonepage | C | May 2, 2017, 12:10 p.m. | OK | GNU C++ | TESTS | 74 | 46 | 51712000 | 2800 | |
| 34218868 | ONION_CYC | C | Jan. 16, 2018, 10:34 a.m. | OK | GNU C++ | TESTS | 74 | 46 | 54272000 | 2800 | |
| 27575753 | alex-china | C | June 5, 2017, 4:56 a.m. | OK | GNU C++ | TESTS | 74 | 62 | 24985600 | 2800 | |
| 34480791 | yasugongshang | C | Jan. 23, 2018, 12:01 p.m. | OK | GNU C++ | TESTS | 74 | 62 | 54272000 | 2800 | |
| 27578578 | snowflake | C | June 5, 2017, 8:22 a.m. | OK | GNU C++ | TESTS | 74 | 77 | 17100800 | 2800 | |
| 27574962 | llgyc | C | June 5, 2017, 3:40 a.m. | OK | GNU C++11 | TESTS | 74 | 31 | 9420800 | 2800 | |
| 20544492 | rxdoi | C | Sept. 12, 2016, 7:29 a.m. | OK | GNU C++11 | TESTS | 74 | 46 | 20377600 | 2800 | |
| 36523222 | ohweonfire | C | March 23, 2018, 7:23 a.m. | OK | GNU C++11 | TESTS | 74 | 61 | 15155200 | 2800 | |
| 31179388 | SW_Wind | C | Oct. 10, 2017, 1:15 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 6860800 | 2800 | |
| 64194849 | m_she | C | Nov. 4, 2019, 9:15 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 6963200 | 2800 | |
| 66161572 | XieRujian | C | Dec. 2, 2019, 4:55 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 7987200 | 2800 | |
| 55558509 | RedStar_13 | C | June 14, 2019, 11:14 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 11059200 | 2800 | |
| 36523547 | FizzyDavid | C | March 23, 2018, 7:37 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 19148800 | 2800 | |
| 38583699 | _Sakits | C | May 24, 2018, 10:56 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 47411200 | 2800 | |
| 54503311 | WOSHIGEPACHONG2 | C | May 23, 2019, 12:59 a.m. | OK | GNU C++11 | TESTS | 74 | 62 | 52224000 | 2800 | |
| 65022823 | Created_equal | C | Nov. 15, 2019, 6:10 a.m. | OK | GNU C++14 | TESTS | 74 | 78 | 11673600 | 2800 | |
| 50338801 | Jester | C | Feb. 22, 2019, 11:50 p.m. | OK | GNU C++14 | TESTS | 74 | 108 | 9318400 | 2800 | |
| 23913352 | WuHongxun | C | Jan. 18, 2017, 2:57 a.m. | OK | GNU C++14 | TESTS | 74 | 109 | 7680000 | 2800 | |
| 66301574 | zsyzsy | C | Dec. 5, 2019, 7:28 a.m. | OK | GNU C++14 | TESTS | 74 | 109 | 11776000 | 2800 | |
| 31179392 | zhzh2001 | C | Oct. 10, 2017, 1:15 a.m. | OK | GNU C++14 | TESTS | 74 | 109 | 20787200 | 2800 | |
| 28529497 | platypus179 | C | July 13, 2017, 7:45 p.m. | OK | GNU C++14 | TESTS | 74 | 109 | 33280000 | 2800 | |
| 66549944 | newbiegcz | C | Dec. 9, 2019, 2:30 p.m. | OK | GNU C++14 | TESTS | 74 | 124 | 6246400 | 2800 | |
| 64194963 | star_magic_young | C | Nov. 4, 2019, 9:18 a.m. | OK | GNU C++14 | TESTS | 74 | 124 | 6860800 | 2800 | |
| 68743741 | cz_xuyixuan | C | Jan. 14, 2020, 3:09 a.m. | OK | GNU C++14 | TESTS | 74 | 124 | 7577600 | 2800 | |
| 63758246 | Rubbish12345 | C | Oct. 30, 2019, 1:32 a.m. | OK | GNU C++14 | TESTS | 74 | 124 | 9420800 | 2800 | |
| 68391616 | HirasawaaYui | C | Jan. 8, 2020, 8:54 a.m. | OK | GNU C++17 | TESTS | 74 | 93 | 13107200 | 2800 | |
| 64872254 | jiangly | C | Nov. 14, 2019, 8:34 a.m. | OK | GNU C++17 | TESTS | 74 | 109 | 5324800 | 2800 | |
| 63623611 | alan_cty | C | Oct. 28, 2019, 1:41 a.m. | OK | GNU C++17 | TESTS | 74 | 109 | 10137600 | 2800 | |
| 69035312 | hjk1030 | C | Jan. 18, 2020, 8:55 a.m. | OK | GNU C++17 | TESTS | 74 | 109 | 18329600 | 2800 | |
| 64453278 | cold_chair | C | Nov. 7, 2019, 7:52 a.m. | OK | GNU C++17 | TESTS | 74 | 109 | 19251200 | 2800 | |
| 67948506 | AprilGrimoire | C | Dec. 30, 2019, 6:36 a.m. | OK | GNU C++17 | TESTS | 74 | 140 | 10444800 | 2800 | |
| 66214439 | Infleaking | C | Dec. 3, 2019, 8:18 a.m. | OK | GNU C++17 | TESTS | 74 | 156 | 10342400 | 2800 | |
| 57467160 | INVWVZ | C | July 21, 2019, 4:05 p.m. | OK | GNU C++17 | TESTS | 74 | 171 | 28774400 | 2800 | |
| 57325131 | Smaug | C | July 19, 2019, 11:47 a.m. | OK | GNU C++17 | TESTS | 74 | 187 | 29081600 | 2800 | |
| 57325193 | Smaug | C | July 19, 2019, 11:49 a.m. | OK | GNU C++17 | TESTS | 74 | 202 | 29081600 | 2800 | |
| 19707928 | mmaxio | C | Aug. 7, 2016, 3:50 p.m. | OK | Java 8 | TESTS | 74 | 389 | 41062400 | 2800 | |
| 19705915 | uwi | C | Aug. 7, 2016, 3:35 p.m. | OK | Java 8 | TESTS | 74 | 405 | 39116800 | 2800 | |
| 20035624 | JialinOuyang | C | Aug. 21, 2016, 10:18 p.m. | OK | Java 8 | TESTS | 74 | 451 | 46592000 | 2800 | |
| 20034988 | JialinOuyang | C | Aug. 21, 2016, 9:18 p.m. | OK | Java 8 | TESTS | 74 | 467 | 46592000 | 2800 | |
| 20033842 | JialinOuyang | C | Aug. 21, 2016, 7:47 p.m. | OK | Java 8 | TESTS | 74 | 467 | 46592000 | 2800 | |
| 20034893 | JialinOuyang | C | Aug. 21, 2016, 9:09 p.m. | OK | Java 8 | TESTS | 74 | 530 | 50483200 | 2800 | |
| 19735352 | azukun | C | Aug. 8, 2016, 7:33 p.m. | OK | MS C# | TESTS | 74 | 327 | 25804800 | 2800 | |
| 19735320 | azukun | C | Aug. 8, 2016, 7:30 p.m. | OK | MS C# | TESTS | 74 | 343 | 25702400 | 2800 | |
| 26348930 | Los_Angelos_Laycurse | C | April 14, 2017, 1 a.m. | OK | MS C++ | TESTS | 74 | 109 | 13107200 | 2800 |
Back to search problems