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.
Problems
B'A tree is a connected graph without cycles. Two trees, consisting of n vertices each, are called isomorphic if there exists a permutation p: xe2 x80 x89{1, xe2 x80 x89..., xe2 x80 x89n} xe2 x80 x89 xe2 x86 x92 xe2 x80 x89{1, xe2 x80 x89..., xe2 x80 x89n} such that the edge (u, xe2 x80 x89v) is present in the first tree if and only if the edge (pu, xe2 x80 x89pv) is present in the second tree. Vertex of the tree is called internal if its degree is greater than or equal to two. Count the number of different non-isomorphic trees, consisting of n vertices, such that the degree of each internal vertex is exactly d. Print the answer over the given prime modulo mod. The single line of the input contains three integers n, d and mod (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000, 2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89d xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8910, 108 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89mod xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the number of vertices in the tree, the degree of internal vertices and the prime modulo. Print the number of trees over the modulo mod. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
26529237 |
jiyutian |
F |
April 21, 2017, 2:35 a.m. |
OK |
GNU C++ |
TESTS |
52 |
15 |
1945600 |
|
2800 |
21337965 |
q409257934 |
F |
Oct. 10, 2016, 12:54 p.m. |
OK |
GNU C++ |
TESTS |
52 |
15 |
10240000 |
|
2800 |
24910083 |
Dylans |
F |
Feb. 23, 2017, 7:02 a.m. |
OK |
GNU C++ |
TESTS |
52 |
30 |
2150400 |
|
2800 |
22005166 |
fullpower |
F |
Nov. 3, 2016, 3:02 a.m. |
OK |
GNU C++ |
TESTS |
52 |
31 |
0 |
|
2800 |
21386112 |
liujunhao |
F |
Oct. 12, 2016, 3:57 p.m. |
OK |
GNU C++ |
TESTS |
52 |
31 |
1945600 |
|
2800 |
21386089 |
liujunhao |
F |
Oct. 12, 2016, 3:56 p.m. |
OK |
GNU C++ |
TESTS |
52 |
31 |
1945600 |
|
2800 |
21317588 |
huanghc |
F |
Oct. 9, 2016, 11:59 a.m. |
OK |
GNU C++ |
TESTS |
52 |
31 |
1945600 |
|
2800 |
21291428 |
SkyDec |
F |
Oct. 8, 2016, 1:58 p.m. |
OK |
GNU C++ |
TESTS |
52 |
31 |
1945600 |
|
2800 |
21384625 |
liujunhao |
F |
Oct. 12, 2016, 2:49 p.m. |
OK |
GNU C++ |
TESTS |
52 |
31 |
2048000 |
|
2800 |
21617971 |
Hillan |
F |
Oct. 20, 2016, 12:58 p.m. |
OK |
GNU C++ |
TESTS |
52 |
46 |
102400 |
|
2800 |
21332559 |
-XraY- |
F |
Oct. 10, 2016, 8:10 a.m. |
OK |
GNU C++11 |
TESTS |
52 |
30 |
2150400 |
|
2800 |
21303477 |
data_h |
F |
Oct. 8, 2016, 6:43 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
30 |
2150400 |
|
2800 |
36785830 |
zhouyuyang |
F |
April 1, 2018, 12:48 a.m. |
OK |
GNU C++11 |
TESTS |
52 |
30 |
3584000 |
|
2800 |
30496463 |
just_soso |
F |
Sept. 19, 2017, 12:08 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
31 |
204800 |
|
2800 |
30496410 |
just_soso |
F |
Sept. 19, 2017, 12:06 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
31 |
204800 |
|
2800 |
21353528 |
NiroBC |
F |
Oct. 11, 2016, 8:14 a.m. |
OK |
GNU C++11 |
TESTS |
52 |
31 |
1945600 |
|
2800 |
21337408 |
jiry_2 |
F |
Oct. 10, 2016, 12:26 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
31 |
2150400 |
|
2800 |
21305562 |
enot110 |
F |
Oct. 8, 2016, 8:57 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
31 |
2150400 |
|
2800 |
30497694 |
just_soso |
F |
Sept. 19, 2017, 12:45 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
46 |
204800 |
|
2800 |
30497674 |
just_soso |
F |
Sept. 19, 2017, 12:44 p.m. |
OK |
GNU C++11 |
TESTS |
52 |
46 |
204800 |
|
2800 |
23373615 |
Ali.Pi |
F |
Dec. 28, 2016, 8:35 a.m. |
OK |
GNU C++14 |
TESTS |
52 |
15 |
1945600 |
|
2800 |
40983471 |
ReaLNero1 |
F |
July 30, 2018, 6:52 p.m. |
OK |
GNU C++14 |
TESTS |
52 |
31 |
102400 |
|
2800 |
30291171 |
aid |
F |
Sept. 12, 2017, 4:32 p.m. |
OK |
GNU C++14 |
TESTS |
52 |
31 |
102400 |
|
2800 |
21356498 |
Steven_Wu |
F |
Oct. 11, 2016, 10:58 a.m. |
OK |
GNU C++14 |
TESTS |
52 |
46 |
1945600 |
|
2800 |
24280903 |
rqgao2014 |
F |
Jan. 31, 2017, 2:44 a.m. |
OK |
GNU C++14 |
TESTS |
52 |
46 |
62771200 |
|
2800 |
32756520 |
ckodser |
F |
Nov. 28, 2017, 5:01 p.m. |
OK |
GNU C++14 |
TESTS |
52 |
46 |
99123200 |
|
2800 |
21350719 |
tun |
F |
Oct. 11, 2016, 4:45 a.m. |
OK |
GNU C++14 |
TESTS |
52 |
61 |
2048000 |
|
2800 |
21918962 |
AmberFrame |
F |
Oct. 31, 2016, 1:53 p.m. |
OK |
GNU C++14 |
TESTS |
52 |
78 |
121446400 |
|
2800 |
21293426 |
TearsFreeze |
F |
Oct. 8, 2016, 2:22 p.m. |
OK |
GNU C++14 |
TESTS |
52 |
109 |
1945600 |
|
2800 |
49394742 |
Bartholomew |
F |
Feb. 3, 2019, 11:57 a.m. |
OK |
GNU C++14 |
TESTS |
52 |
109 |
89088000 |
|
2800 |
43377015 |
XTyuan |
F |
Sept. 24, 2018, 4:56 p.m. |
OK |
GNU C++17 |
TESTS |
52 |
31 |
102400 |
|
2800 |
45273327 |
_Happy_New_Year_ |
F |
Nov. 4, 2018, 9:37 a.m. |
OK |
GNU C++17 |
TESTS |
52 |
31 |
307200 |
|
2800 |
61363396 |
kefaa2 |
F |
Sept. 27, 2019, 12:47 p.m. |
OK |
GNU C++17 |
TESTS |
52 |
61 |
48640000 |
|
2800 |
52899822 |
Vexoben |
F |
April 17, 2019, 10:40 a.m. |
OK |
GNU C++17 |
TESTS |
52 |
140 |
44544000 |
|
2800 |
61444775 |
tfg |
F |
Sept. 28, 2019, 8:28 p.m. |
OK |
GNU C++17 |
TESTS |
52 |
140 |
112435200 |
|
2800 |
69193795 |
hjk1030 |
F |
Jan. 20, 2020, 2:17 p.m. |
OK |
GNU C++17 |
TESTS |
52 |
155 |
45056000 |
|
2800 |
40781583 |
lllllllllllllllllllllll |
F |
July 26, 2018, 2:06 p.m. |
OK |
GNU C++17 |
TESTS |
52 |
280 |
22425600 |
|
2800 |
55675146 |
AliShahali1382 |
F |
June 17, 2019, 9:59 a.m. |
OK |
GNU C++17 |
TESTS |
52 |
280 |
108646400 |
|
2800 |
48460200 |
alonefight |
F |
Jan. 16, 2019, 2:17 p.m. |
OK |
GNU C++17 |
TESTS |
52 |
389 |
61030400 |
|
2800 |
53689806 |
Kmcode |
F |
May 3, 2019, 3:54 a.m. |
OK |
GNU C++17 |
TESTS |
52 |
390 |
177152000 |
|
2800 |
21306221 |
_fake- |
F |
Oct. 8, 2016, 10:06 p.m. |
OK |
Java 8 |
TESTS |
52 |
639 |
99328000 |
|
2800 |
21296949 |
eatmore |
F |
Oct. 8, 2016, 3:06 p.m. |
OK |
Java 8 |
TESTS |
52 |
654 |
99328000 |
|
2800 |
21313379 |
AndrewB330 |
F |
Oct. 9, 2016, 8:39 a.m. |
OK |
MS C++ |
TESTS |
52 |
46 |
2355200 |
|
2800 |
remove filters
Back to search problems