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 |
---|---|---|---|---|---|---|
1932 | Codeforces Round 927 (Div. 3) | FINISHED | False | 8100 | 28922063 | Feb. 18, 2024, 12:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1121 ) | G | Moving Platforms | PROGRAMMING | graphs math number theory shortest paths |
B"There is a game where you need to move through a labyrinth. The labyrinth consists of n platforms, connected by m passages. Each platform is at some level l_i , an integer number from 0 to H - 1 . In a single step, if you are currently on platform i , you can stay on it, or move to another platform j . To move to platform j they have to be connected by the passage, and their levels have to be the same, namely l_i = l_j . After each step, the levels of all platforms change. The new level of platform i is calculated as l'_i = (l_i + s_i) bmod H , for all i . You start on platform 1 . Find the minimum number of steps you need to get to platform n . The first line of input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then the descriptions of the test cases follow. The first line of each test case contains three integers n , m , and H ( 2 <= n <= 10^5 , 1 <= m <= 10^5 , 1 <= H <= 10^9 ). The second line contains n integers l_i , the initial level of each platform ( 0 <= l_i <= H-1 ). The third line contains n integers s_i , the change of level for each platform ( 0 <= s_i <= H-1 ). Next m lines contain a description of the passages. Each passage is described as a pair of integers -- the platforms, connected by the passage. There is at most one passage connecting each pair of platforms, and there is no passage connecting a platform to itself. The sum of n for all tests does not exceed 10^5 , the sum of m for all tests does not exceed 10^5 . For each test case, print a single integer, the minimum number of steps needed to get from platform 1 to platform n . If it is impossible to get to platform n , print -1 . This is how levels of the platforms change, and what actions we need to perform in the first example. Platform 1Pl"... |
126196 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
247217736 | mban259 | G | Feb. 19, 2024, 2:15 p.m. | OK | C# 10 | TESTS | 32 | 374 | 50483200 | ||
247363647 | pkhaustov | G | Feb. 19, 2024, 4:47 p.m. | OK | GNU C++17 | TESTS | 32 | 217 | 7680000 | ||
247180810 | Aadey_Shah | G | Feb. 19, 2024, 9:19 a.m. | OK | GNU C++17 | TESTS | 32 | 218 | 8704000 | ||
247163850 | 202101101 | G | Feb. 19, 2024, 6:27 a.m. | OK | GNU C++17 | TESTS | 32 | 218 | 8704000 | ||
247207545 | qikala7777 | G | Feb. 19, 2024, 1:02 p.m. | OK | GNU C++17 | TESTS | 32 | 218 | 47206400 | ||
247189832 | hht2005 | G | Feb. 19, 2024, 10:34 a.m. | OK | GNU C++17 | TESTS | 32 | 233 | 8601600 | ||
247411850 | Dell_Know | G | Feb. 20, 2024, 1:40 a.m. | OK | GNU C++17 | TESTS | 32 | 234 | 13516800 | ||
247128847 | franfill | G | Feb. 18, 2024, 6:10 p.m. | OK | GNU C++17 | TESTS | 32 | 249 | 8294400 | ||
247133263 | REN_REN | G | Feb. 18, 2024, 6:52 p.m. | OK | GNU C++17 | TESTS | 32 | 249 | 10547200 | ||
247195225 | mr.tj.mr | G | Feb. 19, 2024, 11:23 a.m. | OK | GNU C++17 | TESTS | 32 | 249 | 12288000 | ||
247172023 | wishgoodluck | G | Feb. 19, 2024, 8:10 a.m. | OK | GNU C++17 | TESTS | 32 | 249 | 12288000 | ||
247201512 | a999999 | G | Feb. 19, 2024, 12:17 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 140 | 12083200 | ||
247156536 | jackylova_fan_fan_fan | G | Feb. 19, 2024, 4:55 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 156 | 16281600 | ||
247206193 | -XXP- | G | Feb. 19, 2024, 12:53 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 171 | 10649600 | ||
247128508 | Remote_Dream | G | Feb. 18, 2024, 6:08 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 171 | 12697600 | ||
247194016 | spamers | G | Feb. 19, 2024, 11:12 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 186 | 8908800 | ||
247177302 | TLS_Hello | G | Feb. 19, 2024, 8:52 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 186 | 9420800 | ||
247419258 | abbcc__1 | G | Feb. 20, 2024, 3:30 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 187 | 10342400 | ||
247428919 | plus_cat | G | Feb. 20, 2024, 5:35 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 187 | 12595200 | ||
247208925 | decade_66 | G | Feb. 19, 2024, 1:12 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 187 | 15360000 | ||
247184007 | scutsky | G | Feb. 19, 2024, 9:44 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 202 | 10752000 | ||
247200278 | Xorzj | G | Feb. 19, 2024, 12:06 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 124 | 9113600 | ||
247186184 | laflame2 | G | Feb. 19, 2024, 10:03 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 139 | 11161600 | ||
247199672 | Mu_Silk | G | Feb. 19, 2024, 12:01 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 140 | 11059200 | ||
247188714 | etuc | G | Feb. 19, 2024, 10:23 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 140 | 15257600 | ||
247177284 | knightzzz1 | G | Feb. 19, 2024, 8:52 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 155 | 13926400 | ||
247177727 | Maburb | G | Feb. 19, 2024, 8:56 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 156 | 8806400 | ||
247126509 | NH_ | G | Feb. 18, 2024, 5:50 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 156 | 8806400 | ||
247126018 | 2847940240 | G | Feb. 18, 2024, 5:46 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 156 | 8806400 | ||
247405197 | nskybytskyi | G | Feb. 19, 2024, 11:18 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 156 | 9318400 | ||
247128628 | ItzDesert | G | Feb. 18, 2024, 6:08 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 156 | 11366400 | ||
247404661 | cpp10 | G | Feb. 19, 2024, 11:03 p.m. | OK | Java 21 | TESTS | 32 | 592 | 20070400 | ||
247421253 | dzhi | G | Feb. 20, 2024, 3:56 a.m. | OK | Java 21 | TESTS | 32 | 639 | 18636800 | ||
247404528 | cpp10 | G | Feb. 19, 2024, 11 p.m. | OK | Java 21 | TESTS | 32 | 639 | 20480000 | ||
247126624 | dzhi | G | Feb. 18, 2024, 5:52 p.m. | OK | Java 21 | TESTS | 32 | 701 | 18841600 | ||
247127882 | dzhi | G | Feb. 18, 2024, 6:02 p.m. | OK | Java 21 | TESTS | 32 | 748 | 19251200 | ||
247126397 | dzhi | G | Feb. 18, 2024, 5:49 p.m. | OK | Java 21 | TESTS | 32 | 810 | 30515200 | ||
247140782 | OLOGY | G | Feb. 18, 2024, 8:16 p.m. | OK | PyPy 2 | TESTS | 32 | 1014 | 31334400 | ||
247200124 | OLOGY | G | Feb. 19, 2024, 12:05 p.m. | OK | PyPy 2 | TESTS | 32 | 1232 | 31539200 | ||
247199751 | OLOGY | G | Feb. 19, 2024, 12:01 p.m. | OK | PyPy 2 | TESTS | 32 | 1387 | 30720000 | ||
247154822 | OLOGY | G | Feb. 19, 2024, 4:36 a.m. | OK | PyPy 2 | TESTS | 32 | 1481 | 31744000 | ||
247141018 | OLOGY | G | Feb. 18, 2024, 8:18 p.m. | OK | PyPy 2 | TESTS | 32 | 1544 | 31539200 | ||
247141856 | good_boy69696 | G | Feb. 18, 2024, 8:29 p.m. | OK | PyPy 2 | TESTS | 32 | 1559 | 31539200 | ||
247142490 | OLOGY | G | Feb. 18, 2024, 8:38 p.m. | OK | PyPy 2 | TESTS | 32 | 1560 | 30924800 | ||
247138761 | OLOGY | G | Feb. 18, 2024, 7:50 p.m. | OK | PyPy 2 | TESTS | 32 | 1575 | 31129600 | ||
247136927 | OLOGY | G | Feb. 18, 2024, 7:30 p.m. | OK | PyPy 2 | TESTS | 32 | 1622 | 31539200 | ||
247140814 | OLOGY | G | Feb. 18, 2024, 8:16 p.m. | OK | PyPy 2 | TESTS | 32 | 1809 | 32358400 | ||
247152516 | YMSeah | G | Feb. 19, 2024, 4:04 a.m. | OK | PyPy 3 | TESTS | 32 | 810 | 20684800 | ||
247152587 | YMSeah | G | Feb. 19, 2024, 4:05 a.m. | OK | PyPy 3-64 | TESTS | 32 | 732 | 27545600 | ||
247421893 | hunglomdom | G | Feb. 20, 2024, 4:04 a.m. | OK | PyPy 3-64 | TESTS | 32 | 748 | 48230400 | ||
247136926 | gardengnome | G | Feb. 18, 2024, 7:30 p.m. | OK | PyPy 3-64 | TESTS | 32 | 763 | 29286400 | ||
247138057 | gardengnome | G | Feb. 18, 2024, 7:42 p.m. | OK | PyPy 3-64 | TESTS | 32 | 780 | 29696000 | ||
247153527 | hushbek_2009 | G | Feb. 19, 2024, 4:17 a.m. | OK | PyPy 3-64 | TESTS | 32 | 872 | 32870400 | ||
247195496 | StanMarsh-SP | G | Feb. 19, 2024, 11:26 a.m. | OK | PyPy 3-64 | TESTS | 32 | 904 | 37171200 | ||
247125551 | AyuAnchor | G | Feb. 18, 2024, 5:41 p.m. | OK | PyPy 3-64 | TESTS | 32 | 920 | 32460800 | ||
247125339 | nits-starters | G | Feb. 18, 2024, 5:39 p.m. | OK | PyPy 3-64 | TESTS | 32 | 982 | 32870400 | ||
247308868 | Sam_Jiang | G | Feb. 19, 2024, 3:33 p.m. | OK | PyPy 3-64 | TESTS | 32 | 1138 | 82534400 | ||
247199568 | OLOGY | G | Feb. 19, 2024, noon | OK | Python 2 | TESTS | 32 | 1824 | 29491200 | ||
247200866 | OLOGY | G | Feb. 19, 2024, 12:11 p.m. | OK | Python 2 | TESTS | 32 | 1965 | 29491200 | ||
247154794 | OLOGY | G | Feb. 19, 2024, 4:36 a.m. | OK | Python 2 | TESTS | 32 | 1965 | 29491200 | ||
247357829 | cse_2100031107 | G | Feb. 19, 2024, 4:38 p.m. | OK | Python 2 | TESTS | 32 | 2230 | 29491200 | ||
247140898 | OLOGY | G | Feb. 18, 2024, 8:17 p.m. | OK | Python 2 | TESTS | 32 | 2230 | 29491200 | ||
247141522 | snamy520 | G | Feb. 18, 2024, 8:24 p.m. | OK | Rust 2021 | TESTS | 32 | 202 | 14745600 | ||
247145572 | snamy520 | G | Feb. 18, 2024, 9:24 p.m. | OK | Rust 2021 | TESTS | 32 | 202 | 15462400 |
Back to search problems