Codeforces Round 680 (Div. 1, based on Moscow Team Olympiad)

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
1444 Codeforces Round 680 (Div. 1, based on Moscow Team Olympiad) FINISHED False 7200 132951263 Nov. 1, 2020, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1631 ) C Team-Building PROGRAMMING 2-sat dfs and similar ds graphs

B"The new academic year has started, and Berland's university has n first-year students. They are divided into k academic groups, however, some of the groups might be empty. Among the students, there are m pairs of acquaintances, and each acquaintance pair might be both in a common group or be in two different groups. Alice is the curator of the first years, she wants to host an entertaining game to make everyone know each other. To do that, she will select two different academic groups and then divide the students of those groups into two teams. The game requires that there are no acquaintance pairs inside each of the teams. Alice wonders how many pairs of groups she can select, such that it'll be possible to play a game after that. All students of the two selected groups must take part in the game. Please note, that the teams Alice will form for the game don't need to coincide with groups the students learn in. Moreover, teams may have different sizes (or even be empty). The first line contains three integers n , m and k ( 1 <= n <= 500 ,000 ; 0 <= m <= 500 ,000 ; 2 <= k <= 500 ,000 ) -- the number of students, the number of pairs of acquaintances and the number of groups respectively. The second line contains n integers c_1, c_2, ... , c_n ( 1 <= c_i <= k ), where c_i equals to the group number of the i -th student. Next m lines follow. The i -th of them contains two integers a_i and b_i ( 1 <= a_i, b_i <= n ), denoting that students a_i and b_i are acquaintances. It's guaranteed, that a_i neq b_i , and that no (unordered) pair is mentioned more than once. Print a single integer -- the number of ways to choose two different groups such that it's possible to select two teams to play the game. The acquaintances graph for the first example is shown in the picture below (next to each student there is their group number writte"...

Tutorials

