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 |
---|---|---|---|---|---|---|
1850 | Codeforces Round 886 (Div. 4) | FINISHED | False | 7200 | 47229863 | July 21, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 8567 ) | H | The Third Letter | PROGRAMMING | dfs and similar graphs greedy implementation |
B'In order to win his toughest battle, Mircea came up with a great strategy for his army. He has n soldiers and decided to arrange them in a certain way in camps. Each soldier has to belong to exactly one camp, and there is one camp at each integer point on the x -axis (at points cdots, -2, -1, 0, 1, 2, cdots ). The strategy consists of m conditions. Condition i tells that soldier a_i should belong to a camp that is situated d_i meters in front of the camp that person b_i belongs to. (If d_i < 0 , then a_i 's camp should be -d_i meters behind b_i 's camp.) Now, Mircea wonders if there exists a partition of soldiers that respects the condition and he asks for your help! Answer "YES" if there is a partition of the n soldiers that satisfies all of the m conditions and "NO" otherwise. Note that two different soldiers may be placed in the same camp. The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains two positive integers n and m ( 2 <= q n <= q 2 cdot 10^5 ; 1 <= q m <= q n ) -- the number of soldiers, and the number of conditions respectively. Then m lines follow, each of them containing 3 integers: a_i , b_i , d_i ( a_i neq b_i ; 1 <= q a_i, b_i <= q n ; -10^9 <= q d_i <= q 10^9 ) -- denoting the conditions explained in the statement. Note that if d_i is positive, a_i should be d_i meters in front of b_i and if it is negative, a_i should be -d_i meters behind b_i . Note that the sum of n over all test cases doesn 't exceed 2 cdot 10^5 . For each test case, output "YES" if there is an arrangement of the n soldiers that satisfies all of the m conditions and "NO" otherwise. For the first test case, we can partition the soldiers into camps in the following way'... |
Codeforces Round #886 (Div. 4) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
215108911 | NenadDapic | H | July 22, 2023, 11:16 p.m. | OK | FPC | TESTS | 46 | 140 | 5734400 | ||
215108674 | NenadDapic | H | July 22, 2023, 11:10 p.m. | OK | FPC | TESTS | 46 | 156 | 5734400 | ||
215113850 | dkdk | H | July 23, 2023, 1:21 a.m. | OK | GNU C++14 | TESTS | 46 | 93 | 22220800 | ||
215024550 | xizhao | H | July 22, 2023, 9:31 a.m. | OK | GNU C++14 | TESTS | 46 | 171 | 2457600 | ||
215081405 | div7011 | H | July 22, 2023, 5:26 p.m. | OK | GNU C++14 | TESTS | 46 | 171 | 9625600 | ||
215014329 | yyawdxhp | H | July 22, 2023, 8:12 a.m. | OK | GNU C++14 | TESTS | 46 | 171 | 18432000 | ||
215118254 | Special_Judge | H | July 23, 2023, 2:43 a.m. | OK | GNU C++14 | TESTS | 46 | 171 | 61849600 | ||
215022023 | UpUpU | H | July 22, 2023, 9:13 a.m. | OK | GNU C++14 | TESTS | 46 | 186 | 10035200 | ||
215076010 | DgutGWK | H | July 22, 2023, 4:44 p.m. | OK | GNU C++14 | TESTS | 46 | 186 | 14438400 | ||
215067021 | MrPython | H | July 22, 2023, 3:45 p.m. | OK | GNU C++14 | TESTS | 46 | 187 | 7065600 | ||
215056862 | creating001 | H | July 22, 2023, 2:36 p.m. | OK | GNU C++14 | TESTS | 46 | 202 | 7680000 | ||
215057512 | Nathan.Li | H | July 22, 2023, 2:40 p.m. | OK | GNU C++14 | TESTS | 46 | 202 | 13414400 | ||
215116175 | Destiny. | H | July 23, 2023, 2:05 a.m. | OK | GNU C++17 | TESTS | 46 | 140 | 7987200 | ||
215128679 | sml666 | H | July 23, 2023, 5:41 a.m. | OK | GNU C++17 | TESTS | 46 | 156 | 8806400 | ||
215064502 | obadaa.masri | H | July 22, 2023, 3:27 p.m. | OK | GNU C++17 | TESTS | 46 | 171 | 5632000 | ||
215029303 | Wanglf | H | July 22, 2023, 10:20 a.m. | OK | GNU C++17 | TESTS | 46 | 171 | 11161600 | ||
215016548 | ACM--cmr | H | July 22, 2023, 8:29 a.m. | OK | GNU C++17 | TESTS | 46 | 171 | 11264000 | ||
215088214 | r1kvay | H | July 22, 2023, 6:22 p.m. | OK | GNU C++17 | TESTS | 46 | 171 | 24166400 | ||
215128850 | yuechu | H | July 23, 2023, 5:43 a.m. | OK | GNU C++17 | TESTS | 46 | 186 | 9625600 | ||
215085325 | hrill | H | July 22, 2023, 5:58 p.m. | OK | GNU C++17 | TESTS | 46 | 186 | 15974400 | ||
215071012 | T3T____ | H | July 22, 2023, 4:10 p.m. | OK | GNU C++17 | TESTS | 46 | 186 | 18432000 | ||
215112771 | tbzard | H | July 23, 2023, 12:57 a.m. | OK | GNU C++17 | TESTS | 46 | 186 | 22016000 | ||
215016133 | Goinggo | H | July 22, 2023, 8:26 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 124 | 18432000 | ||
215129060 | minimok | H | July 23, 2023, 5:47 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 140 | 12083200 | ||
215068725 | Big-flaw | H | July 22, 2023, 3:56 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 140 | 14950400 | ||
215107565 | efishel | H | July 22, 2023, 10:43 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 170 | 18124800 | ||
215083656 | Nika. | H | July 22, 2023, 5:45 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 171 | 35225600 | ||
215069600 | Linver | H | July 22, 2023, 4:02 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 186 | 13107200 | ||
215069684 | Mhamad_aboaljood | H | July 22, 2023, 4:02 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 186 | 14848000 | ||
215089582 | TsotneSV | H | July 22, 2023, 6:34 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 186 | 32256000 | ||
215017363 | Goinggo | H | July 22, 2023, 8:37 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 187 | 13107200 | ||
215090990 | jahid_hridoy | H | July 22, 2023, 6:48 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 202 | 29081600 | ||
215118064 | qqmy0220 | H | July 23, 2023, 2:39 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 78 | 15155200 | ||
215115718 | wpc123 | H | July 23, 2023, 1:57 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 2457600 | ||
215015028 | xindubawukong | H | July 22, 2023, 8:17 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 2457600 | ||
215116832 | yanhy | H | July 23, 2023, 2:17 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 15155200 | ||
215110100 | ethening | H | July 22, 2023, 11:46 p.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 15155200 | ||
215118503 | buaa_czx | H | July 23, 2023, 2:47 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 15974400 | ||
215019863 | Unreval | H | July 22, 2023, 8:56 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 20787200 | ||
215126893 | a2513472504 | H | July 23, 2023, 5:16 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 28876800 | ||
215111912 | Jared_McDs | H | July 23, 2023, 12:34 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 28876800 | ||
215018386 | KangYao.Li | H | July 22, 2023, 8:44 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 93 | 35225600 | ||
215048608 | Rohinth | H | July 22, 2023, 1:35 p.m. | OK | Java 11 | TESTS | 46 | 670 | 45363200 | ||
215018316 | AbdelrahmanFathy | H | July 22, 2023, 8:44 a.m. | OK | Java 11 | TESTS | 46 | 794 | 57241600 | ||
215053535 | MrMag | H | July 22, 2023, 2:11 p.m. | OK | Java 11 | TESTS | 46 | 810 | 158617600 | ||
215017301 | princeayush04 | H | July 22, 2023, 8:36 a.m. | OK | Java 11 | TESTS | 46 | 857 | 56934400 | ||
215014460 | Yousef_Badr | H | July 22, 2023, 8:13 a.m. | OK | Java 11 | TESTS | 46 | 857 | 63283200 | ||
215050205 | djrfrn | H | July 22, 2023, 1:46 p.m. | OK | Java 11 | TESTS | 46 | 982 | 209612800 | ||
215049531 | merlin_ | H | July 22, 2023, 1:41 p.m. | OK | Java 17 | TESTS | 46 | 780 | 79462400 | ||
215018700 | Danger_Don | H | July 22, 2023, 8:46 a.m. | OK | Java 17 | TESTS | 46 | 841 | 38604800 | ||
215099606 | _ryan18_ | H | July 22, 2023, 8:28 p.m. | OK | Java 17 | TESTS | 46 | 904 | 101990400 | ||
215096003 | ADust | H | July 22, 2023, 7:43 p.m. | OK | Java 17 | TESTS | 46 | 997 | 109875200 | ||
215062861 | Jatinydv17 | H | July 22, 2023, 3:16 p.m. | OK | Java 17 | TESTS | 46 | 1013 | 69836800 | ||
215051334 | ning1ing | H | July 22, 2023, 1:54 p.m. | OK | Java 17 | TESTS | 46 | 1590 | 79257600 | ||
215053744 | American_Eagle | H | July 22, 2023, 2:12 p.m. | OK | Java 8 | TESTS | 46 | 670 | 52531200 | ||
215076745 | vatsal_04 | H | July 22, 2023, 4:48 p.m. | OK | Java 8 | TESTS | 46 | 670 | 55910400 | ||
215048661 | yvbf | H | July 22, 2023, 1:36 p.m. | OK | Java 8 | TESTS | 46 | 858 | 77107200 | ||
215019287 | amaturecoder | H | July 22, 2023, 8:51 a.m. | OK | Java 8 | TESTS | 46 | 1232 | 233676800 | ||
215053486 | Toosid | H | July 22, 2023, 2:10 p.m. | OK | Java 8 | TESTS | 46 | 1653 | 71372800 | ||
215104519 | Voz56 | H | July 22, 2023, 9:40 p.m. | OK | MS C++ 2017 | TESTS | 46 | 592 | 59392000 | ||
215053706 | DilshodbekX | H | July 22, 2023, 2:12 p.m. | OK | PascalABC.NET | TESTS | 46 | 342 | 25600000 | ||
215062582 | AyuAnchor | H | July 22, 2023, 3:14 p.m. | OK | PyPy 3-64 | TESTS | 46 | 296 | 12390400 | ||
215101066 | crapcode | H | July 22, 2023, 8:48 p.m. | OK | PyPy 3-64 | TESTS | 46 | 467 | 39014400 | ||
215091163 | Arnoob2120 | H | July 22, 2023, 6:50 p.m. | OK | PyPy 3-64 | TESTS | 46 | 701 | 71372800 | ||
215070267 | rmr | H | July 22, 2023, 4:05 p.m. | OK | PyPy 3-64 | TESTS | 46 | 717 | 56934400 | ||
215065780 | eternal_happiness | H | July 22, 2023, 3:36 p.m. | OK | PyPy 3-64 | TESTS | 46 | 1044 | 40755200 | ||
215120997 | Youarenotgood | H | July 23, 2023, 3:29 a.m. | OK | PyPy 3-64 | TESTS | 46 | 1231 | 100761600 | ||
215107401 | xiaowuc1 | H | July 22, 2023, 10:39 p.m. | OK | PyPy 3-64 | TESTS | 46 | 1513 | 53248000 | ||
215127513 | nirlep5252 | H | July 23, 2023, 5:26 a.m. | OK | Rust 2021 | TESTS | 46 | 280 | 93081600 |
Back to search problems