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 |
---|---|---|---|---|---|---|
1691 | CodeCraft-22 and Codeforces Round 795 (Div. 2) | FINISHED | False | 7200 | 83172263 | May 31, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1879 ) | E | Number of Groups | PROGRAMMING | data structures dfs and similar ds graphs greedy sortings |
B'You are given n colored segments on the number line. Each segment is either colored red or blue. The i -th segment can be represented by a tuple (c_i, l_i, r_i) . The segment contains all the points in the range [l_i, r_i] , inclusive, and its color denoted by c_i : We say that two segments of different colors are connected, if they share at least one common point. Two segments belong to the same group, if they are either connected directly, or through a sequence of directly connected segments. Find the number of groups of segments. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^5 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 10^5 ) -- the number of segments. Each of the next n lines contains three integers c_i, l_i, r_i ( 0 <= q c_i <= q 1, 0 <= q l_i <= q r_i <= q 10^9 ), describing the i -th segment. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print a single integer k , the number of groups of segments. In the first example there are 5 segments. The segments 1 and 2 are connected, because they are of different colors and share a point. Also, the segments 2 and 3 are connected, and so are segments 4 and 5 . Thus, there are two groups: one containing segments {1, 2, 3 } , and the other one containing segments {4, 5 } . '... |
Editorial for CodeCraft-22 and Codeforces Round #795 (Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
159131633 | A_normal_OIer | E | June 1, 2022, 7:01 a.m. | OK | GNU C++14 | TESTS | 48 | 93 | 1536000 | ||
159164684 | Cafard | E | June 1, 2022, 1:20 p.m. | OK | GNU C++14 | TESTS | 48 | 93 | 8294400 | ||
159161147 | vjudge4 | E | June 1, 2022, 12:39 p.m. | OK | GNU C++14 | TESTS | 48 | 109 | 6553600 | ||
159165502 | bkifhr7 | E | June 1, 2022, 1:28 p.m. | OK | GNU C++14 | TESTS | 48 | 109 | 8294400 | ||
159158377 | liuyaningqwq | E | June 1, 2022, 12:07 p.m. | OK | GNU C++14 | TESTS | 48 | 109 | 9420800 | ||
159121703 | lukamosiashvili | E | June 1, 2022, 4:52 a.m. | OK | GNU C++14 | TESTS | 48 | 139 | 8601600 | ||
159169292 | 1564269628 | E | June 1, 2022, 2:10 p.m. | OK | GNU C++14 | TESTS | 48 | 139 | 13824000 | ||
159157927 | vjudge4 | E | June 1, 2022, 12:02 p.m. | OK | GNU C++14 | TESTS | 48 | 140 | 4812800 | ||
159157881 | displace | E | June 1, 2022, 12:01 p.m. | OK | GNU C++14 | TESTS | 48 | 140 | 4812800 | ||
159212163 | zyz07 | E | June 2, 2022, 4:25 a.m. | OK | GNU C++14 | TESTS | 48 | 140 | 6553600 | ||
159136615 | bxhnb | E | June 1, 2022, 8:01 a.m. | OK | GNU C++17 | TESTS | 48 | 62 | 3174400 | ||
159170658 | SiRiehn_nx | E | June 1, 2022, 2:25 p.m. | OK | GNU C++17 | TESTS | 48 | 62 | 5427200 | ||
159147864 | Serendipity__ | E | June 1, 2022, 10:05 a.m. | OK | GNU C++17 | TESTS | 48 | 93 | 1536000 | ||
159208648 | ACMhX | E | June 2, 2022, 2:53 a.m. | OK | GNU C++17 | TESTS | 48 | 93 | 4608000 | ||
159160034 | Lskkkno2 | E | June 1, 2022, 12:26 p.m. | OK | GNU C++17 | TESTS | 48 | 93 | 9216000 | ||
159144426 | lddlinan | E | June 1, 2022, 9:29 a.m. | OK | GNU C++17 | TESTS | 48 | 93 | 10444800 | ||
159129194 | Karashi | E | June 1, 2022, 6:31 a.m. | OK | GNU C++17 | TESTS | 48 | 93 | 66150400 | ||
159129104 | Karashi | E | June 1, 2022, 6:30 a.m. | OK | GNU C++17 | TESTS | 48 | 93 | 66150400 | ||
159145697 | classic | E | June 1, 2022, 9:42 a.m. | OK | GNU C++17 | TESTS | 48 | 108 | 3379200 | ||
159212702 | himadri765 | E | June 2, 2022, 4:37 a.m. | OK | GNU C++17 | TESTS | 48 | 108 | 9728000 | ||
159166139 | YL-9 | E | June 1, 2022, 1:35 p.m. | OK | GNU C++17 (64) | TESTS | 48 | 62 | 5017600 | ||
159191679 | pd_codes | E | June 1, 2022, 6:39 p.m. | OK | GNU C++17 (64) | TESTS | 48 | 77 | 4812800 | ||
159191233 | keijak | E | June 1, 2022, 6:33 p.m. | OK | GNU C++17 (64) | TESTS | 48 | 77 | 11776000 | ||
159143457 | jiajieshi | E | June 1, 2022, 9:19 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 78 | 8294400 | ||
159149781 | illume2021 | E | June 1, 2022, 10:27 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 78 | 13721600 | ||
159212329 | youtsuha | E | June 2, 2022, 4:29 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 93 | 5836800 | ||
159212304 | youtsuha2.0 | E | June 2, 2022, 4:29 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 93 | 5836800 | ||
159148980 | tabr | E | June 1, 2022, 10:18 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 93 | 6144000 | ||
159123834 | Hanasaki | E | June 1, 2022, 5:23 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 93 | 6656000 | ||
159126334 | wrc | E | June 1, 2022, 5:57 a.m. | OK | GNU C++17 (64) | TESTS | 48 | 93 | 7270400 | ||
159207303 | Lavine | E | June 2, 2022, 2:10 a.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 2662400 | ||
159162238 | OceanCat | E | June 1, 2022, 12:52 p.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 3379200 | ||
159158934 | WildBeast_07 | E | June 1, 2022, 12:13 p.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 4300800 | ||
159168093 | Short_Bit | E | June 1, 2022, 1:57 p.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 4915200 | ||
159133056 | fishcathu. | E | June 1, 2022, 7:18 a.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 5017600 | ||
159133012 | fishcathu. | E | June 1, 2022, 7:17 a.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 5017600 | ||
159166919 | Ayham_Dabah | E | June 1, 2022, 1:44 p.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 5324800 | ||
159149148 | Jeopardy_007 | E | June 1, 2022, 10:20 a.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 5939200 | ||
159140470 | Nea1 | E | June 1, 2022, 8:46 a.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 6963200 | ||
159138476 | LeXuanSon | E | June 1, 2022, 8:23 a.m. | OK | GNU C++20 (64) | TESTS | 48 | 62 | 9011200 | ||
159184485 | NO__OB | E | June 1, 2022, 5:09 p.m. | OK | Java 11 | TESTS | 48 | 389 | 8704000 | ||
159196730 | poopoop | E | June 1, 2022, 8:09 p.m. | OK | Java 11 | TESTS | 48 | 498 | 19456000 | ||
159207042 | varliu | E | June 2, 2022, 2:03 a.m. | OK | Java 8 | TESTS | 48 | 1169 | 32153600 | ||
159210226 | varliu | E | June 2, 2022, 3:38 a.m. | OK | Java 8 | TESTS | 48 | 1232 | 32153600 | ||
159191988 | xsc | E | June 1, 2022, 6:43 p.m. | OK | MS C++ 2017 | TESTS | 48 | 342 | 2867200 | ||
159192108 | xsc | E | June 1, 2022, 6:45 p.m. | OK | MS C++ 2017 | TESTS | 48 | 343 | 2867200 | ||
159191898 | xsc | E | June 1, 2022, 6:42 p.m. | OK | MS C++ 2017 | TESTS | 48 | 358 | 2867200 | ||
159136592 | zouyu9631 | E | June 1, 2022, 8:01 a.m. | OK | PyPy 3 | TESTS | 48 | 841 | 27648000 | ||
159137895 | zouyu9631 | E | June 1, 2022, 8:17 a.m. | OK | PyPy 3 | TESTS | 48 | 951 | 28979200 | ||
159132514 | sahilwahi | E | June 1, 2022, 7:11 a.m. | OK | PyPy 3-64 | TESTS | 48 | 795 | 41881600 | ||
159211069 | lemiao12 | E | June 2, 2022, 4:02 a.m. | OK | PyPy 3-64 | TESTS | 48 | 904 | 45568000 | ||
159155806 | rajesh_455 | E | June 1, 2022, 11:36 a.m. | OK | Python 3 | TESTS | 48 | 1481 | 16691200 |
Back to search problems