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 |
---|---|---|---|---|---|---|
1725 | COMPFEST 14 - Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 74881463 | Sept. 4, 2022, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1678 ) | C | Circular Mirror | PROGRAMMING | binary search combinatorics math two pointers |
B'Pak Chanek has a mirror in the shape of a circle. There are N lamps on the circumference numbered from 1 to N in clockwise order. The length of the arc from lamp i to lamp i+1 is D_i for 1 <= q i <= q N-1 . Meanwhile, the length of the arc between lamp N and lamp 1 is D_N . Pak Chanek wants to colour the lamps with M different colours. Each lamp can be coloured with one of the M colours. However, there cannot be three different lamps such that the colours of the three lamps are the same and the triangle made by considering the three lamps as vertices is a right triangle (triangle with one of its angles being exactly 90 degrees). The following are examples of lamp colouring configurations on the circular mirror. Before colouring the lamps, Pak Chanek wants to know the number of distinct colouring configurations he can make. Count the number of distinct possible lamp colouring configurations, modulo 998 ,244 ,353 . The first line contains two integers N and M ( 1 <= N <= 3 cdot 10^5 , 2 <= M <= 3 cdot 10^5 ) -- the number of lamps in the mirror and the number of different colours used. The second line contains N integers D_1, D_2, ldots, D_N ( 1 <= D_i <= 10^9 ) -- the lengths of the arcs between the lamps in the mirror. An integer representing the number of possible lamp colouring configurations, modulo 998 ,244 ,353 . In the first example, all correct lamp colouring configurations are [1, 1, 2, 1] , [1, 1, 2, 2] , [1, 2, 1, 2] , [1, 2, 2, 1] , [1, 2, 2, 2] , [2, 1, 1, 1] , [2, 1, 1, 2] , [2, 1, 2, 1] , [2, 2, 1, 1] , and [2, 2, 1, 2] . '... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
170856929 | IcMtr _Rekoirive bcr_233 | C | Sept. 4, 2022, 2:34 p.m. | OK | GNU C++14 | TESTS | 31 | 109 | 4812800 | ||
170862883 | Peanut.Tang hzoiliuchang2 Hatate | C | Sept. 4, 2022, 3:14 p.m. | OK | GNU C++14 | TESTS | 31 | 155 | 8396800 | ||
170883223 | acacaction TEoS | C | Sept. 4, 2022, 6:25 p.m. | OK | GNU C++14 | TESTS | 31 | 202 | 9625600 | ||
170881080 | 1potato2potato rzirvi13 omeganot | C | Sept. 4, 2022, 6:02 p.m. | OK | GNU C++14 | TESTS | 31 | 280 | 19763200 | ||
170851603 | Mr_Eight wangziji Qingyu | C | Sept. 4, 2022, 2:04 p.m. | OK | GNU C++14 | TESTS | 31 | 280 | 32051200 | ||
170864425 | antimo51 verjun | C | Sept. 4, 2022, 3:25 p.m. | OK | GNU C++14 | TESTS | 31 | 295 | 14438400 | ||
170855933 | alek0618 RGB_ICPC7 RGB_ICPC1 | C | Sept. 4, 2022, 2:28 p.m. | OK | GNU C++14 | TESTS | 31 | 311 | 49868800 | ||
170878062 | tin-jyu | C | Sept. 4, 2022, 5:27 p.m. | OK | GNU C++14 | TESTS | 31 | 312 | 84172800 | ||
170862241 | ioidream MinhTuan11 vidut_206_CNH | C | Sept. 4, 2022, 3:09 p.m. | OK | GNU C++14 | TESTS | 31 | 358 | 4812800 | ||
170868656 | faqak Summer_ring | C | Sept. 4, 2022, 4 p.m. | OK | GNU C++14 | TESTS | 31 | 358 | 5120000 | ||
170864561 | Bobocan | C | Sept. 4, 2022, 3:26 p.m. | OK | GNU C++17 | TESTS | 31 | 62 | 5324800 | ||
170862307 | dfgzm Edison829 Whiteqwq | C | Sept. 4, 2022, 3:09 p.m. | OK | GNU C++17 | TESTS | 31 | 124 | 9625600 | ||
170869578 | Aging1986 | C | Sept. 4, 2022, 4:08 p.m. | OK | GNU C++17 | TESTS | 31 | 156 | 5120000 | ||
170862507 | quanlt206 lmqzzz ShineNoLife | C | Sept. 4, 2022, 3:11 p.m. | OK | GNU C++17 | TESTS | 31 | 156 | 6041600 | ||
170902633 | baddog | C | Sept. 5, 2022, 1:25 a.m. | OK | GNU C++17 | TESTS | 31 | 171 | 4812800 | ||
170903293 | Chenyu_Qiu | C | Sept. 5, 2022, 1:44 a.m. | OK | GNU C++17 | TESTS | 31 | 171 | 5120000 | ||
170863936 | Milesian liouzhou_101 lucifer1004 | C | Sept. 4, 2022, 3:22 p.m. | OK | GNU C++17 | TESTS | 31 | 171 | 6041600 | ||
170885575 | luat2003 | C | Sept. 4, 2022, 6:51 p.m. | OK | GNU C++17 | TESTS | 31 | 171 | 7270400 | ||
170865873 | Gmacem | C | Sept. 4, 2022, 3:37 p.m. | OK | GNU C++17 | TESTS | 31 | 186 | 10444800 | ||
170857558 | madmax klimoza | C | Sept. 4, 2022, 2:38 p.m. | OK | GNU C++17 | TESTS | 31 | 187 | 7270400 | ||
170860885 | kotatsugame | C | Sept. 4, 2022, 2:59 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 77 | 3993600 | ||
170904831 | thiago_bastos | C | Sept. 5, 2022, 2:29 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 77 | 11980800 | ||
170867703 | shellbertt McPqndq mattagar6 | C | Sept. 4, 2022, 3:52 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 78 | 7270400 | ||
170859377 | bashkort | C | Sept. 4, 2022, 2:49 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 78 | 8396800 | ||
170871332 | pachico | C | Sept. 4, 2022, 4:23 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 93 | 15052800 | ||
170848756 | errorgorn | C | Sept. 4, 2022, 1:52 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 93 | 20889600 | ||
170861861 | cuiaoxiang | C | Sept. 4, 2022, 3:06 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 124 | 20787200 | ||
170851849 | potato167 | C | Sept. 4, 2022, 2:06 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 124 | 21606400 | ||
170864548 | mbdbr | C | Sept. 4, 2022, 3:26 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 139 | 3584000 | ||
170887048 | teruel | C | Sept. 4, 2022, 7:13 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 140 | 21708800 | ||
170853186 | jiangly | C | Sept. 4, 2022, 2:12 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 62 | 4812800 | ||
170882672 | nguyenhoangminh3182003 | C | Sept. 4, 2022, 6:19 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 62 | 6041600 | ||
170869553 | quanmcvn vuavisao | C | Sept. 4, 2022, 4:08 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 62 | 7270400 | ||
170860485 | yyljkydr Suika_predator oipotato | C | Sept. 4, 2022, 2:56 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 62 | 10137600 | ||
170871409 | Nero | C | Sept. 4, 2022, 4:23 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 77 | 4812800 | ||
170859508 | A_G | C | Sept. 4, 2022, 2:50 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 77 | 6041600 | ||
170905045 | Ja_king | C | Sept. 5, 2022, 2:35 a.m. | OK | GNU C++20 (64) | TESTS | 31 | 77 | 19251200 | ||
170883991 | Igor_Parfenov | C | Sept. 4, 2022, 6:32 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 78 | 4812800 | ||
170868363 | qualdoom t4m0fey AndreyPavlov | C | Sept. 4, 2022, 3:57 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 78 | 4812800 | ||
170856569 | Bench0310 | C | Sept. 4, 2022, 2:31 p.m. | OK | GNU C++20 (64) | TESTS | 31 | 78 | 4812800 | ||
170860054 | ekwek | C | Sept. 4, 2022, 2:53 p.m. | OK | Java 11 | TESTS | 31 | 592 | 2764800 | ||
170899365 | dzhi | C | Sept. 4, 2022, 11:37 p.m. | OK | Java 11 | TESTS | 31 | 951 | 30105600 | ||
170908703 | Sussykin | C | Sept. 5, 2022, 4:12 a.m. | OK | Java 8 | TESTS | 31 | 343 | 14438400 | ||
170856073 | arvindf232 happypotato1207 nicholask | C | Sept. 4, 2022, 2:28 p.m. | OK | Kotlin 1.6 | TESTS | 31 | 795 | 30515200 | ||
170863500 | Jimanbanashi | C | Sept. 4, 2022, 3:18 p.m. | OK | PyPy 2 | TESTS | 31 | 608 | 57958400 | ||
170868147 | huangxw | C | Sept. 4, 2022, 3:56 p.m. | OK | PyPy 3-64 | TESTS | 31 | 529 | 81408000 | ||
170884347 | blue_ice_yj | C | Sept. 4, 2022, 6:36 p.m. | OK | PyPy 3-64 | TESTS | 31 | 779 | 58368000 | ||
170866205 | mQfZ ASawe2.6Main | C | Sept. 4, 2022, 3:40 p.m. | OK | PyPy 3-64 | TESTS | 31 | 841 | 66662400 | ||
170869492 | Wendy0317 | C | Sept. 4, 2022, 4:07 p.m. | OK | PyPy 3-64 | TESTS | 31 | 997 | 51302400 |
Back to search problems