Codeforces Round 697 (Div. 3)

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
1475 Codeforces Round 697 (Div. 3) FINISHED False 7200 120236399 Jan. 25, 2021, 3 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21426 ) C Ball in Berland PROGRAMMING combinatorics dfs and similar graphs hashing math

B"At the school where Vasya is studying, preparations are underway for the graduation ceremony. One of the planned performances is a ball, which will be attended by pairs of boys and girls. Each class must present two couples to the ball. In Vasya's class, a boys and b girls wish to participate. But not all boys and not all girls are ready to dance in pairs. Formally, you know k possible one-boy-one-girl pairs. You need to choose two of these pairs so that no person is in more than one pair. For example, if a=3 , b=4 , k=4 and the couples (1, 2) , (1, 3) , (2, 2) , (3, 4) are ready to dance together (in each pair, the boy's number comes first, then the girl's number), then the following combinations of two pairs are possible (not all possible options are listed below): But the following combinations are not possible: Find the number of ways to select two pairs that match the condition above. Two ways are considered different if they consist of different pairs. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains three integers a , b and k ( 1 <= a, b, k <= 2 cdot 10^5 ) -- the number of boys and girls in the class and the number of couples ready to dance together. The second line of each test case contains k integers a_1, a_2, ldots a_k . ( 1 <= a_i <= a ), where a_i is the number of the boy in the pair with the number i . The third line of each test case contains k integers b_1, b_2, ldots b_k . ( 1 <= b_i <= b ), where b_i is the number of the girl in the pair with the number i . It is guaranteed that the sums of a , b , and k over all test cases do not exceed 2 cdot 10^5 . It is guaranteed that each pair is specified at most once in one test case. For each test case, on a sepa"...

Tutorials

