Codeforces Round 638 (Div. 2)

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
1348 Codeforces Round 638 (Div. 2) FINISHED False 9000 149009111 May 1, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 25760 ) B Phoenix and Beauty PROGRAMMING constructive algorithms data structures greedy 1400

B"Phoenix loves beautiful arrays. An array is beautiful if all its subarrays of length k have the same sum. A subarray of an array is any sequence of consecutive elements. Phoenix currently has an array a of length n . He wants to insert some number of integers, possibly zero, into his array such that it becomes beautiful. The inserted integers must be between 1 and n inclusive. Integers may be inserted anywhere (even before the first or after the last element), and he is not trying to minimize the number of inserted integers. The input consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 50 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 1 <= k <= n <= 100 ). The second line of each test case contains n space-separated integers ( 1 <= a_i <= n ) -- the array that Phoenix currently has. This array may or may not be already beautiful. For each test case, if it is impossible to create a beautiful array, print -1. Otherwise, print two lines. The first line should contain the length of the beautiful array m ( n <= m <= 10^4 ). You don't need to minimize m . The second line should contain m space-separated integers ( 1 <= b_i <= n ) -- a beautiful array that Phoenix can obtain after inserting some, possibly zero, integers into his array a . You may print integers that weren't originally in array a . If there are multiple solutions, print any. It's guaranteed that if we can make array a beautiful, we can always make it with resulting length no more than 10^4 . In the first test case, we can make array a beautiful by inserting the integer 1 at index 3 (in between the two existing 2 s). Now, all subarrays of length k=2 have the same sum 3 . There exists many other possible solutions, for example: In the second test case, the arra"...

Tutorials

