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
Bearland has n cities, numbered 1 through n . There are m bidirectional roads. The i -th road connects two distinct cities a i and b i . No two roads connect the same pair of cities. It's possible to get from any city to any other city (using one or more roads). The distance between cities a and b is defined as the minimum number of roads used to travel between a and b . Limak is a grizzly bear. He is a criminal and your task is to catch him, or at least to try to catch him. You have only two days (today and tomorrow) and after that Limak is going to hide forever. Your main weapon is BCD (Bear Criminal Detector). Where you are in some city, you can use BCD and it tells you the distance between you and a city where Limak currently is. Unfortunately, BCD can be used only once a day. You don't know much about Limak's current location. You assume that he is in one of n cities, chosen uniformly at random (each city with probability ). You decided for the following plan: Choose one city and use BCD there. After using BCD you can try to catch Limak (but maybe it isn't a good idea). In this case you choose one city and check it. You win if Limak is there. Otherwise, Limak becomes more careful and you will never catch him (you loose). After using BCD you can try to catch Limak (but maybe it isn't a good idea). In this case you choose one city and check it. You win if Limak is there. Otherwise, Limak becomes more careful and you will never catch him (you loose). Wait 24 hours to use BCD again. You know that Limak will change his location during that time. In detail, he will choose uniformly at random one of roads from his initial city, and he will use the chosen road, going to some other city. Tomorrow, you will again choose one city and use BCD there. Finally, you will try to catch Limak. You will choose one city and check it. You will win if Limak is there, and loose otherwise. Each time when you choose one of cities, you can choose any of n cities. Let's say it i |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
36408676 |
C.Edward |
D |
March 19, 2018, 11:22 a.m. |
OK |
GNU C++ |
TESTS |
46 |
748 |
8192000 |
|
2900 |
|
18375401 |
Toosample |
D |
June 11, 2016, 1:39 p.m. |
OK |
GNU C++ |
TESTS |
46 |
764 |
3584000 |
|
2900 |
|
18353769 |
massimodong |
D |
June 10, 2016, 7:16 a.m. |
OK |
GNU C++ |
TESTS |
46 |
780 |
4096000 |
|
2900 |
|
41531773 |
Scut82 |
D |
Aug. 12, 2018, 2:52 p.m. |
OK |
GNU C++ |
TESTS |
46 |
795 |
5324800 |
|
2900 |
|
31110035 |
vjudge1 |
D |
Oct. 7, 2017, 10:20 a.m. |
OK |
GNU C++ |
TESTS |
46 |
811 |
2252800 |
|
2900 |
|
18449341 |
rqgao2014 |
D |
June 14, 2016, 11:01 a.m. |
OK |
GNU C++ |
TESTS |
46 |
826 |
3584000 |
|
2900 |
|
18323450 |
brandnewnode |
D |
June 8, 2016, 6:09 p.m. |
OK |
GNU C++ |
TESTS |
46 |
826 |
4300800 |
|
2900 |
|
18412978 |
jackielei |
D |
June 13, 2016, 12:55 p.m. |
OK |
GNU C++ |
TESTS |
46 |
826 |
4710400 |
|
2900 |
|
24239426 |
130705009 |
D |
Jan. 29, 2017, 3:39 a.m. |
OK |
GNU C++ |
TESTS |
46 |
842 |
3379200 |
|
2900 |
|
18322971 |
jcvb |
D |
June 8, 2016, 6:06 p.m. |
OK |
GNU C++ |
TESTS |
46 |
842 |
5222400 |
|
2900 |
|
18361652 |
keepit |
D |
June 10, 2016, 4:13 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
702 |
4300800 |
|
2900 |
|
55531466 |
RedStar_13 |
D |
June 13, 2019, 1:49 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
748 |
4608000 |
|
2900 |
|
55522411 |
RedStar_13 |
D |
June 13, 2019, 9:15 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
795 |
4608000 |
|
2900 |
|
18345608 |
xtalclr |
D |
June 9, 2016, 5:28 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
811 |
4505600 |
|
2900 |
|
65283485 |
nabid_anzum |
D |
Nov. 18, 2019, 7:10 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
904 |
2150400 |
|
2900 |
|
18338826 |
ftiasch |
D |
June 9, 2016, 9:36 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
904 |
4300800 |
|
2900 |
|
18366393 |
jjjjjjjjjjj |
D |
June 10, 2016, 11:08 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
920 |
4608000 |
|
2900 |
|
18358485 |
PlayfulPanda |
D |
June 10, 2016, 12:38 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
951 |
7372800 |
|
2900 |
|
18333919 |
Heisenbug |
D |
June 9, 2016, 2:46 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
951 |
10137600 |
|
2900 |
|
18338902 |
geniucos |
D |
June 9, 2016, 9:41 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
998 |
6963200 |
|
2900 |
|
42361654 |
Grzmot |
D |
Sept. 2, 2018, 12:14 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
639 |
5529600 |
|
2900 |
|
46388672 |
The_Unbeatable |
D |
Nov. 30, 2018, 3:09 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
858 |
3379200 |
|
2900 |
|
25897934 |
molamola. |
D |
March 29, 2017, 2:24 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
904 |
4300800 |
|
2900 |
|
44710896 |
KhaleD_ |
D |
Oct. 22, 2018, 6:47 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
967 |
2150400 |
|
2900 |
|
64910221 |
thebes |
D |
Nov. 15, 2019, 2:36 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
1029 |
3686400 |
|
2900 |
|
31104418 |
zhanglexing |
D |
Oct. 7, 2017, 7:48 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
1076 |
614400 |
|
2900 |
|
31112312 |
black_moon |
D |
Oct. 7, 2017, 11:31 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
1123 |
2355200 |
|
2900 |
|
31112379 |
black_moon |
D |
Oct. 7, 2017, 11:32 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
1154 |
2355200 |
|
2900 |
|
23739447 |
Hujiwara |
D |
Jan. 12, 2017, 3:20 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
1154 |
5529600 |
|
2900 |
|
31101912 |
vjudge4 |
D |
Oct. 7, 2017, 6:26 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
1169 |
716800 |
|
2900 |
|
69905351 |
hjk1030 |
D |
Jan. 31, 2020, 2 p.m. |
OK |
GNU C++17 |
TESTS |
46 |
1045 |
9011200 |
|
2900 |
|
51213055 |
Kucha |
D |
March 12, 2019, 8:58 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
1263 |
1331200 |
|
2900 |
|
59679066 |
fedoseev.timofey |
D |
Aug. 29, 2019, 7:34 p.m. |
OK |
GNU C++17 |
TESTS |
46 |
1762 |
2252800 |
|
2900 |
|
50564103 |
alekseenko |
D |
Feb. 27, 2019, 12:24 p.m. |
OK |
GNU C++17 |
TESTS |
46 |
1856 |
2355200 |
|
2900 |
|
64720911 |
user202729_ |
D |
Nov. 12, 2019, 3:24 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
2106 |
4198400 |
|
2900 |
|
18319333 |
Petr |
D |
June 8, 2016, 5:43 p.m. |
OK |
Java 8 |
TESTS |
46 |
1731 |
21094400 |
|
2900 |
|
18759340 |
mmaxio |
D |
June 27, 2016, 11:10 p.m. |
OK |
Java 8 |
TESTS |
46 |
3307 |
0 |
|
2900 |
|
18768629 |
IgorKoval |
D |
June 28, 2016, 2:21 p.m. |
OK |
Java 8 |
TESTS |
46 |
4882 |
0 |
|
2900 |
|
18329858 |
qwerty787788 |
D |
June 8, 2016, 7:58 p.m. |
OK |
Java 8 |
TESTS |
46 |
4928 |
21196800 |
|
2900 |
|
40262035 |
insert_cool_handle |
D |
July 13, 2018, 1:03 p.m. |
OK |
Java 8 |
TESTS |
46 |
5069 |
0 |
|
2900 |
|
18768663 |
IgorKoval |
D |
June 28, 2016, 2:24 p.m. |
OK |
Java 8 |
TESTS |
46 |
5381 |
0 |
|
2900 |
|
18768492 |
IgorKoval |
D |
June 28, 2016, 2:10 p.m. |
OK |
Java 8 |
TESTS |
46 |
5506 |
0 |
|
2900 |
|
18768676 |
IgorKoval |
D |
June 28, 2016, 2:25 p.m. |
OK |
Java 8 |
TESTS |
46 |
5787 |
0 |
|
2900 |
|
18768565 |
IgorKoval |
D |
June 28, 2016, 2:16 p.m. |
OK |
Java 8 |
TESTS |
46 |
5865 |
0 |
|
2900 |
|
18698606 |
AnatolyTolstobrov |
D |
June 24, 2016, 10:15 a.m. |
OK |
MS C# |
TESTS |
46 |
2526 |
9932800 |
|
2900 |
|
18698526 |
AnatolyTolstobrov |
D |
June 24, 2016, 10:09 a.m. |
OK |
MS C# |
TESTS |
46 |
2776 |
9932800 |
|
2900 |
|
24481235 |
camypaper |
D |
Feb. 7, 2017, 5:02 a.m. |
OK |
MS C# |
TESTS |
46 |
5662 |
28057600 |
|
2900 |
|
18843379 |
Los_Angelos_Laycurse |
D |
July 1, 2016, 4:26 p.m. |
OK |
MS C++ |
TESTS |
46 |
904 |
1638400 |
|
2900 |
|
22581080 |
AleksanderBalobanov |
D |
Nov. 28, 2016, 4:27 p.m. |
OK |
MS C++ |
TESTS |
46 |
1825 |
2662400 |
|
2900 |
|
50597000 |
alekseenko |
D |
Feb. 28, 2019, 10:54 a.m. |
OK |
MS C++ 2017 |
TESTS |
46 |
1294 |
2150400 |
|
2900 |
|
50575234 |
alekseenko |
D |
Feb. 27, 2019, 5:42 p.m. |
OK |
MS C++ 2017 |
TESTS |
46 |
1309 |
2252800 |
|
2900 |
remove filters
Back to search problems