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 |
|---|---|---|---|---|---|---|
| 231 | Codeforces Round 143 (Div. 2) | FINISHED | False | 7200 | 426781823 | Oct. 7, 2012, 3:30 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2310 ) | E | Cactus | PROGRAMMING | data structures dfs and similar dp graphs trees | 2400 |
A connected undirected graph is called a vertex cactus , if each vertex of this graph belongs to at most one simple cycle. A simple cycle in a undirected graph is a sequence of distinct vertices v 1 , v 2 , ..., v t ( t > 2) , such that for any i (1 ≤ i < t ) exists an edge between vertices v i and v i + 1 , and also exists an edge between vertices v 1 and v t . A simple path in a undirected graph is a sequence of not necessarily distinct vertices v 1 , v 2 , ..., v t ( t > 0) , such that for any i (1 ≤ i < t ) exists an edge between vertices v i and v i + 1 and furthermore each edge occurs no more than once . We'll say that a simple path v 1 , v 2 , ..., v t starts at vertex v 1 and ends at vertex v t . You've got a graph consisting of n vertices and m edges, that is a vertex cactus. Also, you've got a list of k pairs of interesting vertices x i , y i , for which you want to know the following information — the number of distinct simple paths that start at vertex x i and end at vertex y i . We will consider two simple paths distinct if the sets of edges of the paths are distinct. For each pair of interesting vertices count the number of distinct simple paths between them. As this number can be rather large, you should calculate it modulo 1000000007 ( 10 9 + 7 ). The first line contains two space-separated integers n , m (2 ≤ n ≤ 10 5 ; 1 ≤ m ≤ 10 5 ) — the number of vertices and edges in the graph, correspondingly. Next m lines contain the description of the edges: the i -th line contains two space-separated integers a i , b i (1 ≤ a i , b i ≤ n ) — the indexes of the vertices connected by the i -th edge. The next line contains a single integer k (1 ≤ k ≤ 10 5 ) — the number of pairs of interesting vertices. Next k lines contain the list of pairs of interesting vertices: the i -th line contains two space-separated numbers x i , y i (1 ≤ x i , y i ≤ n ; x i ≠ y i ) — the indexes of interesting vertices in the i -th pair. It is guaranteed that the given gra |
| Tutorial Codeforces Round #143 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 40990655 | ReaLNero1 | E | July 31, 2018, 12:06 a.m. | OK | GNU C++ | TESTS | 42 | 218 | 12185600 | 2400 | |
| 39755110 | ema | E | June 29, 2018, 12:21 a.m. | OK | GNU C++ | TESTS | 42 | 934 | 23552000 | 2400 | |
| 39599395 | 5095187020216 | E | June 24, 2018, 10:51 a.m. | OK | GNU C++ | TESTS | 42 | 936 | 15462400 | 2400 | |
| 61738037 | rainboy | E | Oct. 2, 2019, 6:58 p.m. | OK | GNU C11 | TESTS | 42 | 996 | 11776000 | 2400 | |
| 61964354 | zhengrunzhe | E | Oct. 6, 2019, 8:25 a.m. | OK | GNU C++11 | TESTS | 42 | 124 | 9318400 | 2400 | |
| 61760893 | ZYyboT | E | Oct. 3, 2019, 7:04 a.m. | OK | GNU C++11 | TESTS | 42 | 154 | 39014400 | 2400 | |
| 61765059 | ZYyboT | E | Oct. 3, 2019, 8:20 a.m. | OK | GNU C++11 | TESTS | 42 | 154 | 39014400 | 2400 | |
| 57575158 | luojinyao | E | July 23, 2019, 6:44 a.m. | OK | GNU C++11 | TESTS | 42 | 154 | 53760000 | 2400 | |
| 61460896 | luogu_bot2 | E | Sept. 29, 2019, 8:30 a.m. | OK | GNU C++11 | TESTS | 42 | 186 | 71065600 | 2400 | |
| 54339477 | __23333 | E | May 18, 2019, 9:40 a.m. | OK | GNU C++11 | TESTS | 42 | 216 | 31948800 | 2400 | |
| 54489675 | WA_A_PLAYER | E | May 22, 2019, 2:52 p.m. | OK | GNU C++11 | TESTS | 42 | 218 | 25088000 | 2400 | |
| 54488485 | WA_A_PLAYER | E | May 22, 2019, 2:18 p.m. | OK | GNU C++11 | TESTS | 42 | 218 | 42188800 | 2400 | |
| 55711358 | tlnllkbp | E | June 18, 2019, 10:27 a.m. | OK | GNU C++11 | TESTS | 42 | 218 | 64716800 | 2400 | |
| 62335881 | y2823774827y | E | Oct. 11, 2019, 1:08 a.m. | OK | GNU C++11 | TESTS | 42 | 218 | 147148800 | 2400 | |
| 62051087 | alimagde | E | Oct. 7, 2019, 9:27 a.m. | OK | GNU C++14 | TESTS | 42 | 248 | 30720000 | 2400 | |
| 53863057 | marcosmicJack | E | May 7, 2019, 11:41 p.m. | OK | GNU C++14 | TESTS | 42 | 278 | 13926400 | 2400 | |
| 54965161 | FFjet | E | June 2, 2019, 6:05 a.m. | OK | GNU C++14 | TESTS | 42 | 280 | 11161600 | 2400 | |
| 58435814 | vjudge5 | E | Aug. 7, 2019, 1:49 p.m. | OK | GNU C++14 | TESTS | 42 | 280 | 45977600 | 2400 | |
| 66296228 | davidberard | E | Dec. 5, 2019, 4:33 a.m. | OK | GNU C++14 | TESTS | 42 | 310 | 14643200 | 2400 | |
| 51081406 | fblogy | E | March 9, 2019, 11:26 a.m. | OK | GNU C++14 | TESTS | 42 | 310 | 34611200 | 2400 | |
| 45217315 | xbb0720 | E | Nov. 2, 2018, 6:42 p.m. | OK | GNU C++14 | TESTS | 42 | 312 | 13926400 | 2400 | |
| 44451509 | ZNI | E | Oct. 17, 2018, 4:06 p.m. | OK | GNU C++14 | TESTS | 42 | 312 | 27648000 | 2400 | |
| 59773106 | bhaag_milkha | E | Aug. 30, 2019, 8:55 p.m. | OK | GNU C++14 | TESTS | 42 | 312 | 29081600 | 2400 | |
| 47371173 | tusg25 | E | Dec. 22, 2018, 2:21 p.m. | OK | GNU C++14 | TESTS | 42 | 340 | 21401600 | 2400 | |
| 56282842 | linkRs | E | June 29, 2019, 5:46 p.m. | OK | GNU C++17 | TESTS | 42 | 280 | 17715200 | 2400 | |
| 50758457 | AliShahali1382 | E | March 3, 2019, 6:12 p.m. | OK | GNU C++17 | TESTS | 42 | 310 | 17612800 | 2400 | |
| 56282332 | linkRs | E | June 29, 2019, 5:32 p.m. | OK | GNU C++17 | TESTS | 42 | 310 | 18329600 | 2400 | |
| 53888361 | vjudge5 | E | May 8, 2019, 8:23 p.m. | OK | GNU C++17 | TESTS | 42 | 312 | 14233600 | 2400 | |
| 56282225 | linkRs | E | June 29, 2019, 5:28 p.m. | OK | GNU C++17 | TESTS | 42 | 312 | 18329600 | 2400 | |
| 55942731 | hongzhiyin | E | June 22, 2019, 5:42 p.m. | OK | GNU C++17 | TESTS | 42 | 312 | 18636800 | 2400 | |
| 50812860 | Googal | E | March 5, 2019, 9:50 a.m. | OK | GNU C++17 | TESTS | 42 | 342 | 16998400 | 2400 | |
| 41062410 | crathva | E | July 31, 2018, 5:15 p.m. | OK | GNU C++17 | TESTS | 42 | 342 | 17203200 | 2400 | |
| 56282460 | linkRs | E | June 29, 2019, 5:35 p.m. | OK | GNU C++17 | TESTS | 42 | 342 | 17715200 | 2400 | |
| 67513159 | golikovnik | E | Dec. 24, 2019, 9:54 a.m. | OK | GNU C++17 | TESTS | 42 | 342 | 18124800 | 2400 | |
| 65430784 | Musin | E | Nov. 20, 2019, noon | OK | Java 11 | TESTS | 42 | 872 | 37580800 | 2400 | |
| 69189408 | zhanyi_xiaolu | E | Jan. 20, 2020, 1:02 p.m. | OK | Java 11 | TESTS | 42 | 1184 | 78643200 | 2400 | |
| 69189268 | zhanyi_xiaolu | E | Jan. 20, 2020, 12:59 p.m. | OK | Java 11 | TESTS | 42 | 1216 | 78745600 | 2400 | |
| 56456472 | SpargelTarzan | E | July 3, 2019, 4:17 a.m. | OK | Java 8 | TESTS | 42 | 1120 | 68096000 | 2400 | |
| 61738038 | Dukkha | E | Oct. 2, 2019, 6:58 p.m. | OK | Java 8 | TESTS | 42 | 1278 | 7987200 | 2400 | |
| 45217553 | vjudge5 | E | Nov. 2, 2018, 6:50 p.m. | OK | MS C++ | TESTS | 42 | 310 | 14848000 | 2400 | |
| 45217350 | vjudge4 | E | Nov. 2, 2018, 6:43 p.m. | OK | MS C++ | TESTS | 42 | 342 | 14848000 | 2400 | |
| 65715230 | Tampere | E | Nov. 25, 2019, 4:15 p.m. | OK | MS C++ | TESTS | 42 | 1404 | 184320000 | 2400 | |
| 65728095 | Tampere | E | Nov. 26, 2019, 2:12 a.m. | OK | MS C++ | TESTS | 42 | 1496 | 184320000 | 2400 |
Back to search problems