Codeforces Round #680 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
97358553 Gassa C Nov. 1, 2020, 1:47 p.m. OK D TESTS 45 889 84172800
97323565 hos.lyric C Nov. 1, 2020, 11:40 a.m. OK D TESTS 44 1357 147046400
97362460 2018LZY C Nov. 1, 2020, 2:28 p.m. OK GNU C++11 TESTS 46 124 32972800
97344185 supy C Nov. 1, 2020, 12:34 p.m. OK GNU C++11 TESTS 44 171 82227200
97350196 Pengzhike C Nov. 1, 2020, 12:53 p.m. OK GNU C++11 TESTS 44 233 54067200
97358324 tianxiawoyou C Nov. 1, 2020, 1:45 p.m. OK GNU C++11 TESTS 45 249 240435200
97360115 hs-black C Nov. 1, 2020, 2:02 p.m. OK GNU C++11 TESTS 46 311 70144000
97361697 KagamineRin C Nov. 1, 2020, 2:19 p.m. OK GNU C++11 TESTS 46 312 96870400
97357429 Flying2018 C Nov. 1, 2020, 1:37 p.m. OK GNU C++11 TESTS 45 327 22835200
97359967 CYJian C Nov. 1, 2020, 2 p.m. OK GNU C++11 TESTS 46 327 38912000
97369314 I_LOVE_CWY C Nov. 1, 2020, 3:48 p.m. OK GNU C++11 TESTS 46 327 88883200
97368744 I_LOVE_CWY C Nov. 1, 2020, 3:41 p.m. OK GNU C++11 TESTS 46 327 104960000
97381571 skizajurrahaman C Nov. 1, 2020, 7:08 p.m. OK GNU C++14 TESTS 46 389 37068800
97320892 yhx-12243 C Nov. 1, 2020, 11:34 a.m. OK GNU C++14 TESTS 44 467 38604800
97389231 yaoR C Nov. 1, 2020, 11:38 p.m. OK GNU C++14 TESTS 46 499 25497600
97361495 lucaperju C Nov. 1, 2020, 2:17 p.m. OK GNU C++14 TESTS 46 529 33484800
97357295 MaGaroo C Nov. 1, 2020, 1:36 p.m. OK GNU C++14 TESTS 45 592 18841600
97389938 ezoilearner C Nov. 2, 2020, 12:19 a.m. OK GNU C++14 TESTS 46 623 76595200
97386762 MarcosK C Nov. 1, 2020, 9:35 p.m. OK GNU C++14 TESTS 46 638 52838400
97352581 stefanbalaz2 C Nov. 1, 2020, 1 p.m. OK GNU C++14 TESTS 44 655 49049600
97385749 _no0B C Nov. 1, 2020, 8:57 p.m. OK GNU C++14 TESTS 46 685 54476800
97358114 xacotasamata C Nov. 1, 2020, 1:43 p.m. OK GNU C++14 TESTS 45 763 105984000
97362077 Medeowex C Nov. 1, 2020, 2:23 p.m. OK GNU C++17 TESTS 46 374 21299200
97374034 negiizhao C Nov. 1, 2020, 4:57 p.m. OK GNU C++17 TESTS 46 405 40243200
97356015 ORZZZQTXDY C Nov. 1, 2020, 1:27 p.m. OK GNU C++17 TESTS 44 405 43315200
97328337 Bohun C Nov. 1, 2020, 11:50 a.m. OK GNU C++17 TESTS 44 421 49664000
97352182 Iscream2001 C Nov. 1, 2020, 12:59 p.m. OK GNU C++17 TESTS 44 483 14540800
97368456 peti1234 C Nov. 1, 2020, 3:37 p.m. OK GNU C++17 TESTS 46 499 27750400
97388695 An_Account C Nov. 1, 2020, 11:10 p.m. OK GNU C++17 TESTS 46 514 38707200
97365841 FallingStar C Nov. 1, 2020, 3:05 p.m. OK GNU C++17 TESTS 46 514 49459200
97359812 cactus_graph C Nov. 1, 2020, 1:58 p.m. OK GNU C++17 TESTS 46 514 60620800
97360093 Devil C Nov. 1, 2020, 2:01 p.m. OK GNU C++17 TESTS 46 530 26828800
97320701 Benq C Nov. 1, 2020, 11:34 a.m. OK GNU C++17 (64) TESTS 44 343 55705600
97383828 FlowerOfSorrow C Nov. 1, 2020, 8:01 p.m. OK GNU C++17 (64) TESTS 46 358 23961600
97382335 the_hyp0cr1t3 C Nov. 1, 2020, 7:23 p.m. OK GNU C++17 (64) TESTS 46 358 36044800
97337701 maroonrk C Nov. 1, 2020, 12:14 p.m. OK GNU C++17 (64) TESTS 44 358 85606400
97330742 KevinWan C Nov. 1, 2020, 11:56 a.m. OK GNU C++17 (64) TESTS 44 389 20172800
97356140 EmilConst C Nov. 1, 2020, 1:28 p.m. OK GNU C++17 (64) TESTS 44 389 64102400
97337028 black_horse2014 C Nov. 1, 2020, 12:13 p.m. OK GNU C++17 (64) TESTS 44 390 20480000
97331670 FlowerOfSorrow C Nov. 1, 2020, 11:59 a.m. OK GNU C++17 (64) TESTS 44 405 24166400
97395352 compute C Nov. 2, 2020, 3:39 a.m. OK GNU C++17 (64) TESTS 46 436 38912000
97383887 FlowerOfSorrow C Nov. 1, 2020, 8:03 p.m. OK GNU C++17 (64) TESTS 46 452 23961600
97347250 uwi C Nov. 1, 2020, 12:43 p.m. OK Java 11 TESTS 44 826 53043200
97391039 Ahmad C Nov. 2, 2020, 1:14 a.m. OK Java 11 TESTS 46 2059 296038400
97375084 YahiaSherif C Nov. 1, 2020, 5:14 p.m. OK Java 8 TESTS 46 1559 182681600
97330701 cwise C Nov. 1, 2020, 11:56 a.m. OK Java 8 TESTS 44 1746 156057600
97335012 Electromaster C Nov. 1, 2020, 12:07 p.m. OK Kotlin TESTS 44 2652 281702400
97349206 darnley C Nov. 1, 2020, 12:50 p.m. OK Kotlin TESTS 44 2730 248934400
97378470 Electromaster C Nov. 1, 2020, 6:09 p.m. OK Kotlin TESTS 46 2869 314675200
97382696 Electromaster C Nov. 1, 2020, 7:31 p.m. OK Kotlin TESTS 46 2948 387174400
97397551 P___ C Nov. 2, 2020, 4:43 a.m. OK MS C++ 2017 TESTS 46 982 84275200
97390728 sansen C Nov. 2, 2020, 12:59 a.m. OK Rust TESTS 46 436 57753600
97390555 sansen C Nov. 2, 2020, 12:50 a.m. OK Rust TESTS 46 452 63692800
97338173 sansen C Nov. 1, 2020, 12:16 p.m. OK Rust TESTS 44 607 66355200

remove filters

Back to search problems