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 |
---|---|---|---|---|---|---|
1711 | Codeforces Round 810 (Div. 2) | FINISHED | False | 7200 | 78593063 | July 24, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 13569 ) | B | Party | PROGRAMMING | brute force graphs |
B"A club plans to hold a party and will invite some of its n members. The n members are identified by the numbers 1, 2, ... , n . If member i is not invited, the party will gain an unhappiness value of a_i . There are m pairs of friends among the n members. As per tradition, if both people from a friend pair are invited, they will share a cake at the party. The total number of cakes eaten will be equal to the number of pairs of friends such that both members have been invited. However, the club's oven can only cook two cakes at a time. So, the club demands that the total number of cakes eaten is an even number. What is the minimum possible total unhappiness value of the party, respecting the constraint that the total number of cakes eaten is even? Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 10^4 ). The description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n <= q 10^5 , 0 <= q m <= q min(10^5, frac{n(n-1)}{2}) ) -- the number of club members and pairs of friends. The second line of each test case contains n integers a_1,a_2, ... ,a_n ( 0 <= q a_i <= q 10^4 ) -- the unhappiness value array. Each of the next m lines contains two integers x and y ( 1 <= q x,y <= q n , x neq y ) indicating that x and y are friends. Each unordered pair (x,y) appears at most once in each test case. It is guaranteed that both the sum of n and the sum of m over all test cases do not exceed 10^5 . For each test case, print a line containing a single integer xe2 x80 x93 the minimum possible unhappiness value of a valid party. In the first test case, all members can be invited. So the unhappiness value is 0 . In the second test case, the following options are possible: In the third test case, inviting members 3,4,5$"... |
Codeforces Round #810 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
165572848 | LostTemple | B | July 24, 2022, 3:51 p.m. | OK | C# 8 | TESTS | 11 | 140 | 14540800 | ||
165597979 | TheILICH | B | July 24, 2022, 6:48 p.m. | OK | C# 8 | TESTS | 11 | 155 | 15974400 | ||
165576962 | reosfire | B | July 24, 2022, 4:04 p.m. | OK | C# 8 | TESTS | 11 | 436 | 25395200 | ||
165591844 | LeonGymretzka | B | July 24, 2022, 5:47 p.m. | OK | GNU C11 | TESTS | 11 | 78 | 2252800 | ||
165621678 | tokitsukaze | B | July 25, 2022, 2:44 a.m. | OK | GNU C++14 | TESTS | 11 | 31 | 3686400 | ||
165579455 | xiaxiakeji | B | July 24, 2022, 4:11 p.m. | OK | GNU C++14 | TESTS | 11 | 31 | 5529600 | ||
165616717 | xiaomeiman | B | July 25, 2022, 1:20 a.m. | OK | GNU C++14 | TESTS | 11 | 62 | 819200 | ||
165602316 | Triose_Cyl | B | July 24, 2022, 7:48 p.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1536000 | ||
165572749 | HakuroKawashiro | B | July 24, 2022, 3:50 p.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1536000 | ||
165630751 | krish_iiitp | B | July 25, 2022, 5:22 a.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1536000 | ||
165613252 | strange757 | B | July 24, 2022, 11:55 p.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1638400 | ||
165597834 | ogix2 | B | July 24, 2022, 6:46 p.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1638400 | ||
165577339 | Mindeveloped | B | July 24, 2022, 4:05 p.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1638400 | ||
165613742 | rechinist | B | July 25, 2022, 12:08 a.m. | OK | GNU C++14 | TESTS | 11 | 62 | 1638400 | ||
165595595 | SajibKC_19 | B | July 24, 2022, 6:19 p.m. | OK | GNU C++17 | TESTS | 11 | 61 | 6348800 | ||
165615613 | Gakki_Luke | B | July 25, 2022, 12:56 a.m. | OK | GNU C++17 | TESTS | 11 | 62 | 1536000 | ||
165615663 | Gakki_Luke | B | July 25, 2022, 12:58 a.m. | OK | GNU C++17 | TESTS | 11 | 62 | 1536000 | ||
165606715 | hututu-7 | B | July 24, 2022, 9:02 p.m. | OK | GNU C++17 | TESTS | 11 | 62 | 1638400 | ||
165626251 | Pikku | B | July 25, 2022, 3:58 a.m. | OK | GNU C++17 | TESTS | 11 | 62 | 1638400 | ||
165573408 | AbeerB | B | July 24, 2022, 3:53 p.m. | OK | GNU C++17 | TESTS | 11 | 62 | 2457600 | ||
165610424 | AlexanderL | B | July 24, 2022, 10:28 p.m. | OK | GNU C++17 | TESTS | 11 | 62 | 2969600 | ||
165594954 | zahidhasanmozumder | B | July 24, 2022, 6:13 p.m. | OK | GNU C++17 | TESTS | 11 | 62 | 2969600 | ||
165627231 | ayushraghuwanshi22 | B | July 25, 2022, 4:16 a.m. | OK | GNU C++17 | TESTS | 11 | 62 | 2969600 | ||
165620158 | ZWF_102103135 | B | July 25, 2022, 2:20 a.m. | OK | GNU C++17 | TESTS | 11 | 62 | 3276800 | ||
165623378 | YangHan | B | July 25, 2022, 3:10 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1228800 | ||
165624484 | Muly | B | July 25, 2022, 3:29 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1228800 | ||
165581841 | s7win99 | B | July 24, 2022, 4:20 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1638400 | ||
165620321 | EE97 | B | July 25, 2022, 2:23 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1638400 | ||
165616850 | jk1024 | B | July 25, 2022, 1:22 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1638400 | ||
165616180 | RetsaZC19 | B | July 25, 2022, 1:08 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1638400 | ||
165613199 | enslaved | B | July 24, 2022, 11:53 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1638400 | ||
165598678 | ggghg | B | July 24, 2022, 6:57 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 1843200 | ||
165592284 | RF_Faisal | B | July 24, 2022, 5:50 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 2355200 | ||
165571227 | van_hoang | B | July 24, 2022, 3:46 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 46 | 2457600 | ||
165617651 | Sorry_Hanasaki | B | July 25, 2022, 1:36 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165601892 | VIP_IITBHU | B | July 24, 2022, 7:41 p.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165600576 | pseong | B | July 24, 2022, 7:23 p.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165578143 | gkpsahil032 | B | July 24, 2022, 4:07 p.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165597957 | jiangly | B | July 24, 2022, 6:48 p.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165631231 | ddlGod | B | July 25, 2022, 5:30 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165620521 | ducanhphan07062006 | B | July 25, 2022, 2:26 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 819200 | ||
165631624 | LuluOwO | B | July 25, 2022, 5:36 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 1638400 | ||
165631583 | LuluOwO | B | July 25, 2022, 5:35 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 1638400 | ||
165631851 | vqtien | B | July 25, 2022, 5:40 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 46 | 1638400 | ||
165591635 | koqo | B | July 24, 2022, 5:46 p.m. | OK | Go | TESTS | 11 | 171 | 5427200 | ||
165597007 | NoInternetName | B | July 24, 2022, 6:35 p.m. | OK | Go | TESTS | 11 | 171 | 5939200 | ||
165577551 | 018429 | B | July 24, 2022, 4:06 p.m. | OK | Go | TESTS | 11 | 218 | 7065600 | ||
165614462 | segubeam | B | July 25, 2022, 12:27 a.m. | OK | Java 11 | TESTS | 11 | 233 | 0 | ||
165604586 | tushar19280 | B | July 24, 2022, 8:25 p.m. | OK | Java 11 | TESTS | 11 | 233 | 0 | ||
165605214 | satyaa_78 | B | July 24, 2022, 8:36 p.m. | OK | Java 11 | TESTS | 11 | 233 | 5324800 | ||
165633120 | __Serendipity | B | July 25, 2022, 5:59 a.m. | OK | Java 11 | TESTS | 11 | 234 | 0 | ||
165631167 | swift51385 | B | July 25, 2022, 5:29 a.m. | OK | Java 11 | TESTS | 11 | 234 | 0 | ||
165595845 | singhshivsm20001 | B | July 24, 2022, 6:22 p.m. | OK | Java 11 | TESTS | 11 | 264 | 0 | ||
165601008 | pras7946 | B | July 24, 2022, 7:29 p.m. | OK | Java 11 | TESTS | 11 | 265 | 0 | ||
165580251 | Hreshi | B | July 24, 2022, 4:14 p.m. | OK | Java 11 | TESTS | 11 | 265 | 0 | ||
165577120 | vermadv2000 | B | July 24, 2022, 4:04 p.m. | OK | Java 11 | TESTS | 11 | 265 | 0 | ||
165621755 | Wuya | B | July 25, 2022, 2:45 a.m. | OK | Java 11 | TESTS | 11 | 265 | 1536000 | ||
165574701 | Eslam_Ahmed | B | July 24, 2022, 3:57 p.m. | OK | Java 17 | TESTS | 11 | 405 | 17305600 | ||
165611655 | kkz666 | B | July 24, 2022, 11:04 p.m. | OK | Java 17 | TESTS | 11 | 468 | 17510400 | ||
165631950 | Etheric_Wanderer | B | July 25, 2022, 5:41 a.m. | OK | Java 17 | TESTS | 11 | 716 | 63692800 | ||
165600420 | prituladima | B | July 24, 2022, 7:21 p.m. | OK | Java 17 | TESTS | 11 | 966 | 45875200 | ||
165605361 | peiyeliu | B | July 24, 2022, 8:38 p.m. | OK | Java 8 | TESTS | 11 | 155 | 0 | ||
165576932 | ashutosh_patel | B | July 24, 2022, 4:04 p.m. | OK | Java 8 | TESTS | 11 | 155 | 0 | ||
165575007 | arutsudar | B | July 24, 2022, 3:58 p.m. | OK | Java 8 | TESTS | 11 | 171 | 0 | ||
165573720 | underRate | B | July 24, 2022, 3:54 p.m. | OK | Java 8 | TESTS | 11 | 171 | 0 | ||
165586085 | Sussykin | B | July 24, 2022, 4:32 p.m. | OK | Java 8 | TESTS | 11 | 202 | 0 | ||
165591890 | gssakash | B | July 24, 2022, 5:47 p.m. | OK | Java 8 | TESTS | 11 | 265 | 11264000 | ||
165577224 | Mohamed308 | B | July 24, 2022, 4:05 p.m. | OK | Java 8 | TESTS | 11 | 295 | 15872000 | ||
165581507 | naveenkant227 | B | July 24, 2022, 4:18 p.m. | OK | Java 8 | TESTS | 11 | 295 | 20480000 | ||
165623505 | TopSafder | B | July 25, 2022, 3:12 a.m. | OK | Java 8 | TESTS | 11 | 311 | 16384000 | ||
165575077 | daredsakura | B | July 24, 2022, 3:58 p.m. | OK | Java 8 | TESTS | 11 | 327 | 33792000 | ||
165595080 | rkmelody | B | July 24, 2022, 6:14 p.m. | OK | Kotlin 1.5 | TESTS | 11 | 421 | 11366400 | ||
165577136 | Hideyoshi1100100001 | B | July 24, 2022, 4:04 p.m. | OK | MS C++ 2017 | TESTS | 11 | 93 | 819200 | ||
165586024 | AntiEntropy | B | July 24, 2022, 4:32 p.m. | OK | MS C++ 2017 | TESTS | 11 | 234 | 819200 | ||
165578865 | beckusator | B | July 24, 2022, 4:10 p.m. | OK | MS C++ 2017 | TESTS | 11 | 234 | 819200 | ||
165572328 | cptahahab | B | July 24, 2022, 3:49 p.m. | OK | MS C++ 2017 | TESTS | 11 | 234 | 1638400 | ||
165575279 | Scarecrow41 | B | July 24, 2022, 3:58 p.m. | OK | MS C++ 2017 | TESTS | 11 | 234 | 4812800 | ||
165597038 | coding_boi_ayush | B | July 24, 2022, 6:35 p.m. | OK | MS C++ 2017 | TESTS | 11 | 234 | 6758400 | ||
165621589 | lyqhh88 | B | July 25, 2022, 2:42 a.m. | OK | MS C++ 2017 | TESTS | 11 | 249 | 1638400 | ||
165578506 | SuslovMax | B | July 24, 2022, 4:09 p.m. | OK | MS C++ 2017 | TESTS | 11 | 264 | 3174400 | ||
165572747 | MagicD | B | July 24, 2022, 3:50 p.m. | OK | MS C++ 2017 | TESTS | 11 | 265 | 3788800 | ||
165584732 | onipp | B | July 24, 2022, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 11 | 265 | 4096000 | ||
165605266 | Darooha | B | July 24, 2022, 8:37 p.m. | OK | Ocaml | TESTS | 11 | 62 | 2150400 | ||
165628542 | misorin | B | July 25, 2022, 4:43 a.m. | OK | PyPy 3 | TESTS | 11 | 218 | 13107200 | ||
165597488 | hxu10 | B | July 24, 2022, 6:42 p.m. | OK | PyPy 3 | TESTS | 11 | 218 | 15462400 | ||
165598059 | YashNandwana | B | July 24, 2022, 6:49 p.m. | OK | PyPy 3 | TESTS | 11 | 234 | 11161600 | ||
165605025 | LarryNY | B | July 24, 2022, 8:32 p.m. | OK | PyPy 3 | TESTS | 11 | 249 | 10854400 | ||
165619051 | rajeshpenugonda6 | B | July 25, 2022, 2 a.m. | OK | PyPy 3 | TESTS | 11 | 327 | 24473600 | ||
165575646 | hash1023 | B | July 24, 2022, 4 p.m. | OK | PyPy 3 | TESTS | 11 | 701 | 27852800 | ||
165599786 | Noureldin | B | July 24, 2022, 7:12 p.m. | OK | PyPy 3 | TESTS | 11 | 764 | 17305600 | ||
165631083 | mj_oppo | B | July 25, 2022, 5:27 a.m. | OK | PyPy 3 | TESTS | 11 | 1029 | 17510400 | ||
165592352 | Sushobhan_4 | B | July 24, 2022, 5:50 p.m. | OK | PyPy 3 | TESTS | 11 | 1060 | 18432000 | ||
165575876 | Hamid1385 | B | July 24, 2022, 4 p.m. | OK | PyPy 3 | TESTS | 11 | 1122 | 10240000 | ||
165594961 | samchen123 | B | July 24, 2022, 6:13 p.m. | OK | PyPy 3-64 | TESTS | 11 | 124 | 13926400 | ||
165591590 | Skillful_Wanderer | B | July 24, 2022, 5:45 p.m. | OK | PyPy 3-64 | TESTS | 11 | 155 | 14028800 | ||
165627861 | iska_terminator | B | July 25, 2022, 4:29 a.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 17920000 | ||
165574432 | petamingks | B | July 24, 2022, 3:56 p.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 19251200 | ||
165607281 | oadey89 | B | July 24, 2022, 9:14 p.m. | OK | PyPy 3-64 | TESTS | 11 | 187 | 15462400 | ||
165587158 | a_vantik_a | B | July 24, 2022, 4:34 p.m. | OK | PyPy 3-64 | TESTS | 11 | 187 | 17612800 | ||
165623951 | sepa38 | B | July 25, 2022, 3:20 a.m. | OK | PyPy 3-64 | TESTS | 11 | 202 | 18329600 | ||
165621935 | mohanned_war | B | July 25, 2022, 2:47 a.m. | OK | PyPy 3-64 | TESTS | 11 | 217 | 19456000 | ||
165605129 | abhaumik24 | B | July 24, 2022, 8:34 p.m. | OK | PyPy 3-64 | TESTS | 11 | 218 | 15667200 | ||
165605695 | sangram03 | B | July 24, 2022, 8:44 p.m. | OK | PyPy 3-64 | TESTS | 11 | 233 | 18636800 | ||
165592129 | eugalt | B | July 24, 2022, 5:49 p.m. | OK | Python 3 | TESTS | 11 | 373 | 15872000 | ||
165615024 | eugalt | B | July 25, 2022, 12:43 a.m. | OK | Python 3 | TESTS | 11 | 389 | 14643200 | ||
165575436 | SJOKER | B | July 24, 2022, 3:59 p.m. | OK | Python 3 | TESTS | 11 | 404 | 6348800 | ||
165575439 | kotprogrammist | B | July 24, 2022, 3:59 p.m. | OK | Python 3 | TESTS | 11 | 420 | 6348800 | ||
165596318 | gotcoding124 | B | July 24, 2022, 6:27 p.m. | OK | Python 3 | TESTS | 11 | 436 | 6348800 | ||
165575011 | fighting_wang | B | July 24, 2022, 3:58 p.m. | OK | Python 3 | TESTS | 11 | 436 | 15769600 | ||
165586035 | eugalt | B | July 24, 2022, 4:32 p.m. | OK | Python 3 | TESTS | 11 | 436 | 16179200 | ||
165580671 | prathamnagaria | B | July 24, 2022, 4:16 p.m. | OK | Python 3 | TESTS | 11 | 451 | 7168000 | ||
165581594 | sandesh32 | B | July 24, 2022, 4:19 p.m. | OK | Python 3 | TESTS | 11 | 452 | 13312000 | ||
165600333 | codeshav | B | July 24, 2022, 7:20 p.m. | OK | Python 3 | TESTS | 11 | 467 | 8704000 | ||
165592258 | xttt | B | July 24, 2022, 5:50 p.m. | OK | Rust 2021 | TESTS | 11 | 31 | 4812800 | ||
165605765 | apilat | B | July 24, 2022, 8:45 p.m. | OK | Rust 2021 | TESTS | 11 | 31 | 5427200 | ||
165578524 | riverbl | B | July 24, 2022, 4:09 p.m. | OK | Rust 2021 | TESTS | 11 | 93 | 14745600 | ||
165596669 | luukaos | B | July 24, 2022, 6:31 p.m. | OK | Rust 2021 | TESTS | 11 | 109 | 4710400 | ||
165580150 | kena0ki | B | July 24, 2022, 4:14 p.m. | OK | Rust 2021 | TESTS | 11 | 124 | 10854400 |
Back to search problems