Codeforces Round #638 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
78760551 Arteni_Cristi B May 1, 2020, 8:20 p.m. OK FPC TESTS 25 1434 0 1400
78703927 PAG B May 1, 2020, 3:34 p.m. OK FPC TESTS 24 1450 1638400 1400
78728207 thewolf B May 1, 2020, 4:23 p.m. OK GNU C11 TESTS 24 826 0 1400
78747992 Beku.sh B May 1, 2020, 6:01 p.m. OK GNU C11 TESTS 25 1528 102400 1400
78753482 Nayon110 B May 1, 2020, 6:48 p.m. OK GNU C11 TESTS 25 1544 102400 1400
78757900 Arnab_Bhattacharjee B May 1, 2020, 7:42 p.m. OK GNU C11 TESTS 25 1559 0 1400
78708677 Alsace08 B May 1, 2020, 3:42 p.m. OK GNU C11 TESTS 24 1559 102400 1400
78752893 ShofiqurRahman B May 1, 2020, 6:42 p.m. OK GNU C11 TESTS 25 1560 0 1400
78758158 Arnab_Bhattacharjee B May 1, 2020, 7:45 p.m. OK GNU C11 TESTS 25 1560 0 1400
78758260 Dihu B May 1, 2020, 7:46 p.m. OK GNU C11 TESTS 25 1560 0 1400
78749557 cdtu_py B May 1, 2020, 6:13 p.m. OK GNU C11 TESTS 25 1560 102400 1400
78757026 abcd227 B May 1, 2020, 7:30 p.m. OK GNU C11 TESTS 25 1575 0 1400
78718096 sszxzxz B May 1, 2020, 4:01 p.m. OK GNU C++11 TESTS 24 31 0 1400
78711415 MN2016 B May 1, 2020, 3:48 p.m. OK GNU C++11 TESTS 24 31 102400 1400
78757904 Arbaji_S B May 1, 2020, 7:42 p.m. OK GNU C++11 TESTS 25 31 102400 1400
78730995 Praveen307 B May 1, 2020, 4:30 p.m. OK GNU C++11 TESTS 24 31 102400 1400
78719853 ted29293107 B May 1, 2020, 4:05 p.m. OK GNU C++11 TESTS 24 31 102400 1400
78712872 tadshi B May 1, 2020, 3:50 p.m. OK GNU C++11 TESTS 24 31 102400 1400
78710253 imzzy B May 1, 2020, 3:45 p.m. OK GNU C++11 TESTS 24 31 1843200 1400
78721836 KeloCetacis B May 1, 2020, 4:09 p.m. OK GNU C++11 TESTS 24 31 3993600 1400
78726154 PraneethChandra18 B May 1, 2020, 4:19 p.m. OK GNU C++11 TESTS 24 46 0 1400
78728793 NoCodingNogain B May 1, 2020, 4:25 p.m. OK GNU C++11 TESTS 24 46 102400 1400
78709355 kriti-dew B May 1, 2020, 3:44 p.m. OK GNU C++14 TESTS 24 30 204800 1400
78704611 abhishek_987 B May 1, 2020, 3:35 p.m. OK GNU C++14 TESTS 24 30 204800 1400
78706073 KienNguyen246 B May 1, 2020, 3:38 p.m. OK GNU C++14 TESTS 24 31 102400 1400
78759809 sanskar111100 B May 1, 2020, 8:09 p.m. OK GNU C++14 TESTS 25 31 102400 1400
78754619 waExpert B May 1, 2020, 7 p.m. OK GNU C++14 TESTS 25 31 204800 1400
78759320 KingInTheNorth_ B May 1, 2020, 8:01 p.m. OK GNU C++14 TESTS 25 31 204800 1400
78733590 Jack2318 B May 1, 2020, 4:37 p.m. OK GNU C++14 TESTS 24 31 204800 1400
78727424 noobitonic B May 1, 2020, 4:21 p.m. OK GNU C++14 TESTS 24 31 204800 1400
78735750 rohitaas_15 B May 1, 2020, 4:42 p.m. OK GNU C++14 TESTS 24 31 204800 1400
78738221 Mr.vajpayee B May 1, 2020, 4:49 p.m. OK GNU C++14 TESTS 24 31 204800 1400
78715595 eunchan115 B May 1, 2020, 3:56 p.m. OK GNU C++17 TESTS 24 30 204800 1400
78744224 code_keeper B May 1, 2020, 5:02 p.m. OK GNU C++17 TESTS 24 31 102400 1400
78719564 MTuan B May 1, 2020, 4:04 p.m. OK GNU C++17 TESTS 24 31 102400 1400
78720100 Entropt B May 1, 2020, 4:05 p.m. OK GNU C++17 TESTS 24 31 102400 1400
78723668 SDUT-spirit B May 1, 2020, 4:13 p.m. OK GNU C++17 TESTS 24 31 102400 1400
78727432 LIGHT_SUN B May 1, 2020, 4:21 p.m. OK GNU C++17 TESTS 24 31 102400 1400
78766104 artv B May 1, 2020, 10:03 p.m. OK GNU C++17 TESTS 25 31 204800 1400
78766820 Fazle_Rakib B May 1, 2020, 10:20 p.m. OK GNU C++17 TESTS 25 31 204800 1400
78762627 Hasti_K B May 1, 2020, 8:53 p.m. OK GNU C++17 TESTS 25 31 204800 1400
78758643 d1abl3 B May 1, 2020, 7:52 p.m. OK GNU C++17 TESTS 25 31 204800 1400
78703407 haved B May 1, 2020, 3:33 p.m. OK GNU C++17 (64) TESTS 24 31 0 1400
78716723 teapotd B May 1, 2020, 3:58 p.m. OK GNU C++17 (64) TESTS 24 31 0 1400
78723810 -osdajigu- B May 1, 2020, 4:13 p.m. OK GNU C++17 (64) TESTS 24 31 204800 1400
78725618 imnasim3.1415 B May 1, 2020, 4:18 p.m. OK GNU C++17 (64) TESTS 24 31 204800 1400
78730273 sjm1512 B May 1, 2020, 4:28 p.m. OK GNU C++17 (64) TESTS 24 31 204800 1400
78707368 sanyam1101 B May 1, 2020, 3:40 p.m. OK GNU C++17 (64) TESTS 24 31 204800 1400
78722922 kn1ck3d B May 1, 2020, 4:11 p.m. OK GNU C++17 (64) TESTS 24 31 204800 1400
78761735 sarthakdb343 B May 1, 2020, 8:38 p.m. OK GNU C++17 (64) TESTS 25 46 0 1400
78763513 Hamoudi B May 1, 2020, 9:10 p.m. OK GNU C++17 (64) TESTS 25 46 0 1400
78763818 dbs_mnnit B May 1, 2020, 9:15 p.m. OK GNU C++17 (64) TESTS 25 46 0 1400
78735436 maguroguma B May 1, 2020, 4:41 p.m. OK Go TESTS 24 46 4608000 1400
78728706 Warren_Wei B May 1, 2020, 4:24 p.m. OK Go TESTS 24 124 5324800 1400
78769024 pohzipohzi B May 1, 2020, 11:25 p.m. OK Go TESTS 25 124 5427200 1400
78706209 vivek21 B May 1, 2020, 3:38 p.m. OK Java 11 TESTS 24 202 0 1400
78748841 egaeus.code B May 1, 2020, 6:08 p.m. OK Java 11 TESTS 25 217 0 1400
78725140 bckslsh03 B May 1, 2020, 4:16 p.m. OK Java 11 TESTS 24 217 0 1400
78705541 rreeennnnn B May 1, 2020, 3:37 p.m. OK Java 11 TESTS 24 217 0 1400
78702383 alex223 B May 1, 2020, 3:31 p.m. OK Java 11 TESTS 24 218 0 1400
78750842 DR.KOKS B May 1, 2020, 6:23 p.m. OK Java 11 TESTS 25 218 0 1400
78749762 anujj B May 1, 2020, 6:14 p.m. OK Java 11 TESTS 25 218 0 1400
78735110 gaurav.mishra_ B May 1, 2020, 4:40 p.m. OK Java 11 TESTS 24 218 0 1400
78718807 ThreadSafe B May 1, 2020, 4:02 p.m. OK Java 11 TESTS 24 218 0 1400
78765952 sushilmall96 B May 1, 2020, 10:01 p.m. OK Java 11 TESTS 25 233 0 1400
78747766 yash49 B May 1, 2020, 6 p.m. OK Java 8 TESTS 24 124 0 1400
78739128 nikhil_supertramp B May 1, 2020, 4:51 p.m. OK Java 8 TESTS 24 124 0 1400
78726657 priyesh001 B May 1, 2020, 4:20 p.m. OK Java 8 TESTS 24 124 0 1400
78703150 cis_pie B May 1, 2020, 3:32 p.m. OK Java 8 TESTS 24 124 0 1400
78767825 kraken7 B May 1, 2020, 10:50 p.m. OK Java 8 TESTS 25 139 0 1400
78755063 coder_sounak B May 1, 2020, 7:05 p.m. OK Java 8 TESTS 25 140 0 1400
78731429 dewanshnigam B May 1, 2020, 4:31 p.m. OK Java 8 TESTS 24 140 0 1400
78711821 niteshgowda B May 1, 2020, 3:48 p.m. OK Java 8 TESTS 24 140 0 1400
78709812 fang9 B May 1, 2020, 3:45 p.m. OK Java 8 TESTS 24 140 0 1400
78705052 littleCatLady B May 1, 2020, 3:36 p.m. OK Java 8 TESTS 24 140 0 1400
78738690 sylvyrfysh B May 1, 2020, 4:50 p.m. OK Kotlin TESTS 24 171 716800 1400
78759898 bohuss B May 1, 2020, 8:10 p.m. OK Kotlin TESTS 25 202 102400 1400
78707528 OLS B May 1, 2020, 3:40 p.m. OK Kotlin TESTS 24 217 102400 1400
78750662 koboshi B May 1, 2020, 6:21 p.m. OK Kotlin TESTS 25 217 1331200 1400
78715030 ravinem1 B May 1, 2020, 3:54 p.m. OK Mono C# TESTS 24 108 6860800 1400
78703614 avtoruxadze B May 1, 2020, 3:33 p.m. OK Mono C# TESTS 24 139 8601600 1400
78720092 terry_u16 B May 1, 2020, 4:05 p.m. OK Mono C# TESTS 24 311 7065600 1400
78736471 BIT B May 1, 2020, 4:44 p.m. OK Mono C# TESTS 24 858 4812800 1400
78714320 GekkoHayate B May 1, 2020, 3:53 p.m. OK MS C++ TESTS 24 46 102400 1400
78717387 r57shell B May 1, 2020, 3:59 p.m. OK MS C++ TESTS 24 93 0 1400
78723293 bqns0125 B May 1, 2020, 4:12 p.m. OK MS C++ TESTS 24 218 102400 1400
78703163 ilyalidam B May 1, 2020, 3:32 p.m. OK MS C++ 2017 TESTS 24 31 0 1400
78703419 Gadi B May 1, 2020, 3:33 p.m. OK MS C++ 2017 TESTS 24 31 0 1400
78705633 ExtraHardCoder B May 1, 2020, 3:37 p.m. OK MS C++ 2017 TESTS 24 46 0 1400
78718673 Anitena B May 1, 2020, 4:02 p.m. OK MS C++ 2017 TESTS 24 109 102400 1400
78723090 leventa B May 1, 2020, 4:12 p.m. OK MS C++ 2017 TESTS 24 109 204800 1400
78741351 Nestifff B May 1, 2020, 4:56 p.m. OK MS C++ 2017 TESTS 24 124 102400 1400
78717617 skkuinkwan1205 B May 1, 2020, 4 p.m. OK MS C++ 2017 TESTS 24 139 0 1400
78713625 yur_ka B May 1, 2020, 3:52 p.m. OK MS C++ 2017 TESTS 24 140 204800 1400
78716040 valyanarezka B May 1, 2020, 3:57 p.m. OK MS C++ 2017 TESTS 24 156 0 1400
78731493 Nick_after_concont B May 1, 2020, 4:31 p.m. OK MS C++ 2017 TESTS 24 171 0 1400
78761737 kit.shiron B May 1, 2020, 8:38 p.m. OK PyPy 2 TESTS 25 140 3072000 1400
78750731 realnimish B May 1, 2020, 6:22 p.m. OK PyPy 2 TESTS 25 140 5836800 1400
78717876 IndianSnakeCharmer B May 1, 2020, 4 p.m. OK PyPy 2 TESTS 24 155 6758400 1400
78721586 pajenegod B May 1, 2020, 4:08 p.m. OK PyPy 2 TESTS 24 171 8806400 1400
78704220 snape_here B May 1, 2020, 3:34 p.m. OK PyPy 2 TESTS 24 218 3584000 1400
78737290 iamprayush B May 1, 2020, 4:46 p.m. OK PyPy 2 TESTS 24 265 12800000 1400
78713075 PracticeAccountICL B May 1, 2020, 3:51 p.m. OK PyPy 3 TESTS 24 171 5120000 1400
78751628 alexeydmitriev B May 1, 2020, 6:30 p.m. OK PyPy 3 TESTS 25 186 2457600 1400
78724691 squalls B May 1, 2020, 4:15 p.m. OK PyPy 3 TESTS 24 186 3481600 1400
78741732 anishde85 B May 1, 2020, 4:57 p.m. OK PyPy 3 TESTS 24 186 10035200 1400
78715500 romanovma B May 1, 2020, 3:55 p.m. OK PyPy 3 TESTS 24 187 4096000 1400
78714789 denis.nasyrov B May 1, 2020, 3:54 p.m. OK PyPy 3 TESTS 24 202 3379200 1400
78714856 naman36 B May 1, 2020, 3:54 p.m. OK PyPy 3 TESTS 24 202 3686400 1400
78744913 coder_sounak B May 1, 2020, 5:03 p.m. OK PyPy 3 TESTS 24 202 10956800 1400
78720527 ltvlx B May 1, 2020, 4:06 p.m. OK PyPy 3 TESTS 24 218 8601600 1400
78751680 codershuvo B May 1, 2020, 6:30 p.m. OK PyPy 3 TESTS 25 218 9420800 1400
78737336 kmd99 B May 1, 2020, 4:46 p.m. OK Python 2 TESTS 24 374 102400 1400
78705034 SoSooding B May 1, 2020, 3:36 p.m. OK Python 2 TESTS 24 374 204800 1400
78753598 Rins B May 1, 2020, 6:49 p.m. OK Python 3 TESTS 25 109 409600 1400
78715625 abhineshprajapati2 B May 1, 2020, 3:56 p.m. OK Python 3 TESTS 24 109 512000 1400
78708392 Gleb1000 B May 1, 2020, 3:42 p.m. OK Python 3 TESTS 24 109 3379200 1400
78753419 LintuStorm B May 1, 2020, 6:47 p.m. OK Python 3 TESTS 25 124 102400 1400
78712813 cowbrain B May 1, 2020, 3:50 p.m. OK Python 3 TESTS 24 124 307200 1400
78750624 KingVlad B May 1, 2020, 6:21 p.m. OK Python 3 TESTS 25 124 409600 1400
78730883 samvedshah_3 B May 1, 2020, 4:30 p.m. OK Python 3 TESTS 24 124 409600 1400
78728395 anumolu_sriharsha B May 1, 2020, 4:24 p.m. OK Python 3 TESTS 24 124 409600 1400
78725912 as10071999 B May 1, 2020, 4:18 p.m. OK Python 3 TESTS 24 124 409600 1400
78710094 tidu149 B May 1, 2020, 3:45 p.m. OK Python 3 TESTS 24 124 409600 1400
78732055 hir12111 B May 1, 2020, 4:33 p.m. OK Rust TESTS 24 140 102400 1400
78732771 IvanDyachenko B May 1, 2020, 4:34 p.m. OK Scala TESTS 24 701 614400 1400

remove filters

Back to search problems