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'Limak is a little bear who learns to draw. People usually start with houses, fences and flowers but why would bears do it? Limak lives in the forest and he decides to draw a tree. Recall that tree is a connected graph consisting of n vertices and n xe2 x80 x89- xe2 x80 x891 edges. Limak chose a tree with n vertices. He has infinite strip of paper with two parallel rows of dots. Little bear wants to assign vertices of a tree to some n distinct dots on a paper so that edges would intersect only at their endpoints -- drawn tree must be planar. Below you can see one of correct drawings for the first sample test. Is it possible for Limak to draw chosen tree? The first line contains single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Next n xe2 x80 x89- xe2 x80 x891 lines contain description of a tree. i-th of them contains two space-separated integers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89bi) denoting an edge between vertices ai and bi. It 's guaranteed that given description forms a tree. Print "Yes" (without the quotes) if Limak can draw chosen tree. Otherwise, print "No" (without the quotes).'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
12757726 |
Alex_2oo8 |
C |
Aug. 29, 2015, 5:46 p.m. |
OK |
FPC |
TESTS |
58 |
46 |
3174400 |
|
2600 |
31524294 |
vjudge5 |
C |
Oct. 20, 2017, 5:40 a.m. |
OK |
FPC |
TESTS |
61 |
46 |
7372800 |
|
2600 |
31524267 |
htc2001 |
C |
Oct. 20, 2017, 5:39 a.m. |
OK |
FPC |
TESTS |
61 |
62 |
27443200 |
|
2600 |
12763557 |
tjandra |
C |
Aug. 29, 2015, 6:35 p.m. |
OK |
GNU C |
TESTS |
58 |
62 |
8704000 |
|
2600 |
12769971 |
Prime21 |
C |
Aug. 30, 2015, 3:23 a.m. |
OK |
GNU C++ |
TESTS |
58 |
30 |
5939200 |
|
2600 |
21416770 |
czllgzmzl |
C |
Oct. 14, 2016, 6:18 a.m. |
OK |
GNU C++ |
TESTS |
61 |
30 |
8192000 |
|
2600 |
17030119 |
jcvb |
C |
March 30, 2016, 8:26 a.m. |
OK |
GNU C++ |
TESTS |
61 |
30 |
16691200 |
|
2600 |
38710590 |
pufanyi |
C |
May 29, 2018, 6:15 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
0 |
|
2600 |
31521871 |
vjudge4 |
C |
Oct. 20, 2017, 2:22 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
5632000 |
|
2600 |
31522278 |
vjudge3 |
C |
Oct. 20, 2017, 2:53 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
6246400 |
|
2600 |
13765170 |
DRERY |
C |
Oct. 21, 2015, 4:49 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
6963200 |
|
2600 |
31526875 |
vjudge3 |
C |
Oct. 20, 2017, 8:17 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
8192000 |
|
2600 |
31521345 |
vjudge5 |
C |
Oct. 20, 2017, 1:43 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
8192000 |
|
2600 |
31522096 |
vjudge3 |
C |
Oct. 20, 2017, 2:39 a.m. |
OK |
GNU C++ |
TESTS |
61 |
31 |
8396800 |
|
2600 |
46835035 |
Itst |
C |
Dec. 10, 2018, 12:58 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
3072000 |
|
2600 |
44339228 |
PupilFop_zz |
C |
Oct. 15, 2018, 1:28 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
5734400 |
|
2600 |
67474363 |
z7z_Eta |
C |
Dec. 23, 2019, 1:51 p.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
5836800 |
|
2600 |
44339596 |
nn020701 |
C |
Oct. 15, 2018, 1:56 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
6041600 |
|
2600 |
44338435 |
luogu_bot3 |
C |
Oct. 15, 2018, 12:31 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
6348800 |
|
2600 |
44617453 |
CMXRYNP |
C |
Oct. 21, 2018, 3:16 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
6860800 |
|
2600 |
44357453 |
xgcxgc |
C |
Oct. 15, 2018, 1:05 p.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
6963200 |
|
2600 |
21435236 |
Hermits |
C |
Oct. 15, 2016, 1:29 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
8192000 |
|
2600 |
44339469 |
third |
C |
Oct. 15, 2018, 1:47 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
9932800 |
|
2600 |
44339413 |
black_moon |
C |
Oct. 15, 2018, 1:43 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
31 |
9932800 |
|
2600 |
31525062 |
q234rty |
C |
Oct. 20, 2017, 6:32 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
31 |
36864000 |
|
2600 |
31833904 |
Xin-Jie |
C |
Oct. 28, 2017, 11:26 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
46 |
7475200 |
|
2600 |
59502199 |
umangahuja11 |
C |
Aug. 26, 2019, 3:37 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
6656000 |
|
2600 |
44338871 |
helloworld1819 |
C |
Oct. 15, 2018, 1:02 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
7782400 |
|
2600 |
44378894 |
f2014170 |
C |
Oct. 16, 2018, 1:09 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
8089600 |
|
2600 |
44344436 |
luogu_bot4 |
C |
Oct. 15, 2018, 6:18 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
8192000 |
|
2600 |
66988630 |
Mindjolt |
C |
Dec. 15, 2019, 7:15 p.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
9420800 |
|
2600 |
31522681 |
vjudge3 |
C |
Oct. 20, 2017, 3:26 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
10035200 |
|
2600 |
31522667 |
timber_wanglu |
C |
Oct. 20, 2017, 3:25 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
10035200 |
|
2600 |
44347189 |
time_manager |
C |
Oct. 15, 2018, 8:01 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
77 |
11366400 |
|
2600 |
44673002 |
xumingyang |
C |
Oct. 21, 2018, 11:40 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
46 |
9728000 |
|
2600 |
37049748 |
DennisPraet |
C |
April 7, 2018, 12:25 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
62 |
23347200 |
|
2600 |
52316899 |
isaf27 |
C |
April 4, 2019, 5:32 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
78 |
4300800 |
|
2600 |
68294158 |
ivanilos |
C |
Jan. 6, 2020, 12:49 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
78 |
6348800 |
|
2600 |
61789471 |
Juve45 |
C |
Oct. 3, 2019, 3:27 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
78 |
12185600 |
|
2600 |
69293291 |
kazuki08 |
C |
Jan. 22, 2020, 11:12 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
78 |
12288000 |
|
2600 |
61363790 |
hjk1030 |
C |
Sept. 27, 2019, 12:54 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
93 |
8192000 |
|
2600 |
62171453 |
-is-this-fft- |
C |
Oct. 9, 2019, 1:10 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
93 |
9420800 |
|
2600 |
65699525 |
ivan100sic |
C |
Nov. 25, 2019, 10:04 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
93 |
10956800 |
|
2600 |
52794196 |
chinmay0906 |
C |
April 15, 2019, 7:22 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
93 |
14745600 |
|
2600 |
12761128 |
utkarshl |
C |
Aug. 29, 2015, 6:15 p.m. |
OK |
Haskell |
TESTS |
58 |
171 |
16998400 |
|
2600 |
12805634 |
AkshajK |
C |
Sept. 1, 2015, 5:09 p.m. |
OK |
Java 7 |
TESTS |
61 |
218 |
0 |
|
2600 |
12764110 |
Petr |
C |
Aug. 29, 2015, 6:38 p.m. |
OK |
Java 7 |
TESTS |
58 |
218 |
4096000 |
|
2600 |
12778207 |
nitegazer |
C |
Aug. 30, 2015, 2:44 p.m. |
OK |
Java 7 |
TESTS |
58 |
265 |
33792000 |
|
2600 |
13953543 |
edorundo |
C |
Oct. 30, 2015, 1:47 p.m. |
OK |
Java 7 |
TESTS |
61 |
389 |
75059200 |
|
2600 |
12763414 |
HFoFNK8qZHobzGBd |
C |
Aug. 29, 2015, 6:34 p.m. |
OK |
Java 7 |
TESTS |
58 |
405 |
50892800 |
|
2600 |
14088293 |
Nurmuhammed |
C |
Nov. 5, 2015, 12:04 p.m. |
OK |
Java 7 |
TESTS |
61 |
405 |
51404800 |
|
2600 |
14140711 |
mikelle |
C |
Nov. 8, 2015, 12:18 p.m. |
OK |
Java 7 |
TESTS |
61 |
421 |
51302400 |
|
2600 |
12761852 |
AndreySiunov |
C |
Aug. 29, 2015, 6:21 p.m. |
OK |
Java 7 |
TESTS |
58 |
436 |
47001600 |
|
2600 |
12809006 |
Petr |
C |
Sept. 1, 2015, 11:05 p.m. |
OK |
Java 7 |
TESTS |
61 |
468 |
51302400 |
|
2600 |
60327842 |
Ahmad |
C |
Sept. 10, 2019, 3:25 a.m. |
OK |
Java 8 |
TESTS |
61 |
217 |
18432000 |
|
2600 |
12767875 |
fnch |
C |
Aug. 29, 2015, 9:59 p.m. |
OK |
Java 8 |
TESTS |
58 |
233 |
0 |
|
2600 |
12766943 |
fnch |
C |
Aug. 29, 2015, 8:37 p.m. |
OK |
Java 8 |
TESTS |
58 |
233 |
0 |
|
2600 |
12752003 |
ilyakor |
C |
Aug. 29, 2015, 5:06 p.m. |
OK |
Java 8 |
TESTS |
58 |
233 |
12083200 |
|
2600 |
12757880 |
mmaxio |
C |
Aug. 29, 2015, 5:47 p.m. |
OK |
Java 8 |
TESTS |
58 |
249 |
0 |
|
2600 |
12768882 |
Bat-Orgil |
C |
Aug. 30, 2015, 12:46 a.m. |
OK |
Java 8 |
TESTS |
58 |
265 |
12185600 |
|
2600 |
12755531 |
niyaznigmatul |
C |
Aug. 29, 2015, 5:29 p.m. |
OK |
Java 8 |
TESTS |
58 |
265 |
12185600 |
|
2600 |
12767122 |
qwerty787788 |
C |
Aug. 29, 2015, 8:54 p.m. |
OK |
Java 8 |
TESTS |
58 |
296 |
5939200 |
|
2600 |
16023225 |
antonkov |
C |
Feb. 14, 2016, 7:35 p.m. |
OK |
Java 8 |
TESTS |
61 |
296 |
37683200 |
|
2600 |
12773924 |
Slamur |
C |
Aug. 30, 2015, 9:52 a.m. |
OK |
Java 8 |
TESTS |
58 |
327 |
16281600 |
|
2600 |
18341673 |
camypaper |
C |
June 9, 2016, 1 p.m. |
OK |
MS C# |
TESTS |
61 |
124 |
24473600 |
|
2600 |
12788071 |
azukun |
C |
Aug. 31, 2015, 11:53 a.m. |
OK |
MS C# |
TESTS |
61 |
202 |
13107200 |
|
2600 |
12762520 |
fiver |
C |
Aug. 29, 2015, 6:27 p.m. |
OK |
MS C# |
TESTS |
58 |
249 |
85913600 |
|
2600 |
12755444 |
Milanin |
C |
Aug. 29, 2015, 5:29 p.m. |
OK |
MS C++ |
TESTS |
58 |
62 |
4915200 |
|
2600 |
13004490 |
ingress |
C |
Sept. 15, 2015, 8:27 a.m. |
OK |
MS C++ |
TESTS |
61 |
62 |
5427200 |
|
2600 |
12797322 |
katan |
C |
Sept. 1, 2015, 5:32 a.m. |
OK |
MS C++ |
TESTS |
61 |
62 |
5529600 |
|
2600 |
16192495 |
sister_what_hate_most |
C |
Feb. 19, 2016, 5:12 a.m. |
OK |
MS C++ |
TESTS |
61 |
62 |
6758400 |
|
2600 |
16192437 |
vjudge5 |
C |
Feb. 19, 2016, 5:08 a.m. |
OK |
MS C++ |
TESTS |
61 |
62 |
6758400 |
|
2600 |
12762634 |
Death_Knight_DK |
C |
Aug. 29, 2015, 6:28 p.m. |
OK |
MS C++ |
TESTS |
58 |
62 |
6860800 |
|
2600 |
13318744 |
makesource |
C |
Sept. 30, 2015, 4:31 p.m. |
OK |
MS C++ |
TESTS |
61 |
62 |
7577600 |
|
2600 |
12762105 |
iamexist |
C |
Aug. 29, 2015, 6:23 p.m. |
OK |
MS C++ |
TESTS |
58 |
77 |
10035200 |
|
2600 |
49643982 |
vjudge5 |
C |
Feb. 9, 2019, 2:06 a.m. |
OK |
MS C++ |
TESTS |
61 |
78 |
6451200 |
|
2600 |
12758853 |
Qwaz |
C |
Aug. 29, 2015, 5:58 p.m. |
OK |
MS C++ |
TESTS |
58 |
78 |
7065600 |
|
2600 |
remove filters
Back to search problems