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"All of Slavic's friends are planning to travel from the place where they live to a party using their bikes. And they all have a bike except Slavic. There are n cities through which they can travel. They all live in the city 1 and want to go to the party located in the city n . The map of cities can be seen as an undirected graph with n nodes and m edges. Edge i connects cities u_i and v_i and has a length of w_i . Slavic doesn't have a bike, but what he has is money. Every city has exactly one bike for sale. The bike in the i -th city has a slowness factor of s_{i} . Once Slavic buys a bike, he can use it whenever to travel from the city he is currently in to any neighboring city, by taking w_i cdot s_j time, considering he is traversing edge i using a bike j he owns. Slavic can buy as many bikes as he wants as money isn't a problem for him. Since Slavic hates traveling by bike, he wants to get from his place to the party in the shortest amount of time possible. And, since his informatics skills are quite rusty, he asks you for help. What's the shortest amount of time required for Slavic to travel from city 1 to city n ? Slavic can't travel without a bike. It is guaranteed that it is possible for Slavic to travel from city 1 to any other city. The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two space-separated integers n and m ( 2 <= q n <= q 1000 ; n - 1 <= q m <= q 1000 ) -- the number of cities and the number of roads, respectively. The i -th of the following m lines each contain three integers u_i , v_i , w_i ( 1 <= u_i, v_i <= n , u_i neq v_i ; 1 <= q w_i <= q 10^5 ), denoting that there is a road between cities u_i and v_i of length "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
239434988 |
BvoJa |
G |
Dec. 29, 2023, 2:39 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
15 |
11264000 |
|
|
239416793 |
quater_nion |
G |
Dec. 28, 2023, 7:42 p.m. |
OK |
GNU C++14 |
TESTS |
25 |
30 |
5632000 |
|
|
239414417 |
Napoleon |
G |
Dec. 28, 2023, 7:12 p.m. |
OK |
GNU C++14 |
TESTS |
25 |
30 |
9318400 |
|
|
239439320 |
lbnowon |
G |
Dec. 29, 2023, 3:54 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
30 |
9420800 |
|
|
239408366 |
God_coder14 |
G |
Dec. 28, 2023, 6:12 p.m. |
OK |
GNU C++14 |
TESTS |
25 |
31 |
5632000 |
|
|
239446910 |
TJUHuangTao |
G |
Dec. 29, 2023, 5:31 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
31 |
9420800 |
|
|
239439631 |
yeminghan |
G |
Dec. 29, 2023, 3:59 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
31 |
9625600 |
|
|
239437854 |
PARTHO_DAS |
G |
Dec. 29, 2023, 3:32 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
31 |
9830400 |
|
|
239412179 |
tahoangquan2 |
G |
Dec. 28, 2023, 6:47 p.m. |
OK |
GNU C++14 |
TESTS |
25 |
31 |
9830400 |
|
|
239406193 |
NEERAJ2003 |
G |
Dec. 28, 2023, 5:56 p.m. |
OK |
GNU C++14 |
TESTS |
25 |
46 |
9318400 |
|
|
239421233 |
d_Dhruv_Tripathi |
G |
Dec. 28, 2023, 8:47 p.m. |
OK |
GNU C++17 |
TESTS |
25 |
15 |
1433600 |
|
|
239413806 |
Raul_A |
G |
Dec. 28, 2023, 7:05 p.m. |
OK |
GNU C++17 |
TESTS |
25 |
15 |
1433600 |
|
|
239412968 |
SundryVictory |
G |
Dec. 28, 2023, 6:55 p.m. |
OK |
GNU C++17 |
TESTS |
25 |
15 |
1536000 |
|
|
239419919 |
sanamdeepsinghbhatia |
G |
Dec. 28, 2023, 8:26 p.m. |
OK |
GNU C++17 |
TESTS |
25 |
15 |
1638400 |
|
|
239439958 |
KleiberXD |
G |
Dec. 29, 2023, 4:04 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
15 |
2252800 |
|
|
239444585 |
Blue_Moon_07 |
G |
Dec. 29, 2023, 5:03 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
15 |
9523200 |
|
|
239415610 |
temporary1 |
G |
Dec. 28, 2023, 7:27 p.m. |
OK |
GNU C++17 |
TESTS |
25 |
15 |
9523200 |
|
|
239445941 |
kethketh |
G |
Dec. 29, 2023, 5:19 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
15 |
9830400 |
|
|
239422379 |
202103050 |
G |
Dec. 28, 2023, 9:08 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
15 |
9830400 |
|
|
239408814 |
valehagammedov2 |
G |
Dec. 28, 2023, 6:16 p.m. |
OK |
GNU C++17 |
TESTS |
25 |
15 |
9830400 |
|
|
239411301 |
KanoFans |
G |
Dec. 28, 2023, 6:38 p.m. |
OK |
GNU C++17 (64) |
TESTS |
25 |
15 |
1433600 |
|
|
239409439 |
akshat8 |
G |
Dec. 28, 2023, 6:22 p.m. |
OK |
GNU C++17 (64) |
TESTS |
25 |
15 |
2252800 |
|
|
239428788 |
enslaved |
G |
Dec. 28, 2023, 11:46 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
15 |
6656000 |
|
|
239403230 |
eriktse |
G |
Dec. 28, 2023, 5:33 p.m. |
OK |
GNU C++17 (64) |
TESTS |
25 |
15 |
9830400 |
|
|
239441548 |
FeathBow |
G |
Dec. 29, 2023, 4:25 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
15 |
9932800 |
|
|
239423376 |
Xxxxxxxh |
G |
Dec. 28, 2023, 9:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
15 |
9932800 |
|
|
239403105 |
Vasu_ |
G |
Dec. 28, 2023, 5:33 p.m. |
OK |
GNU C++17 (64) |
TESTS |
25 |
15 |
9932800 |
|
|
239436057 |
Sempr_ |
G |
Dec. 29, 2023, 2:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
15 |
10035200 |
|
|
239446161 |
Monsterstar |
G |
Dec. 29, 2023, 5:21 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
15 |
12697600 |
|
|
239437194 |
Ackhava |
G |
Dec. 29, 2023, 3:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
15 |
33689600 |
|
|
239413107 |
Hitham |
G |
Dec. 28, 2023, 6:57 p.m. |
OK |
GNU C++20 (64) |
TESTS |
25 |
0 |
1433600 |
|
|
239404009 |
kimkun07 |
G |
Dec. 28, 2023, 5:39 p.m. |
OK |
GNU C++20 (64) |
TESTS |
25 |
15 |
1331200 |
|
|
239445543 |
molongdadi |
G |
Dec. 29, 2023, 5:15 a.m. |
OK |
GNU C++20 (64) |
TESTS |
35 |
15 |
1433600 |
|
|
239426639 |
abdalrahem.r.dado |
G |
Dec. 28, 2023, 10:40 p.m. |
OK |
GNU C++20 (64) |
TESTS |
35 |
15 |
1433600 |
|
|
239426599 |
abdalrahem.r.dado |
G |
Dec. 28, 2023, 10:39 p.m. |
OK |
GNU C++20 (64) |
TESTS |
35 |
15 |
1433600 |
|
|
239425569 |
abdalrahem.r.dado |
G |
Dec. 28, 2023, 10:13 p.m. |
OK |
GNU C++20 (64) |
TESTS |
35 |
15 |
1433600 |
|
|
239418310 |
Zer0bp |
G |
Dec. 28, 2023, 8:02 p.m. |
OK |
GNU C++20 (64) |
TESTS |
25 |
15 |
1433600 |
|
|
239413430 |
abdul_ahad4 |
G |
Dec. 28, 2023, 7:01 p.m. |
OK |
GNU C++20 (64) |
TESTS |
25 |
15 |
1433600 |
|
|
239413151 |
abdul_ahad4 |
G |
Dec. 28, 2023, 6:57 p.m. |
OK |
GNU C++20 (64) |
TESTS |
25 |
15 |
1433600 |
|
|
239404219 |
3MK_H |
G |
Dec. 28, 2023, 5:41 p.m. |
OK |
GNU C++20 (64) |
TESTS |
25 |
15 |
1433600 |
|
|
239410760 |
mohit458 |
G |
Dec. 28, 2023, 6:33 p.m. |
OK |
Java 11 |
TESTS |
25 |
202 |
24883200 |
|
|
239427403 |
DOOMJUICE |
G |
Dec. 28, 2023, 11:02 p.m. |
OK |
Java 11 |
TESTS |
35 |
249 |
31436800 |
|
|
239417043 |
arnav_gupta |
G |
Dec. 28, 2023, 7:45 p.m. |
OK |
Java 11 |
TESTS |
25 |
280 |
25292800 |
|
|
239446142 |
KAZHYI |
G |
Dec. 29, 2023, 5:21 a.m. |
OK |
Java 17 |
TESTS |
35 |
248 |
46694400 |
|
|
239446200 |
KAZHYI |
G |
Dec. 29, 2023, 5:22 a.m. |
OK |
Java 17 |
TESTS |
35 |
295 |
46694400 |
|
|
239411128 |
susvant |
G |
Dec. 28, 2023, 6:37 p.m. |
OK |
Java 21 |
TESTS |
25 |
265 |
47718400 |
|
|
239437122 |
frey4 |
G |
Dec. 29, 2023, 3:19 a.m. |
OK |
Java 21 |
TESTS |
35 |
280 |
41881600 |
|
|
239421490 |
sarthakmanna |
G |
Dec. 28, 2023, 8:51 p.m. |
OK |
Java 21 |
TESTS |
25 |
1248 |
48025600 |
|
|
239420215 |
sarthakmanna |
G |
Dec. 28, 2023, 8:31 p.m. |
OK |
Java 21 |
TESTS |
25 |
1481 |
47820800 |
|
|
239424495 |
yadavDipesh |
G |
Dec. 28, 2023, 9:50 p.m. |
OK |
Java 8 |
TESTS |
35 |
171 |
26521600 |
|
|
239426880 |
NerfThis |
G |
Dec. 28, 2023, 10:47 p.m. |
OK |
Java 8 |
TESTS |
35 |
187 |
38195200 |
|
|
239416429 |
Sumitsingh7 |
G |
Dec. 28, 2023, 7:37 p.m. |
OK |
Java 8 |
TESTS |
25 |
280 |
40960000 |
|
|
239414143 |
PixelCat |
G |
Dec. 28, 2023, 7:09 p.m. |
OK |
Kotlin 1.9 |
TESTS |
25 |
405 |
124825600 |
|
|
239425898 |
Keval_78 |
G |
Dec. 28, 2023, 10:22 p.m. |
OK |
PyPy 3 |
TESTS |
35 |
577 |
111001600 |
|
|
239432474 |
hxu10 |
G |
Dec. 29, 2023, 1:37 a.m. |
OK |
PyPy 3 |
TESTS |
35 |
1918 |
69939200 |
|
|
239414801 |
abhaumik24 |
G |
Dec. 28, 2023, 7:17 p.m. |
OK |
PyPy 3 |
TESTS |
25 |
3212 |
49868800 |
|
|
239413680 |
gardengnome |
G |
Dec. 28, 2023, 7:04 p.m. |
OK |
PyPy 3-64 |
TESTS |
25 |
124 |
36761600 |
|
|
239413049 |
gardengnome |
G |
Dec. 28, 2023, 6:56 p.m. |
OK |
PyPy 3-64 |
TESTS |
25 |
140 |
38092800 |
|
|
239449775 |
fatalerror |
G |
Dec. 29, 2023, 6 a.m. |
OK |
PyPy 3-64 |
TESTS |
35 |
186 |
37888000 |
|
|
239410142 |
theRealChainman |
G |
Dec. 28, 2023, 6:28 p.m. |
OK |
PyPy 3-64 |
TESTS |
25 |
187 |
40550400 |
|
|
239427499 |
cy171 |
G |
Dec. 28, 2023, 11:05 p.m. |
OK |
PyPy 3-64 |
TESTS |
35 |
280 |
39424000 |
|
|
239449907 |
wlgh7407 |
G |
Dec. 29, 2023, 6:01 a.m. |
OK |
PyPy 3-64 |
TESTS |
35 |
295 |
47206400 |
|
|
239433613 |
chestnut890123 |
G |
Dec. 29, 2023, 2:06 a.m. |
OK |
PyPy 3-64 |
TESTS |
35 |
327 |
45158400 |
|
|
239425722 |
RobinFromTheHood |
G |
Dec. 28, 2023, 10:17 p.m. |
OK |
PyPy 3-64 |
TESTS |
35 |
327 |
48640000 |
|
|
239424671 |
RobinFromTheHood |
G |
Dec. 28, 2023, 9:54 p.m. |
OK |
PyPy 3-64 |
TESTS |
35 |
358 |
57856000 |
|
|
239406174 |
Sort |
G |
Dec. 28, 2023, 5:56 p.m. |
OK |
PyPy 3-64 |
TESTS |
25 |
374 |
49561600 |
|
|
239408485 |
yiiilonggg |
G |
Dec. 28, 2023, 6:13 p.m. |
OK |
Python 3 |
TESTS |
25 |
46 |
6246400 |
|
|
239449878 |
2110030203 |
G |
Dec. 29, 2023, 6:01 a.m. |
OK |
Python 3 |
TESTS |
35 |
187 |
6246400 |
|
|
239430014 |
hayley17 |
G |
Dec. 29, 2023, 12:25 a.m. |
OK |
Python 3 |
TESTS |
35 |
280 |
23654400 |
|
|
239440912 |
liut |
G |
Dec. 29, 2023, 4:16 a.m. |
OK |
Rust 2021 |
TESTS |
35 |
186 |
10956800 |
|
|
remove filters
Back to search problems