Codeforces Round #697 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
105431056 childofcuriosity C Jan. 26, 2021, 2:22 a.m. OK GNU C11 TESTS 7 77 3174400
105401895 polneni_prashanth C Jan. 25, 2021, 5:13 p.m. OK GNU C11 TESTS 7 77 4812800
105440168 zja601 C Jan. 26, 2021, 5:12 a.m. OK GNU C11 TESTS 7 936 6451200
105430773 qdnoip C Jan. 26, 2021, 2:16 a.m. OK GNU C++11 TESTS 7 31 3174400
105430599 s935704201 C Jan. 26, 2021, 2:12 a.m. OK GNU C++11 TESTS 7 46 1638400
105428495 CZ-7 C Jan. 26, 2021, 1:10 a.m. OK GNU C++11 TESTS 7 46 3174400
105428194 fishcathu. C Jan. 26, 2021, 1 a.m. OK GNU C++11 TESTS 7 46 3174400
105426053 luogu_bot1 C Jan. 25, 2021, 11:44 p.m. OK GNU C++11 TESTS 7 46 6451200
105424886 e_e_thinker C Jan. 25, 2021, 11:03 p.m. OK GNU C++11 TESTS 7 46 6451200
105426578 lanChe C Jan. 26, 2021, 12:04 a.m. OK GNU C++11 TESTS 7 46 19456000
105426221 ZSH_ZSH C Jan. 25, 2021, 11:50 p.m. OK GNU C++11 TESTS 7 61 12083200
105443488 pushpush111 C Jan. 26, 2021, 5:54 a.m. OK GNU C++11 TESTS 7 61 14540800
105436304 forlight C Jan. 26, 2021, 4:09 a.m. OK GNU C++11 TESTS 7 62 1638400
105432501 jingyaowang C Jan. 26, 2021, 2:54 a.m. OK GNU C++14 TESTS 7 62 3174400
105432431 jingyaowang C Jan. 26, 2021, 2:53 a.m. OK GNU C++14 TESTS 7 78 3174400
105422520 xpov1LL C Jan. 25, 2021, 9:52 p.m. OK GNU C++14 TESTS 7 93 1638400
105420079 tonystark31 C Jan. 25, 2021, 8:53 p.m. OK GNU C++14 TESTS 7 93 1638400
105426517 fuhefei_train C Jan. 26, 2021, 12:02 a.m. OK GNU C++14 TESTS 7 93 3174400
105420483 nohaxjustsoflo C Jan. 25, 2021, 9:02 p.m. OK GNU C++14 TESTS 7 93 3174400
105418803 namangpt2312 C Jan. 25, 2021, 8:26 p.m. OK GNU C++14 TESTS 7 93 3174400
105418066 ljupche98 C Jan. 25, 2021, 8:13 p.m. OK GNU C++14 TESTS 7 93 3174400
105432012 liuyang12399 C Jan. 26, 2021, 2:44 a.m. OK GNU C++14 TESTS 7 93 3174400
105428627 risa243 C Jan. 26, 2021, 1:13 a.m. OK GNU C++14 TESTS 7 93 3174400
105437807 LoL000 C Jan. 26, 2021, 4:37 a.m. OK GNU C++17 TESTS 7 92 3174400
105413208 bigfoot C Jan. 25, 2021, 6:55 p.m. OK GNU C++17 TESTS 7 93 1638400
105412965 bigfoot C Jan. 25, 2021, 6:52 p.m. OK GNU C++17 TESTS 7 93 1638400
105404108 Kaitd C Jan. 25, 2021, 5:26 p.m. OK GNU C++17 TESTS 7 93 1638400
105440145 willyWonka1 C Jan. 26, 2021, 5:12 a.m. OK GNU C++17 TESTS 7 93 1638400
105444333 17700732566 C Jan. 26, 2021, 6:05 a.m. OK GNU C++17 TESTS 7 93 3174400
105441853 jinhan814 C Jan. 26, 2021, 5:34 a.m. OK GNU C++17 TESTS 7 93 3174400
105439859 Nocole C Jan. 26, 2021, 5:08 a.m. OK GNU C++17 TESTS 7 93 3174400
105438791 talrejamohit03 C Jan. 26, 2021, 4:52 a.m. OK GNU C++17 TESTS 7 93 3174400
105432103 thomasyu C Jan. 26, 2021, 2:46 a.m. OK GNU C++17 TESTS 7 93 3174400
105434085 _Backl1ght C Jan. 26, 2021, 3:25 a.m. OK GNU C++17 (64) TESTS 7 31 9113600
105439317 yuanyuan2048 C Jan. 26, 2021, 5:01 a.m. OK GNU C++17 (64) TESTS 7 46 3174400
105433792 DanielMontes C Jan. 26, 2021, 3:19 a.m. OK GNU C++17 (64) TESTS 7 61 3174400
105430506 huangda C Jan. 26, 2021, 2:09 a.m. OK GNU C++17 (64) TESTS 7 61 3276800
105417795 clam C Jan. 25, 2021, 8:08 p.m. OK GNU C++17 (64) TESTS 7 61 6451200
105430404 CodingKnight C Jan. 26, 2021, 2:06 a.m. OK GNU C++17 (64) TESTS 7 62 1638400
105428270 Paniago C Jan. 26, 2021, 1:02 a.m. OK GNU C++17 (64) TESTS 7 62 3174400
105429451 Love_seventeen C Jan. 26, 2021, 1:38 a.m. OK GNU C++17 (64) TESTS 7 62 3174400
105442134 nomad_heart C Jan. 26, 2021, 5:38 a.m. OK GNU C++17 (64) TESTS 7 62 3174400
105437490 L1ngYu233 C Jan. 26, 2021, 4:31 a.m. OK GNU C++17 (64) TESTS 7 62 3174400
105408963 future_me C Jan. 25, 2021, 6:07 p.m. OK Java 11 TESTS 7 187 5222400
105442885 sf14t C Jan. 26, 2021, 5:47 a.m. OK Java 11 TESTS 7 202 0
105425488 Stitch C Jan. 25, 2021, 11:24 p.m. OK Java 11 TESTS 7 218 1228800
105411275 Pushkar-PM C Jan. 25, 2021, 6:33 p.m. OK Java 11 TESTS 7 233 4198400
105421522 mesc08 C Jan. 25, 2021, 9:27 p.m. OK Java 11 TESTS 7 233 5222400
105427904 rafee69029 C Jan. 26, 2021, 12:52 a.m. OK Java 11 TESTS 7 248 0
105430433 Restricted stelkasouridis C Jan. 26, 2021, 2:07 a.m. OK Java 11 TESTS 7 248 1228800
105407817 xoszm C Jan. 25, 2021, 5:57 p.m. OK Java 11 TESTS 7 249 1126400
105408720 gssakash C Jan. 25, 2021, 6:05 p.m. OK Java 11 TESTS 7 249 1228800
105420279 aayushbehl C Jan. 25, 2021, 8:57 p.m. OK Java 11 TESTS 7 249 4096000
105439045 Zahid_Hasan_Sahin C Jan. 26, 2021, 4:56 a.m. OK Java 8 TESTS 7 109 0
105412702 LionHeart20 C Jan. 25, 2021, 6:49 p.m. OK Java 8 TESTS 7 124 0
105405195 Abhik1998 C Jan. 25, 2021, 5:34 p.m. OK Java 8 TESTS 7 139 2662400
105410243 dante1 C Jan. 25, 2021, 6:21 p.m. OK Java 8 TESTS 7 155 9420800
105409368 flyman3046 C Jan. 25, 2021, 6:11 p.m. OK Java 8 TESTS 7 156 9011200
105404291 future_me C Jan. 25, 2021, 5:28 p.m. OK Java 8 TESTS 7 171 0
105404060 arunmsharma C Jan. 25, 2021, 5:26 p.m. OK Java 8 TESTS 7 171 5529600
105413889 coolManit C Jan. 25, 2021, 7:04 p.m. OK Java 8 TESTS 7 171 5529600
105407431 xoszm C Jan. 25, 2021, 5:53 p.m. OK Java 8 TESTS 7 171 5529600
105441224 Gupta-OP C Jan. 26, 2021, 5:27 a.m. OK Java 8 TESTS 7 171 6246400
105426282 Spheniscine C Jan. 25, 2021, 11:52 p.m. OK Kotlin TESTS 7 155 0
105426393 Spheniscine C Jan. 25, 2021, 11:56 p.m. OK Kotlin TESTS 7 155 0
105429092 CodingKnight C Jan. 26, 2021, 1:26 a.m. OK Kotlin TESTS 7 295 16691200
105430123 CodingKnight C Jan. 26, 2021, 1:57 a.m. OK Kotlin TESTS 7 296 15360000
105428343 CodingKnight C Jan. 26, 2021, 1:05 a.m. OK Kotlin TESTS 7 342 25088000
105427538 CodingKnight C Jan. 26, 2021, 12:39 a.m. OK Kotlin TESTS 7 343 22937600
105424833 IsTinG C Jan. 25, 2021, 11:01 p.m. OK Kotlin TESTS 7 373 17612800
105417842 koper C Jan. 25, 2021, 8:09 p.m. OK Kotlin TESTS 7 530 34201600
105434863 yyeshell C Jan. 26, 2021, 3:40 a.m. OK MS C++ TESTS 7 295 12902400
105430311 scka C Jan. 26, 2021, 2:03 a.m. OK MS C++ 2017 TESTS 7 109 3174400
105441221 ZinqinLi C Jan. 26, 2021, 5:27 a.m. OK MS C++ 2017 TESTS 7 109 3174400
105441507 ZinqinLi C Jan. 26, 2021, 5:30 a.m. OK MS C++ 2017 TESTS 7 124 3174400
105440726 liangdaye C Jan. 26, 2021, 5:20 a.m. OK MS C++ 2017 TESTS 7 124 6451200
105443996 liangdaye C Jan. 26, 2021, 6 a.m. OK MS C++ 2017 TESTS 7 124 6451200
105440613 the-fly0618 C Jan. 26, 2021, 5:18 a.m. OK MS C++ 2017 TESTS 7 124 9625600
105441828 say_hi C Jan. 26, 2021, 5:34 a.m. OK MS C++ 2017 TESTS 7 280 3174400
105438479 jongwook123 C Jan. 26, 2021, 4:48 a.m. OK MS C++ 2017 TESTS 7 296 8806400
105405123 IronArt C Jan. 25, 2021, 5:33 p.m. OK MS C++ 2017 TESTS 7 296 24166400
105444022 gao_wu_di C Jan. 26, 2021, 6:01 a.m. OK MS C++ 2017 TESTS 7 390 16896000
105416242 NAbdulla C Jan. 25, 2021, 7:41 p.m. OK .NET Core C# TESTS 7 124 33792000
105417277 rsFalse C Jan. 25, 2021, 7:58 p.m. OK Perl TESTS 7 982 110694400
105413644 maciaas C Jan. 25, 2021, 7:01 p.m. OK PyPy 2 TESTS 7 326 26112000
105416712 abhisheka950 C Jan. 25, 2021, 7:49 p.m. OK PyPy 3 TESTS 7 280 31539200
105409007 someone__ C Jan. 25, 2021, 6:08 p.m. OK PyPy 3 TESTS 7 312 20992000
105429001 behindyou C Jan. 26, 2021, 1:24 a.m. OK PyPy 3 TESTS 7 326 20889600
105404657 AD18 C Jan. 25, 2021, 5:30 p.m. OK PyPy 3 TESTS 7 326 25907200
105417667 Scopula C Jan. 25, 2021, 8:06 p.m. OK PyPy 3 TESTS 7 327 20787200
105415719 KevinyWu C Jan. 25, 2021, 7:31 p.m. OK PyPy 3 TESTS 7 342 19763200
105408124 batman_memory C Jan. 25, 2021, 5:59 p.m. OK PyPy 3 TESTS 7 342 20172800
105428601 whddnr0218 C Jan. 26, 2021, 1:12 a.m. OK PyPy 3 TESTS 7 342 21401600
105407719 uttharapally.chandra C Jan. 25, 2021, 5:56 p.m. OK PyPy 3 TESTS 7 343 17817600
105425117 Leggasick C Jan. 25, 2021, 11:11 p.m. OK PyPy 3 TESTS 7 343 18432000
105424985 eugalt C Jan. 25, 2021, 11:06 p.m. OK Python 3 TESTS 7 264 21811200
105424419 eugalt C Jan. 25, 2021, 10:47 p.m. OK Python 3 TESTS 7 264 29286400
105424791 eugalt C Jan. 25, 2021, 11 p.m. OK Python 3 TESTS 7 280 21811200
105420746 deepansh09 C Jan. 25, 2021, 9:07 p.m. OK Python 3 TESTS 7 280 26521600
105420263 deepansh09 C Jan. 25, 2021, 8:57 p.m. OK Python 3 TESTS 7 296 26521600
105416962 bjy C Jan. 25, 2021, 7:53 p.m. OK Python 3 TESTS 7 296 26726400
105423676 jramaswami C Jan. 25, 2021, 10:26 p.m. OK Python 3 TESTS 7 311 18534400
105418819 eugalt C Jan. 25, 2021, 8:26 p.m. OK Python 3 TESTS 7 311 25395200
105413653 quantumfan C Jan. 25, 2021, 7:01 p.m. OK Python 3 TESTS 7 327 19763200
105419832 eugalt C Jan. 25, 2021, 8:47 p.m. OK Python 3 TESTS 7 327 25395200
105430684 satylogin C Jan. 26, 2021, 2:14 a.m. OK Rust TESTS 7 31 7987200

remove filters

Back to search problems