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 | 74967863 | Sept. 4, 2022, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 505 ) | E | Electrical Efficiency | PROGRAMMING | combinatorics data structures dp number theory trees |
B'In the country of Dengkleknesia, there are N factories numbered from 1 to N . Factory i has an electrical coefficient of A_i . There are also N-1 power lines with the j -th power line connecting factory U_j and factory V_j . It can be guaranteed that each factory in Dengkleknesia is connected to all other factories in Dengkleknesia through one or more power lines. In other words, the collection of factories forms a tree. Each pair of different factories in Dengkleknesia can use one or more existing power lines to transfer electricity to each other. However, each power line needs to be turned on first so that electricity can pass through it. Define f(x, y, z) as the minimum number of power lines that need to be turned on so that factory x can make electrical transfers to factory y and factory z . Also define g(x, y, z) as the number of distinct prime factors of text{GCD}(A_x, A_y, A_z) . To measure the electrical efficiency, you must find the sum of f(x, y, z) x g(x, y, z) for all combinations of (x, y, z) such that 1 <= q x < y < z <= q N . Because the answer can be very large, you just need to output the answer modulo 998 ,244 ,353 . Note: text{GCD}(k_1, k_2, k_3) is the greatest common divisor of k_1 , k_2 , and k_3 , which is the biggest integer that simultaneously divides k_1 , k_2 , and k_3 . The first line contains a single integer N ( 1 <= N <= 2 cdot 10^5 ) -- the number of factories in Dengkleknesia. The second line contains N integers A_1, A_2, ... , A_N ( 1 <= q A_i <= q 2 cdot 10^5 ) -- the electrical coefficients of the factories. The j -th of the next N-1 lines contains two integers U_j and V_j ( 1 <= U_j, V_j <= N ) -- a power line that connects cities U_j and V_j . The collection of factories forms a tree. An integer repr'... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
170880484 | MatrixCascade_qwq themoon | E | Sept. 4, 2022, 5:55 p.m. | OK | GNU C++14 | TESTS | 23 | 904 | 40755200 | ||
170874982 | alek0618 RGB_ICPC7 RGB_ICPC1 | E | Sept. 4, 2022, 4:55 p.m. | OK | GNU C++14 | TESTS | 23 | 935 | 160563200 | ||
170878995 | rapira FeggieBoss Astronomax | E | Sept. 4, 2022, 5:37 p.m. | OK | GNU C++17 | TESTS | 23 | 904 | 78131200 | ||
170872045 | qiqi20021026 SSerxhs Randias | E | Sept. 4, 2022, 4:28 p.m. | OK | GNU C++17 | TESTS | 23 | 904 | 114278400 | ||
170865383 | yyljkydr Suika_predator oipotato | E | Sept. 4, 2022, 3:33 p.m. | OK | GNU C++17 | TESTS | 23 | 1013 | 53350400 | ||
170886713 | realcomplex | E | Sept. 4, 2022, 7:08 p.m. | OK | GNU C++17 | TESTS | 23 | 1512 | 75468800 | ||
170867567 | I_LOVE_DASHA_KARPENKO Wailydest oleh1421 | E | Sept. 4, 2022, 3:51 p.m. | OK | GNU C++17 | TESTS | 23 | 1653 | 60108800 | ||
170873241 | SSRS_ riantkb tatyam | E | Sept. 4, 2022, 4:39 p.m. | OK | GNU C++17 | TESTS | 23 | 2028 | 61030400 | ||
170901652 | faustaadp | E | Sept. 5, 2022, 12:56 a.m. | OK | GNU C++17 | TESTS | 23 | 2932 | 118681600 | ||
170878266 | kotatsugame | E | Sept. 4, 2022, 5:29 p.m. | OK | GNU C++17 (64) | TESTS | 23 | 670 | 63590400 | ||
170867813 | potato167 | E | Sept. 4, 2022, 3:53 p.m. | OK | GNU C++17 (64) | TESTS | 23 | 935 | 102912000 | ||
170876297 | errorgorn | E | Sept. 4, 2022, 5:08 p.m. | OK | GNU C++17 (64) | TESTS | 23 | 1169 | 127180800 | ||
170881906 | PIachta Sophie_Neuenmuller | E | Sept. 4, 2022, 6:11 p.m. | OK | GNU C++17 (64) | TESTS | 23 | 1450 | 54988800 | ||
170882032 | PIachta Sophie_Neuenmuller | E | Sept. 4, 2022, 6:12 p.m. | OK | GNU C++17 (64) | TESTS | 23 | 1465 | 54988800 | ||
170882584 | PIachta Sophie_Neuenmuller | E | Sept. 4, 2022, 6:18 p.m. | OK | GNU C++17 (64) | TESTS | 23 | 1528 | 52838400 | ||
170878225 | altunyanv zidder _LeMur_ | E | Sept. 4, 2022, 5:29 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 499 | 74444800 | ||
170866418 | jiangly | E | Sept. 4, 2022, 3:42 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 514 | 47411200 | ||
170859390 | fastmath turmax LeoPro | E | Sept. 4, 2022, 2:49 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 654 | 126668800 | ||
170885139 | thisisisis | E | Sept. 4, 2022, 6:46 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 670 | 69529600 | ||
170869686 | IntoTheNight brunovsky | E | Sept. 4, 2022, 4:09 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 685 | 93184000 | ||
170876561 | Nebuchadnezzar | E | Sept. 4, 2022, 5:11 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 702 | 91033600 | ||
170899763 | HappyPacMan | E | Sept. 4, 2022, 11:51 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 748 | 134860800 | ||
170898788 | joelgun14 | E | Sept. 4, 2022, 11:15 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 748 | 147865600 | ||
170865773 | ksun48 | E | Sept. 4, 2022, 3:36 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 779 | 63283200 | ||
170867144 | Maksim1744 | E | Sept. 4, 2022, 3:47 p.m. | OK | GNU C++20 (64) | TESTS | 23 | 826 | 101683200 | ||
170898807 | Dukkha | E | Sept. 4, 2022, 11:16 p.m. | OK | Java 17 | TESTS | 23 | 2246 | 347136000 | ||
170897295 | Dukkha | E | Sept. 4, 2022, 10:29 p.m. | OK | Java 17 | TESTS | 23 | 2340 | 354201600 | ||
170897827 | Dukkha | E | Sept. 4, 2022, 10:46 p.m. | OK | Java 17 | TESTS | 23 | 2573 | 275558400 |
Back to search problems