Codeforces Round 658 (Div. 1)

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
1381 Codeforces Round 658 (Div. 1) FINISHED False 7200 142010711 July 21, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1646 ) C Mastermind PROGRAMMING constructive algorithms greedy implementation sortings 2500

B'In the game of Mastermind, there are two players -- Alice and Bob. Alice has a secret code, which Bob tries to guess. Here, a code is defined as a sequence of n colors. There are exactly n+1 colors in the entire universe, numbered from 1 to n+1 inclusive. When Bob guesses a code, Alice tells him some information about how good of a guess it is, in the form of two integers x and y . The first integer x is the number of indices where Bob 's guess correctly matches Alice 's code. The second integer y is the size of the intersection of the two codes as multisets. That is, if Bob were to change the order of the colors in his guess, y is the maximum number of indices he could get correct. For example, suppose n=5 , Alice 's code is [3,1,6,1,2] , and Bob 's guess is [3,1,1,2,5] . At indices 1 and 2 colors are equal, while in the other indices they are not equal. So x=2 . And the two codes have the four colors 1,1,2,3 in common, so y=4 . You are given Bob 's guess and two values x and y . Can you find one possibility of Alice 's code so that the values of x and y are correct? The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Next 2t lines contain descriptions of test cases. The first line of each test case contains three integers n,x,y ( 1 <= n <= 10^5, 0 <= x <= y <= n ) -- the length of the codes, and two values Alice responds with. The second line of each test case contains n integers b_1, ldots,b_n ( 1 <= b_i <= n+1 ) -- Bob 's guess, where b_i is the i -th color of the guess. It is guaranteed that the sum of n across all test cases does not exceed 10^5 . For each test case, on the first line, output "YES" if there is a solution, or "NO" if there is no possible secret code consistent with the described situation. You can print each cha'...

Tutorials

