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 |
---|---|---|---|---|---|---|
486 | Codeforces Round 277 (Div. 2) | FINISHED | False | 7200 | 316105199 | Nov. 11, 2014, 3 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4047 ) | D | Valid Sets | PROGRAMMING | dfs and similar dp math trees | 2300 |
B"As you know, an undirected connected graph with n nodes and n xe2 x80 x89- xe2 x80 x891 edges is called a tree. You are given an integer d and a tree consisting of n nodes. Each node i has a value ai associated with it. We call a set S of tree nodes valid if following conditions are satisfied: Your task is to count the number of valid sets. Since the result can be very large, you must print its remainder modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains two space-separated integers d (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89d xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892000) and n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892000). The second line contains n space-separated positive integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an(1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892000). Then the next n xe2 x80 x89- xe2 x80 x891 line each contain pair of integers u and v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89u, xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) denoting that there is an edge between u and v. It is guaranteed that these edges form a tree. Print the number of valid sets modulo 1000000007. In the first sample, there are exactly 8 valid sets: {1}, xe2 x80 x89{2}, xe2 x80 x89{3}, xe2 x80 x89{4}, xe2 x80 x89{1, xe2 x80 x892}, xe2 x80 x89{1, xe2 x80 x893}, xe2 x80 x89{3, xe2 x80 x894} and {1, xe2 x80 x893, xe2 x80 x894}. Set {1, xe2 x80 x892, xe2 x80 x893, xe2 x80 x894} is not valid, because the third condition isn't satisfied. Set {1, xe2 x80 x894} satisfies the third condition, but conflicts with the second condition."... |
Codeforces Round #277(Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
44539599 | 2016gdgzoi471 | D | Oct. 19, 2018, 10:48 a.m. | OK | Clang++17 Diagnostics | TESTS | 55 | 61 | 0 | 2300 | |
36790525 | luogu_bot3 | D | April 1, 2018, 6:55 a.m. | OK | FPC | TESTS | 55 | 46 | 39526400 | 2300 | |
36866809 | luogu_bot1 | D | April 2, 2018, 2:32 a.m. | OK | FPC | TESTS | 55 | 93 | 51200000 | 2300 | |
36115112 | Secret_exciting | D | March 9, 2018, 12:16 p.m. | OK | GNU C++ | TESTS | 55 | 15 | 2355200 | 2300 | |
36448329 | vjudge3 | D | March 21, 2018, 7:58 a.m. | OK | GNU C++ | TESTS | 55 | 15 | 3584000 | 2300 | |
37675242 | Mordred_Pendragon | D | April 28, 2018, 3:12 a.m. | OK | GNU C++ | TESTS | 55 | 30 | 3584000 | 2300 | |
37673770 | vjudge1 | D | April 28, 2018, 12:22 a.m. | OK | GNU C++ | TESTS | 55 | 30 | 3584000 | 2300 | |
37682036 | vjudge5 | D | April 28, 2018, 10:05 a.m. | OK | GNU C++ | TESTS | 55 | 30 | 4608000 | 2300 | |
42467094 | vjudge1 | D | Sept. 4, 2018, 4:29 p.m. | OK | GNU C++ | TESTS | 55 | 31 | 102400 | 2300 | |
42146934 | star_eternal | D | Aug. 27, 2018, 9:26 a.m. | OK | GNU C++ | TESTS | 55 | 31 | 102400 | 2300 | |
41983409 | alpczy | D | Aug. 23, 2018, 3:55 a.m. | OK | GNU C++ | TESTS | 55 | 31 | 102400 | 2300 | |
40987688 | ReaLNero1 | D | July 30, 2018, 9:25 p.m. | OK | GNU C++ | TESTS | 55 | 31 | 102400 | 2300 | |
40528826 | Scut82 | D | July 19, 2018, 1 a.m. | OK | GNU C++ | TESTS | 55 | 31 | 102400 | 2300 | |
36045895 | andwho | D | March 7, 2018, 1:22 p.m. | OK | GNU C++11 | TESTS | 55 | 15 | 2150400 | 2300 | |
38127791 | wxh571001500 | D | May 12, 2018, 4:47 a.m. | OK | GNU C++11 | TESTS | 55 | 30 | 3891200 | 2300 | |
64797214 | PHenning | D | Nov. 13, 2019, 1:18 p.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
63768372 | luogu_bot4 | D | Oct. 30, 2019, 7:02 a.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
63071009 | vjudge2 | D | Oct. 21, 2019, 12:23 p.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
61464240 | Kylin_ | D | Sept. 29, 2019, 9:46 a.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
49993609 | luogu_bot1 | D | Feb. 16, 2019, 1:54 p.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
49977578 | Unstoppable728 | D | Feb. 16, 2019, 6:45 a.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
47539736 | ljl | D | Dec. 27, 2018, 6:05 a.m. | OK | GNU C++11 | TESTS | 55 | 31 | 0 | 2300 | |
65410037 | luogu_bot5 | D | Nov. 20, 2019, 3:30 a.m. | OK | GNU C++11 | TESTS | 55 | 31 | 102400 | 2300 | |
57257234 | vjudge5 | D | July 18, 2019, 3 a.m. | OK | GNU C++14 | TESTS | 55 | 30 | 102400 | 2300 | |
50594708 | hyck | D | Feb. 28, 2019, 9:29 a.m. | OK | GNU C++14 | TESTS | 55 | 30 | 102400 | 2300 | |
62671025 | Ace_02 | D | Oct. 16, 2019, 9:45 a.m. | OK | GNU C++14 | TESTS | 55 | 30 | 204800 | 2300 | |
58404726 | ShubhaK2799 | D | Aug. 6, 2019, 7:47 p.m. | OK | GNU C++14 | TESTS | 55 | 30 | 204800 | 2300 | |
56750567 | Valgt | D | July 9, 2019, 11:43 a.m. | OK | GNU C++14 | TESTS | 55 | 30 | 204800 | 2300 | |
46517903 | Solo_Player. | D | Dec. 2, 2018, 5:43 p.m. | OK | GNU C++14 | TESTS | 55 | 30 | 204800 | 2300 | |
38585867 | farukkastamonuda | D | May 24, 2018, 12:13 p.m. | OK | GNU C++14 | TESTS | 55 | 30 | 204800 | 2300 | |
61457013 | chaitanya | D | Sept. 29, 2019, 6:47 a.m. | OK | GNU C++14 | TESTS | 55 | 30 | 307200 | 2300 | |
54756794 | JustasZ | D | May 28, 2019, 2:57 p.m. | OK | GNU C++14 | TESTS | 55 | 30 | 307200 | 2300 | |
51125506 | kardeepak | D | March 10, 2019, 11:25 a.m. | OK | GNU C++14 | TESTS | 55 | 30 | 307200 | 2300 | |
57838161 | Biioy | D | July 27, 2019, 8:19 a.m. | OK | GNU C++17 | TESTS | 55 | 30 | 102400 | 2300 | |
53712561 | continuity | D | May 3, 2019, 4:26 p.m. | OK | GNU C++17 | TESTS | 55 | 30 | 307200 | 2300 | |
45470274 | Ilya-bar | D | Nov. 9, 2018, 9:09 a.m. | OK | GNU C++17 | TESTS | 55 | 30 | 512000 | 2300 | |
44452139 | Sanitator | D | Oct. 17, 2018, 4:22 p.m. | OK | GNU C++17 | TESTS | 55 | 30 | 512000 | 2300 | |
38193945 | 3agwa | D | May 13, 2018, 2:38 p.m. | OK | GNU C++17 | TESTS | 55 | 30 | 3584000 | 2300 | |
38193883 | 3agwa | D | May 13, 2018, 2:36 p.m. | OK | GNU C++17 | TESTS | 55 | 30 | 3584000 | 2300 | |
38012515 | SoGood | D | May 8, 2018, 5:58 a.m. | OK | GNU C++17 | TESTS | 55 | 30 | 3686400 | 2300 | |
52610290 | newgate | D | April 11, 2019, 3:44 p.m. | OK | GNU C++17 | TESTS | 55 | 31 | 0 | 2300 | |
62609120 | vjudge5 | D | Oct. 15, 2019, 9:01 a.m. | OK | GNU C++17 | TESTS | 55 | 31 | 102400 | 2300 | |
57838191 | vjudge4 | D | July 27, 2019, 8:20 a.m. | OK | GNU C++17 | TESTS | 55 | 31 | 102400 | 2300 | |
69824441 | kashishsingh8700 | D | Jan. 30, 2020, 8:48 a.m. | OK | Java 11 | TESTS | 55 | 234 | 0 | 2300 | |
66582169 | bluesky111 | D | Dec. 10, 2019, 9:48 a.m. | OK | Java 8 | TESTS | 55 | 109 | 0 | 2300 | |
54566301 | amolpratap007 | D | May 24, 2019, 4:38 p.m. | OK | Java 8 | TESTS | 55 | 109 | 0 | 2300 | |
67418563 | Nutella3000 | D | Dec. 22, 2019, 10:49 a.m. | OK | Java 8 | TESTS | 55 | 124 | 0 | 2300 | |
66598554 | Oom | D | Dec. 10, 2019, 3:37 p.m. | OK | Java 8 | TESTS | 55 | 124 | 0 | 2300 | |
58805932 | Akshita_Maheshwari | D | Aug. 14, 2019, 8:56 a.m. | OK | Java 8 | TESTS | 55 | 124 | 0 | 2300 | |
57374777 | Ahmed_Diab | D | July 20, 2019, 12:10 p.m. | OK | Java 8 | TESTS | 55 | 124 | 0 | 2300 | |
48716036 | AJ47 | D | Jan. 22, 2019, 11:18 a.m. | OK | Java 8 | TESTS | 55 | 124 | 0 | 2300 | |
47353524 | StayAwayFromBitches | D | Dec. 22, 2018, 4:47 a.m. | OK | Java 8 | TESTS | 55 | 124 | 0 | 2300 | |
62640532 | mTvTm | D | Oct. 15, 2019, 6:01 p.m. | OK | Java 8 | TESTS | 55 | 139 | 0 | 2300 | |
64731952 | Hemose | D | Nov. 12, 2019, 8:47 a.m. | OK | Java 8 | TESTS | 55 | 140 | 0 | 2300 | |
62944805 | bachnx_epu | D | Oct. 19, 2019, 4:55 p.m. | OK | Kotlin | TESTS | 55 | 171 | 0 | 2300 | |
48910992 | vjudge2 | D | Jan. 25, 2019, 2:10 a.m. | OK | MS C++ | TESTS | 55 | 31 | 102400 | 2300 | |
48716325 | vjudge3 | D | Jan. 22, 2019, 11:28 a.m. | OK | MS C++ | TESTS | 55 | 31 | 102400 | 2300 | |
48716292 | vjudge3 | D | Jan. 22, 2019, 11:27 a.m. | OK | MS C++ | TESTS | 55 | 31 | 102400 | 2300 | |
48862958 | vjudge4 | D | Jan. 24, 2019, 12:42 a.m. | OK | MS C++ | TESTS | 55 | 31 | 7168000 | 2300 | |
48862926 | vjudge4 | D | Jan. 24, 2019, 12:40 a.m. | OK | MS C++ | TESTS | 55 | 31 | 7270400 | 2300 | |
57882870 | vjudge5 | D | July 28, 2019, 8:35 a.m. | OK | MS C++ | TESTS | 55 | 46 | 102400 | 2300 | |
59582876 | vjudge3 | D | Aug. 27, 2019, 4:46 p.m. | OK | MS C++ 2017 | TESTS | 55 | 31 | 102400 | 2300 | |
36512219 | pavankatta | D | March 22, 2018, 6:11 p.m. | OK | PyPy 2 | TESTS | 55 | 873 | 32563200 | 2300 | |
36512131 | pavankatta | D | March 22, 2018, 6:08 p.m. | OK | PyPy 2 | TESTS | 55 | 904 | 32460800 | 2300 | |
49764619 | vladalos | D | Feb. 11, 2019, 11:01 a.m. | OK | Python 3 | TESTS | 55 | 342 | 307200 | 2300 |
Back to search problems