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 |
---|---|---|---|---|---|---|
1111 | CodeCraft-19 and Codeforces Round 537 (Div. 2) | FINISHED | False | 7200 | 188317523 | Feb. 3, 2019, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 962 ) | E | Tree | PROGRAMMING | data structures dfs and similar dp graphs trees | 2800 |
B"You are given a tree with n nodes and q queries. Every query starts with three integers k , m and r , followed by k nodes of the tree a_1, a_2, ldots, a_k . To answer a query, assume that the tree is rooted at r . We want to divide the k given nodes into at most m groups such that the following conditions are met: You need to output the number of ways modulo 10^{9}+7 for every query. The first line contains two integers n and q ( 1 <= n, q <= 10^{5} ) -- the number of vertices in the tree and the number of queries, respectively. Each of the next n-1 lines contains two integers u and v ( 1 <= u, v <= n, u ne v ), denoting an edge connecting vertex u and vertex v . It is guaranteed that the given graph is a tree. Each of the next q lines starts with three integers k , m and r ( 1 <= k, r <= n , 1 <= m <= min(300,k) ) -- the number of nodes, the maximum number of groups and the root of the tree for the current query, respectively. They are followed by k distinct integers a_1, a_2, ldots, a_k ( 1 <= a_i <= n ), denoting the nodes of the current query. It is guaranteed that the sum of k over all queries does not exceed 10^{5} . Print q lines, where the i -th line contains the answer to the i -th query. Consider the first example. In the first query, we have to divide the three given nodes ( 7 , 4 and 3 ), into the maximum of three groups assuming that the tree is rooted at 2 . When the tree is rooted at 2 , 4 is an ancestor of both 3 and 7 . So we can't put all the nodes into one group. There is only 1 way to divide the given nodes into two groups, which are [4] and [3, 7] . Also, there is only one way to divide the given nodes into three groups, which are [7] , [4] and [3] . So, there a"... |
CodeCraft-19 and Codeforces Round #537 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
49470102 | rainboy | E | Feb. 4, 2019, 4:45 p.m. | OK | GNU C11 | TESTS | 100 | 436 | 16896000 | 2800 | |
49609676 | ArrayListman | E | Feb. 7, 2019, 10:26 p.m. | OK | GNU C11 | TESTS | 100 | 452 | 16896000 | 2800 | |
49933904 | Utkrist | E | Feb. 15, 2019, 6:16 a.m. | OK | GNU C11 | TESTS | 100 | 467 | 16896000 | 2800 | |
50877514 | vjudge4 | E | March 6, 2019, 7:13 a.m. | OK | GNU C++11 | TESTS | 100 | 202 | 140288000 | 2800 | |
49618862 | stal_xy23z7b8 | E | Feb. 8, 2019, 8:03 a.m. | OK | GNU C++11 | TESTS | 100 | 202 | 140288000 | 2800 | |
62677975 | luogu_bot1 | E | Oct. 16, 2019, 11:59 a.m. | OK | GNU C++11 | TESTS | 100 | 234 | 132608000 | 2800 | |
49685213 | dsl2002 | E | Feb. 10, 2019, 6:38 a.m. | OK | GNU C++11 | TESTS | 100 | 249 | 10035200 | 2800 | |
49617493 | zsyzsy | E | Feb. 8, 2019, 7:06 a.m. | OK | GNU C++11 | TESTS | 100 | 249 | 12800000 | 2800 | |
50234099 | maxtir | E | Feb. 20, 2019, 9:54 a.m. | OK | GNU C++11 | TESTS | 100 | 249 | 13824000 | 2800 | |
49461864 | idxcalccalc | E | Feb. 4, 2019, 1:23 p.m. | OK | GNU C++11 | TESTS | 100 | 249 | 14131200 | 2800 | |
49495363 | idxcalccalc | E | Feb. 5, 2019, 12:33 p.m. | OK | GNU C++11 | TESTS | 100 | 249 | 19456000 | 2800 | |
49523359 | Winniechen | E | Feb. 6, 2019, 9:40 a.m. | OK | GNU C++11 | TESTS | 100 | 264 | 10444800 | 2800 | |
61274302 | mlby | E | Sept. 25, 2019, 2:57 p.m. | OK | GNU C++11 | TESTS | 100 | 264 | 19456000 | 2800 | |
49680935 | cloudsky01 | E | Feb. 10, 2019, 1:30 a.m. | OK | GNU C++14 | TESTS | 100 | 264 | 16998400 | 2800 | |
54141552 | Samaritan123 | E | May 14, 2019, 5:53 p.m. | OK | GNU C++14 | TESTS | 100 | 265 | 158924800 | 2800 | |
52951021 | Learnerxy | E | April 18, 2019, 11:53 a.m. | OK | GNU C++14 | TESTS | 100 | 280 | 13107200 | 2800 | |
49478844 | RUSH_D_CAT | E | Feb. 4, 2019, 9:11 p.m. | OK | GNU C++14 | TESTS | 100 | 295 | 140083200 | 2800 | |
49460865 | transs | E | Feb. 4, 2019, 12:54 p.m. | OK | GNU C++14 | TESTS | 100 | 295 | 263270400 | 2800 | |
49547181 | Ejecutante | E | Feb. 7, 2019, 12:40 a.m. | OK | GNU C++14 | TESTS | 100 | 296 | 26624000 | 2800 | |
49446417 | begay | E | Feb. 4, 2019, 3:32 a.m. | OK | GNU C++14 | TESTS | 100 | 296 | 138956800 | 2800 | |
49446440 | beginend | E | Feb. 4, 2019, 3:34 a.m. | OK | GNU C++14 | TESTS | 100 | 296 | 138956800 | 2800 | |
62876128 | U_U | E | Oct. 18, 2019, 3:22 p.m. | OK | GNU C++14 | TESTS | 100 | 311 | 264806400 | 2800 | |
49609973 | arraywoman | E | Feb. 7, 2019, 10:51 p.m. | OK | GNU C++14 | TESTS | 100 | 312 | 12492800 | 2800 | |
49472139 | dsl2002 | E | Feb. 4, 2019, 5:36 p.m. | OK | GNU C++17 | TESTS | 100 | 249 | 10240000 | 2800 | |
50802323 | vjudge1 | E | March 5, 2019, 1:26 a.m. | OK | GNU C++17 | TESTS | 100 | 295 | 10752000 | 2800 | |
66736496 | Lucina | E | Dec. 12, 2019, 7:05 p.m. | OK | GNU C++17 | TESTS | 100 | 295 | 44134400 | 2800 | |
49451085 | Dance_Of_Faith | E | Feb. 4, 2019, 7:14 a.m. | OK | GNU C++17 | TESTS | 100 | 295 | 134246400 | 2800 | |
49531472 | hznu_kk | E | Feb. 6, 2019, 2 p.m. | OK | GNU C++17 | TESTS | 100 | 296 | 13312000 | 2800 | |
49516532 | hmc | E | Feb. 6, 2019, 3:37 a.m. | OK | GNU C++17 | TESTS | 100 | 296 | 22118400 | 2800 | |
66736907 | Lucina | E | Dec. 12, 2019, 7:17 p.m. | OK | GNU C++17 | TESTS | 100 | 311 | 28364800 | 2800 | |
49521794 | chenyeyuan | E | Feb. 6, 2019, 8:30 a.m. | OK | GNU C++17 | TESTS | 100 | 312 | 21401600 | 2800 | |
68942903 | jiangly | E | Jan. 16, 2020, 3:01 p.m. | OK | GNU C++17 | TESTS | 100 | 327 | 133632000 | 2800 | |
60706353 | AliShahali1382 | E | Sept. 17, 2019, 5:29 a.m. | OK | GNU C++17 | TESTS | 100 | 343 | 15769600 | 2800 | |
52498109 | zhishou | E | April 8, 2019, 2:40 p.m. | OK | Java 8 | TESTS | 100 | 701 | 50688000 | 2800 | |
67474944 | dalt | E | Dec. 23, 2019, 2:02 p.m. | OK | Java 8 | TESTS | 100 | 717 | 24166400 | 2800 | |
50145663 | tri | E | Feb. 19, 2019, 3:46 a.m. | OK | Java 8 | TESTS | 100 | 810 | 96870400 | 2800 | |
52497790 | zhishou | E | April 8, 2019, 2:31 p.m. | OK | Java 8 | TESTS | 100 | 966 | 50585600 | 2800 | |
49470101 | Dukkha | E | Feb. 4, 2019, 4:45 p.m. | OK | Java 8 | TESTS | 100 | 997 | 101171200 | 2800 | |
52497740 | zhishou | E | April 8, 2019, 2:30 p.m. | OK | Java 8 | TESTS | 100 | 1013 | 50995200 | 2800 | |
50064063 | sweiss | E | Feb. 17, 2019, 1:58 p.m. | OK | Java 8 | TESTS | 100 | 1075 | 26828800 | 2800 | |
49535879 | xodiac | E | Feb. 6, 2019, 3:57 p.m. | OK | Java 8 | TESTS | 100 | 1153 | 73113600 | 2800 | |
55183595 | camypaper | E | June 6, 2019, 1:39 a.m. | OK | Mono C# | TESTS | 100 | 1122 | 52428800 | 2800 | |
50928730 | vjudge3 | E | March 7, 2019, 1 p.m. | OK | MS C++ | TESTS | 100 | 733 | 18022400 | 2800 |
Back to search problems