Codeforces Round #658 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
87555324 hos.lyric C July 21, 2020, 3:17 p.m. OK D TESTS 23 108 29184000 2500
87616868 Gassa C July 21, 2020, 9:54 p.m. OK D TESTS 23 140 29184000 2500
87618739 RNS_KSB C July 21, 2020, 10:49 p.m. OK GNU C++11 TESTS 23 46 9113600 2500
87621071 Qingyu C July 22, 2020, 12:14 a.m. OK GNU C++11 TESTS 23 46 10649600 2500
87621864 OMG_link C July 22, 2020, 12:45 a.m. OK GNU C++11 TESTS 23 61 6860800 2500
87580688 hehezhou C July 21, 2020, 4:06 p.m. OK GNU C++11 TESTS 23 61 8089600 2500
87591971 CrescentRose C July 21, 2020, 4:31 p.m. OK GNU C++11 TESTS 23 61 8294400 2500
87612293 srijon51 C July 21, 2020, 8:15 p.m. OK GNU C++11 TESTS 23 61 8396800 2500
87579877 18380120126 C July 21, 2020, 4:04 p.m. OK GNU C++11 TESTS 23 61 8704000 2500
87626406 PCmeiwokuai C July 22, 2020, 2:41 a.m. OK GNU C++11 TESTS 23 61 8806400 2500
87577042 xyz32768 C July 21, 2020, 3:58 p.m. OK GNU C++11 TESTS 23 61 9216000 2500
87635801 yang12138 C July 22, 2020, 5:31 a.m. OK GNU C++11 TESTS 23 61 9523200 2500
87584377 Xtale_cross C July 21, 2020, 4:15 p.m. OK GNU C++14 TESTS 23 62 5734400 2500
87616050 exploooosion C July 21, 2020, 9:33 p.m. OK GNU C++14 TESTS 23 62 8192000 2500
87583947 DatVu C July 21, 2020, 4:14 p.m. OK GNU C++14 TESTS 23 62 8499200 2500
87552429 yashChandnani C July 21, 2020, 3:12 p.m. OK GNU C++14 TESTS 23 62 8601600 2500
87585191 AcidWrongGod C July 21, 2020, 4:17 p.m. OK GNU C++14 TESTS 23 62 9420800 2500
87572472 keko37 C July 21, 2020, 3:48 p.m. OK GNU C++14 TESTS 23 62 9420800 2500
87562236 sava-cska C July 21, 2020, 3:28 p.m. OK GNU C++14 TESTS 23 62 9420800 2500
87589515 zzynb C July 21, 2020, 4:26 p.m. OK GNU C++14 TESTS 23 62 12492800 2500
87590796 orbitingflea C July 21, 2020, 4:29 p.m. OK GNU C++14 TESTS 23 62 12697600 2500
87637830 danya090699 C July 22, 2020, 5:59 a.m. OK GNU C++14 TESTS 23 77 7680000 2500
87577642 LayCurse C July 21, 2020, 3:59 p.m. OK GNU C++17 TESTS 23 46 106803200 2500
87583570 qhqh C July 21, 2020, 4:13 p.m. OK GNU C++17 TESTS 23 61 7782400 2500
87612625 _overrated_ C July 21, 2020, 8:21 p.m. OK GNU C++17 TESTS 23 61 7884800 2500
87636658 vioalbert C July 22, 2020, 5:43 a.m. OK GNU C++17 TESTS 23 61 9932800 2500
87628608 SheepRanger C July 22, 2020, 3:29 a.m. OK GNU C++17 TESTS 23 61 11980800 2500
87552590 300iq C July 21, 2020, 3:12 p.m. OK GNU C++17 TESTS 23 62 7475200 2500
87615567 alykov C July 21, 2020, 9:22 p.m. OK GNU C++17 TESTS 23 62 7680000 2500
87611409 _overrated_ C July 21, 2020, 8 p.m. OK GNU C++17 TESTS 23 62 7884800 2500
87571755 tabr C July 21, 2020, 3:47 p.m. OK GNU C++17 TESTS 23 62 7884800 2500
87633409 Dhivagar C July 22, 2020, 4:56 a.m. OK GNU C++17 TESTS 23 62 8089600 2500
87559281 jiangly C July 21, 2020, 3:23 p.m. OK GNU C++17 (64) TESTS 23 46 6553600 2500
87572906 emthrm C July 21, 2020, 3:49 p.m. OK GNU C++17 (64) TESTS 23 46 9523200 2500
87599469 emorgan5289 C July 21, 2020, 5:42 p.m. OK GNU C++17 (64) TESTS 23 46 9932800 2500
87623791 generic_placeholder_name C July 22, 2020, 1:41 a.m. OK GNU C++17 (64) TESTS 23 46 10035200 2500
87635715 nishank.suresh C July 22, 2020, 5:30 a.m. OK GNU C++17 (64) TESTS 23 46 10956800 2500
87580571 Tiramister C July 21, 2020, 4:06 p.m. OK GNU C++17 (64) TESTS 23 46 11468800 2500
87604071 Leafy_ C July 21, 2020, 6:24 p.m. OK GNU C++17 (64) TESTS 23 46 11980800 2500
87611187 Monogon C July 21, 2020, 7:57 p.m. OK GNU C++17 (64) TESTS 23 46 12697600 2500
87551639 neal C July 21, 2020, 3:10 p.m. OK GNU C++17 (64) TESTS 23 46 13926400 2500
87568752 NotaMotuaQAQ C July 21, 2020, 3:41 p.m. OK GNU C++17 (64) TESTS 23 46 15974400 2500
87579970 uwi C July 21, 2020, 4:05 p.m. OK Java 11 TESTS 23 249 24166400 2500
87635414 PizzaLovers007 C July 22, 2020, 5:26 a.m. OK Java 11 TESTS 23 326 43520000 2500
87582482 holeguma C July 21, 2020, 4:10 p.m. OK Java 8 TESTS 23 171 20787200 2500
87611814 Charlesna C July 21, 2020, 8:07 p.m. OK Java 8 TESTS 23 171 21913600 2500
87606998 Charlesna C July 21, 2020, 6:58 p.m. OK Java 8 TESTS 23 186 26521600 2500
87577001 cwise C July 21, 2020, 3:58 p.m. OK Java 8 TESTS 23 233 72089600 2500
87579775 AnandOza C July 21, 2020, 4:04 p.m. OK Java 8 TESTS 23 264 32972800 2500
87570313 about C July 21, 2020, 3:44 p.m. OK Java 8 TESTS 23 280 35020800 2500
87617299 Hakiobo C July 21, 2020, 10:06 p.m. OK Kotlin TESTS 23 156 23552000 2500
87589737 ekaerovets C July 21, 2020, 4:27 p.m. OK Kotlin TESTS 23 186 21708800 2500
87566261 Tlatoani C July 21, 2020, 3:36 p.m. OK Kotlin TESTS 23 280 30003200 2500
87596721 EmK C July 21, 2020, 5:26 p.m. OK Mono C# TESTS 23 139 21811200 2500
87597608 EmK C July 21, 2020, 5:31 p.m. OK Mono C# TESTS 23 233 33689600 2500
87596259 Yupiteru C July 21, 2020, 5:25 p.m. OK Mono C# TESTS 23 280 48947200 2500
87589740 keymoon C July 21, 2020, 4:27 p.m. OK Mono C# TESTS 23 483 34201600 2500
87609799 kupriyanov C July 21, 2020, 7:35 p.m. OK MS C++ 2017 TESTS 23 187 13721600 2500
87573750 pajenegod C July 21, 2020, 3:51 p.m. OK PyPy 2 TESTS 23 452 46284800 2500
87628901 chinerist C July 22, 2020, 3:35 a.m. OK PyPy 3 TESTS 23 592 40755200 2500
87617880 throwawayatcoder C July 21, 2020, 10:26 p.m. OK PyPy 3 TESTS 23 592 44032000 2500
87631417 __eRRor__ C July 22, 2020, 4:21 a.m. OK PyPy 3 TESTS 23 920 49459200 2500
87599927 nwi C July 21, 2020, 5:46 p.m. OK Python 2 TESTS 23 530 22528000 2500
87601187 sh1194 C July 21, 2020, 5:57 p.m. OK Python 3 TESTS 23 436 22732800 2500
87605042 robostac C July 21, 2020, 6:35 p.m. OK Rust TESTS 23 62 10854400 2500

remove filters

Back to search problems