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 |
643
|
VK Cup 2016 - Round 3 |
FINISHED |
False |
10800 |
274978504 |
May 7, 2016, 3:05 p.m. |
Problems
B"Limak is a little grizzly bear. He will once attack Deerland but now he can only destroy trees in role-playing games. Limak starts with a tree with one vertex. The only vertex has index 1 and is a root of the tree. Sometimes, a game chooses a subtree and allows Limak to attack it. When a subtree is attacked then each of its edges is destroyed with probability , independently of other edges. Then, Limak gets the penalty -- an integer equal to the height of the subtree after the attack. The height is defined as the maximum number of edges on the path between the root of the subtree and any vertex in the subtree. You must handle queries of two types. In a query of the second type, Limak doesn't actually attack the subtree and thus the query doesn't affect next queries. The first line of the input contains one integer q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500 xe2 x80 x89000) -- the number of queries. Then, q lines follow. The i-th of them contains two integers typei and vi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89typei xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892). If typei xe2 x80 x89= xe2 x80 x891 then vi denotes a parent of a new vertex, while if typei xe2 x80 x89= xe2 x80 x892 then you should print the answer for a subtree rooted in vi. It's guaranteed that there will be at least 1 query of the second type, that is, the output won't be empty. It's guaranteed that just before the i-th query a vertex vi already exists. For each query of the second type print one real number --the expected value of the penalty if Limak attacks the given subtree. Your answer will be considered correct if its absolute or relative error does not exceed 10 xe2 x80 x89- xe2 x80 x896. Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct if . Below, you can see the drawing for the first sample. Red circles denote queries of the second type. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
40984845 |
ReaLNero1 |
E |
July 30, 2018, 7:36 p.m. |
OK |
GNU C++ |
TESTS |
72 |
327 |
142336000 |
|
2600 |
21228932 |
lichang |
E |
Oct. 6, 2016, 7:51 a.m. |
OK |
GNU C++ |
TESTS |
72 |
373 |
162304000 |
|
2600 |
18910654 |
Lesphere |
E |
July 6, 2016, 3:19 a.m. |
OK |
GNU C++ |
TESTS |
72 |
436 |
162099200 |
|
2600 |
26118887 |
vjudge4 |
E |
April 4, 2017, 10:18 a.m. |
OK |
GNU C++ |
TESTS |
72 |
451 |
226611200 |
|
2600 |
18981538 |
jaina |
E |
July 9, 2016, 8:06 a.m. |
OK |
GNU C++ |
TESTS |
72 |
452 |
166707200 |
|
2600 |
18176219 |
Oxer11 |
E |
June 1, 2016, 2:55 a.m. |
OK |
GNU C++ |
TESTS |
72 |
467 |
168550400 |
|
2600 |
18012252 |
DaibaNana |
E |
May 21, 2016, 1:49 a.m. |
OK |
GNU C++ |
TESTS |
72 |
467 |
244736000 |
|
2600 |
17838421 |
SanSiroWaltz |
E |
May 11, 2016, 3:26 a.m. |
OK |
GNU C++ |
TESTS |
72 |
468 |
172544000 |
|
2600 |
21234523 |
jiyutian |
E |
Oct. 6, 2016, 12:45 p.m. |
OK |
GNU C++ |
TESTS |
72 |
483 |
266547200 |
|
2600 |
18133056 |
yyqchemic |
E |
May 28, 2016, 2:48 p.m. |
OK |
GNU C++ |
TESTS |
72 |
498 |
252518400 |
|
2600 |
54502801 |
WOSHIGEPACHONG2 |
E |
May 23, 2019, 12:18 a.m. |
OK |
GNU C++11 |
TESTS |
72 |
311 |
172646400 |
|
2600 |
68445184 |
justin_cao |
E |
Jan. 9, 2020, 12:25 p.m. |
OK |
GNU C++11 |
TESTS |
72 |
311 |
184422400 |
|
2600 |
68445358 |
justin_cao |
E |
Jan. 9, 2020, 12:29 p.m. |
OK |
GNU C++11 |
TESTS |
72 |
326 |
184422400 |
|
2600 |
52810043 |
was_n |
E |
April 16, 2019, 8 a.m. |
OK |
GNU C++11 |
TESTS |
72 |
327 |
172646400 |
|
2600 |
68445115 |
justin_cao |
E |
Jan. 9, 2020, 12:23 p.m. |
OK |
GNU C++11 |
TESTS |
72 |
327 |
184320000 |
|
2600 |
56040262 |
Connected_failed |
E |
June 25, 2019, 1:59 p.m. |
OK |
GNU C++11 |
TESTS |
72 |
343 |
254464000 |
|
2600 |
42361692 |
SovietPower |
E |
Sept. 2, 2018, 12:14 p.m. |
OK |
GNU C++11 |
TESTS |
72 |
358 |
162304000 |
|
2600 |
43751338 |
SylvanasS |
E |
Oct. 4, 2018, 2:58 a.m. |
OK |
GNU C++11 |
TESTS |
72 |
373 |
172339200 |
|
2600 |
56043333 |
CindyMarshall |
E |
June 25, 2019, 3:22 p.m. |
OK |
GNU C++11 |
TESTS |
72 |
374 |
242483200 |
|
2600 |
50594132 |
Trick-t |
E |
Feb. 28, 2019, 9:12 a.m. |
OK |
GNU C++11 |
TESTS |
72 |
374 |
246272000 |
|
2600 |
21228636 |
Steven_Wu |
E |
Oct. 6, 2016, 7:34 a.m. |
OK |
GNU C++14 |
TESTS |
72 |
482 |
162406400 |
|
2600 |
32311976 |
NiroBC |
E |
Nov. 14, 2017, 12:55 p.m. |
OK |
GNU C++14 |
TESTS |
72 |
483 |
166297600 |
|
2600 |
28179922 |
rawatds |
E |
June 30, 2017, 8:20 p.m. |
OK |
GNU C++14 |
TESTS |
72 |
514 |
244428800 |
|
2600 |
69299086 |
ILoLy |
E |
Jan. 22, 2020, 1:15 p.m. |
OK |
GNU C++14 |
TESTS |
72 |
530 |
424960000 |
|
2600 |
54736937 |
NotNight |
E |
May 28, 2019, 5:34 a.m. |
OK |
GNU C++14 |
TESTS |
72 |
561 |
208691200 |
|
2600 |
23168545 |
tick |
E |
Dec. 20, 2016, 3:27 a.m. |
OK |
GNU C++14 |
TESTS |
72 |
576 |
286515200 |
|
2600 |
43237067 |
attack233 |
E |
Sept. 22, 2018, 8:30 a.m. |
OK |
GNU C++14 |
TESTS |
72 |
623 |
252723200 |
|
2600 |
23168493 |
winnerls |
E |
Dec. 20, 2016, 3:23 a.m. |
OK |
GNU C++14 |
TESTS |
72 |
623 |
266444800 |
|
2600 |
30976152 |
Grzmot |
E |
Oct. 3, 2017, 6:50 p.m. |
OK |
GNU C++14 |
TESTS |
72 |
639 |
442880000 |
|
2600 |
66311013 |
zhugezy |
E |
Dec. 5, 2019, 11:26 a.m. |
OK |
GNU C++14 |
TESTS |
72 |
686 |
288768000 |
|
2600 |
62549612 |
hjk1030 |
E |
Oct. 14, 2019, 8:01 a.m. |
OK |
GNU C++17 |
TESTS |
72 |
467 |
184320000 |
|
2600 |
43751039 |
Als123 |
E |
Oct. 4, 2018, 2:43 a.m. |
OK |
GNU C++17 |
TESTS |
72 |
483 |
188416000 |
|
2600 |
63729822 |
Roundgod |
E |
Oct. 29, 2019, 1:42 p.m. |
OK |
GNU C++17 |
TESTS |
72 |
498 |
162304000 |
|
2600 |
43736043 |
xgcxgc |
E |
Oct. 3, 2018, 4:02 p.m. |
OK |
GNU C++17 |
TESTS |
72 |
561 |
171929600 |
|
2600 |
43735801 |
xgcxgc |
E |
Oct. 3, 2018, 3:57 p.m. |
OK |
GNU C++17 |
TESTS |
72 |
592 |
253747200 |
|
2600 |
43750945 |
Rose_max |
E |
Oct. 4, 2018, 2:39 a.m. |
OK |
GNU C++17 |
TESTS |
72 |
623 |
188006400 |
|
2600 |
56257563 |
Shayan.P |
E |
June 29, 2019, 6:44 a.m. |
OK |
GNU C++17 |
TESTS |
72 |
639 |
162304000 |
|
2600 |
67037824 |
how_to_become_purple |
E |
Dec. 16, 2019, 6:02 p.m. |
OK |
GNU C++17 |
TESTS |
72 |
686 |
322662400 |
|
2600 |
45406872 |
lqs2015 |
E |
Nov. 7, 2018, 9:56 a.m. |
OK |
GNU C++17 |
TESTS |
72 |
686 |
496742400 |
|
2600 |
57989035 |
Kmcode |
E |
July 30, 2019, 12:30 p.m. |
OK |
GNU C++17 |
TESTS |
72 |
779 |
262758400 |
|
2600 |
17796977 |
antonkov Yurik |
E |
May 7, 2016, 6 p.m. |
OK |
Java 8 |
TESTS |
72 |
1138 |
415232000 |
|
2600 |
17796107 |
VArtem |
E |
May 7, 2016, 5:45 p.m. |
OK |
Java 8 |
TESTS |
72 |
1216 |
427929600 |
|
2600 |
17792723 |
Aksenov239 mmaxio |
E |
May 7, 2016, 4:43 p.m. |
OK |
Java 8 |
TESTS |
72 |
1824 |
551936000 |
|
2600 |
24483974 |
camypaper |
E |
Feb. 7, 2017, 8:29 a.m. |
OK |
MS C# |
TESTS |
72 |
1076 |
178995200 |
|
2600 |
24483998 |
camypaper |
E |
Feb. 7, 2017, 8:30 a.m. |
OK |
MS C# |
TESTS |
72 |
1216 |
214425600 |
|
2600 |
18920541 |
Los_Angelos_Laycurse |
E |
July 6, 2016, 2:40 p.m. |
OK |
MS C++ |
TESTS |
72 |
2371 |
172339200 |
|
2600 |
17798536 |
sdya |
E |
May 7, 2016, 7:33 p.m. |
OK |
MS C++ |
TESTS |
72 |
4382 |
175820800 |
|
2600 |
17798628 |
sdya |
E |
May 7, 2016, 7:38 p.m. |
OK |
MS C++ |
TESTS |
72 |
4960 |
171724800 |
|
2600 |
remove filters
Back to search problems