Codeforces Round 673 (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
1417 Codeforces Round 673 (Div. 2) FINISHED False 7200 130604099 Sept. 27, 2020, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14480 ) B Two Arrays PROGRAMMING greedy math sortings 1100

B"RedDreamer has an array a consisting of n non-negative integers, and an unlucky integer T . Let's denote the misfortune of array b having length m as f(b) -- the number of pairs of integers (i, j) such that 1 <= i < j <= m and b_i + b_j = T . RedDreamer has to paint each element of a into one of two colors, white and black (for each element, the color is chosen independently), and then create two arrays c and d so that all white elements belong to c , and all black elements belong to d (it is possible that one of these two arrays becomes empty). RedDreamer wants to paint the elements in such a way that f(c) + f(d) is minimum possible. For example: Help RedDreamer to paint the array optimally! The first line contains one integer t ( 1 <= t <= 1000 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains two integers n and T ( 1 <= n <= 10^5 , 0 <= T <= 10^9 ) -- the number of elements in the array and the unlucky integer, respectively. The second line contains n integers a_1 , a_2 , ..., a_n ( 0 <= a_i <= 10^9 ) -- the elements of the array. The sum of n over all test cases does not exceed 10^5 . For each test case print n integers: p_1 , p_2 , ..., p_n (each p_i is either 0 or 1 ) denoting the colors. If p_i is 0 , then a_i is white and belongs to the array c , otherwise it is black and belongs to the array d . If there are multiple answers that minimize the value of f(c) + f(d) , print any of them. "...

Tutorials

Codeforces Round #673 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
94040912 eugalt B Sept. 28, 2020, 1:51 a.m. OK GNU C11 TESTS 31 62 0 1100
94040952 eugalt B Sept. 28, 2020, 1:52 a.m. OK GNU C11 TESTS 31 62 0 1100
94025684 3434194763HieuPT B Sept. 27, 2020, 6:26 p.m. OK GNU C11 TESTS 31 62 819200 1100
94041652 avi_p B Sept. 28, 2020, 2:16 a.m. OK GNU C11 TESTS 31 358 409600 1100
94023307 babaiserror B Sept. 27, 2020, 5:57 p.m. OK GNU C11 TESTS 31 358 819200 1100
94009184 amanj5486 B Sept. 27, 2020, 4:34 p.m. OK GNU C11 TESTS 31 358 819200 1100
94027389 iamnobody12 B Sept. 27, 2020, 6:51 p.m. OK GNU C11 TESTS 31 358 819200 1100
94006578 QAQ_hua B Sept. 27, 2020, 4:26 p.m. OK GNU C11 TESTS 31 374 614400 1100
94010841 Sefat3674 B Sept. 27, 2020, 4:40 p.m. OK GNU C11 TESTS 31 374 819200 1100
94010411 rjsrishbh26 B Sept. 27, 2020, 4:38 p.m. OK GNU C11 TESTS 31 374 819200 1100
94049247 QlQl B Sept. 28, 2020, 5:09 a.m. OK GNU C++11 TESTS 31 46 0 1100
94041673 LegendNI B Sept. 28, 2020, 2:17 a.m. OK GNU C++11 TESTS 31 46 0 1100
94051245 autistic_boy B Sept. 28, 2020, 5:43 a.m. OK GNU C++11 TESTS 31 46 204800 1100
94041281 chr_ B Sept. 28, 2020, 2:05 a.m. OK GNU C++11 TESTS 31 46 409600 1100
94042744 levill B Sept. 28, 2020, 2:47 a.m. OK GNU C++11 TESTS 31 46 409600 1100
94040955 mading B Sept. 28, 2020, 1:52 a.m. OK GNU C++11 TESTS 31 46 819200 1100
94038697 Kevin7Zz B Sept. 28, 2020, 12:33 a.m. OK GNU C++11 TESTS 31 46 819200 1100
94041345 fr200110217102 B Sept. 28, 2020, 2:07 a.m. OK GNU C++11 TESTS 31 46 1228800 1100
94022224 void_basic_learner B Sept. 27, 2020, 5:48 p.m. OK GNU C++11 TESTS 31 46 2457600 1100
94040071 STDquantum B Sept. 28, 2020, 1:24 a.m. OK GNU C++11 TESTS 31 46 4096000 1100
94040564 MorningDew B Sept. 28, 2020, 1:40 a.m. OK GNU C++14 TESTS 31 46 102400 1100
94051241 Autron B Sept. 28, 2020, 5:43 a.m. OK GNU C++14 TESTS 31 61 0 1100
94027000 ..vince B Sept. 27, 2020, 6:45 p.m. OK GNU C++14 TESTS 31 61 204800 1100
94025946 ssanjeev2424 B Sept. 27, 2020, 6:30 p.m. OK GNU C++14 TESTS 31 61 409600 1100
94024933 CyBerForCe B Sept. 27, 2020, 6:16 p.m. OK GNU C++14 TESTS 31 61 1638400 1100
94049473 harsh639 B Sept. 28, 2020, 5:12 a.m. OK GNU C++14 TESTS 31 62 0 1100
94048465 Rpsushil B Sept. 28, 2020, 4:55 a.m. OK GNU C++14 TESTS 31 62 0 1100
94046116 dozerex B Sept. 28, 2020, 4:08 a.m. OK GNU C++14 TESTS 31 62 0 1100
94049498 abhitariyal B Sept. 28, 2020, 5:13 a.m. OK GNU C++14 TESTS 31 62 0 1100
94051955 AdityaSonani472 B Sept. 28, 2020, 5:54 a.m. OK GNU C++14 TESTS 31 62 0 1100
94029264 nnv-nick B Sept. 27, 2020, 7:25 p.m. OK GNU C++17 TESTS 31 61 0 1100
94039645 qf1518 B Sept. 28, 2020, 1:08 a.m. OK GNU C++17 TESTS 31 61 0 1100
94042081 wingman__7 B Sept. 28, 2020, 2:29 a.m. OK GNU C++17 TESTS 31 61 0 1100
94043653 greatstarashu B Sept. 28, 2020, 3:10 a.m. OK GNU C++17 TESTS 31 61 0 1100
94045745 ashwAni234 B Sept. 28, 2020, 3:59 a.m. OK GNU C++17 TESTS 31 61 0 1100
94030037 SaRcAsTiC_CoDeRr B Sept. 27, 2020, 7:41 p.m. OK GNU C++17 TESTS 31 61 0 1100
94046662 pkumar7 B Sept. 28, 2020, 4:19 a.m. OK GNU C++17 TESTS 31 61 0 1100
94052424 sb007 B Sept. 28, 2020, 6:01 a.m. OK GNU C++17 TESTS 31 61 0 1100
94030149 kedar1514 B Sept. 27, 2020, 7:44 p.m. OK GNU C++17 TESTS 31 61 0 1100
94031131 ankamsriman B Sept. 27, 2020, 8:05 p.m. OK GNU C++17 TESTS 31 61 0 1100
94037467 N1ukash B Sept. 27, 2020, 11:34 p.m. OK GNU C++17 (64) TESTS 31 46 0 1100
94035073 invisible_guest B Sept. 27, 2020, 9:54 p.m. OK GNU C++17 (64) TESTS 31 46 0 1100
94021556 shanks1 B Sept. 27, 2020, 5:43 p.m. OK GNU C++17 (64) TESTS 31 46 0 1100
94021229 rds__98 B Sept. 27, 2020, 5:42 p.m. OK GNU C++17 (64) TESTS 31 46 0 1100
94043718 deepak_15 B Sept. 28, 2020, 3:12 a.m. OK GNU C++17 (64) TESTS 31 46 0 1100
94022695 alif_cse_ju B Sept. 27, 2020, 5:52 p.m. OK GNU C++17 (64) TESTS 31 46 409600 1100
94048355 jiangly B Sept. 28, 2020, 4:53 a.m. OK GNU C++17 (64) TESTS 31 46 409600 1100
94026932 PurpleCrayon B Sept. 27, 2020, 6:44 p.m. OK GNU C++17 (64) TESTS 31 46 409600 1100
94043367 Smit3949 B Sept. 28, 2020, 3:02 a.m. OK GNU C++17 (64) TESTS 31 46 819200 1100
94045512 israil445 B Sept. 28, 2020, 3:54 a.m. OK GNU C++17 (64) TESTS 31 46 819200 1100
94029860 JatinYadav B Sept. 27, 2020, 7:37 p.m. OK Java 11 TESTS 31 187 0 1100
94048864 rohan03 B Sept. 28, 2020, 5:02 a.m. OK Java 11 TESTS 31 218 0 1100
94046691 sam_code B Sept. 28, 2020, 4:20 a.m. OK Java 11 TESTS 31 218 0 1100
94036439 skittles1412 B Sept. 27, 2020, 10:44 p.m. OK Java 11 TESTS 31 218 0 1100
94007652 Apass.Jack B Sept. 27, 2020, 4:29 p.m. OK Java 11 TESTS 31 218 0 1100
94050176 gladwin_rojer B Sept. 28, 2020, 5:25 a.m. OK Java 11 TESTS 31 233 0 1100
94033823 Agnimandur B Sept. 27, 2020, 9:17 p.m. OK Java 11 TESTS 31 233 0 1100
94022496 megyeri99 B Sept. 27, 2020, 5:50 p.m. OK Java 11 TESTS 31 233 0 1100
94021033 qlf9 B Sept. 27, 2020, 5:41 p.m. OK Java 11 TESTS 31 233 0 1100
94049374 codego144 B Sept. 28, 2020, 5:11 a.m. OK Java 11 TESTS 31 234 0 1100
94033073 rite_sharma B Sept. 27, 2020, 8:55 p.m. OK Java 8 TESTS 31 124 0 1100
94047949 ss1237 B Sept. 28, 2020, 4:45 a.m. OK Java 8 TESTS 31 140 0 1100
94047673 amitfbg B Sept. 28, 2020, 4:39 a.m. OK Java 8 TESTS 31 140 0 1100
94041799 srvptk97 B Sept. 28, 2020, 2:20 a.m. OK Java 8 TESTS 31 140 0 1100
94035291 fetetriste B Sept. 27, 2020, 10:01 p.m. OK Java 8 TESTS 31 140 0 1100
94023119 BigBrainInsane B Sept. 27, 2020, 5:55 p.m. OK Java 8 TESTS 31 140 0 1100
94021297 MubtasimShahriar B Sept. 27, 2020, 5:42 p.m. OK Java 8 TESTS 31 140 0 1100
94033264 rachitpts.2454 B Sept. 27, 2020, 9:01 p.m. OK Java 8 TESTS 31 155 0 1100
94031281 nietzschewalrus779 B Sept. 27, 2020, 8:09 p.m. OK Java 8 TESTS 31 155 0 1100
94023647 akram-adel B Sept. 27, 2020, 6 p.m. OK Java 8 TESTS 31 155 0 1100
94031941 sid9406 B Sept. 27, 2020, 8:25 p.m. OK Kotlin TESTS 31 171 409600 1100
94039473 ostroumov B Sept. 28, 2020, 1:03 a.m. OK Kotlin TESTS 31 171 1126400 1100
94033956 Mirimax B Sept. 27, 2020, 9:21 p.m. OK Kotlin TESTS 31 187 6451200 1100
94028630 azukun B Sept. 27, 2020, 7:13 p.m. OK Mono C# TESTS 31 108 19046400 1100
94009331 _remake_ B Sept. 27, 2020, 4:35 p.m. OK MS C++ TESTS 31 156 921600 1100
94049168 nipirennipi136 B Sept. 28, 2020, 5:07 a.m. OK MS C++ 2017 TESTS 31 77 409600 1100
94027233 exode4 B Sept. 27, 2020, 6:49 p.m. OK MS C++ 2017 TESTS 31 78 2048000 1100
94032248 ilya_totl B Sept. 27, 2020, 8:33 p.m. OK MS C++ 2017 TESTS 31 109 409600 1100
94006327 PdrEam B Sept. 27, 2020, 4:25 p.m. OK MS C++ 2017 TESTS 31 109 1536000 1100
94014117 ustaritz B Sept. 27, 2020, 4:50 p.m. OK MS C++ 2017 TESTS 31 171 409600 1100
94012101 ExDo B Sept. 27, 2020, 4:43 p.m. OK MS C++ 2017 TESTS 31 171 409600 1100
94036803 little_lion B Sept. 27, 2020, 11:01 p.m. OK MS C++ 2017 TESTS 31 171 819200 1100
94049691 HippyTD B Sept. 28, 2020, 5:17 a.m. OK MS C++ 2017 TESTS 31 171 1024000 1100
94005884 GradientFox B Sept. 27, 2020, 4:24 p.m. OK MS C++ 2017 TESTS 31 171 1024000 1100
94022168 TheSherlockHomie B Sept. 27, 2020, 5:48 p.m. OK MS C++ 2017 TESTS 31 171 1228800 1100
94021704 BeanHeaDza B Sept. 27, 2020, 5:44 p.m. OK Node.js TESTS 31 139 15872000 1100
94024029 explorer_sifat B Sept. 27, 2020, 6:05 p.m. OK Node.js TESTS 31 140 15872000 1100
94038037 yumtam B Sept. 28, 2020, 12:05 a.m. OK PyPy 2 TESTS 31 155 10444800 1100
94024383 sksshivam007 B Sept. 27, 2020, 6:09 p.m. OK PyPy 2 TESTS 31 249 15052800 1100
94033462 caow B Sept. 27, 2020, 9:06 p.m. OK PyPy 3 TESTS 31 202 11468800 1100
94046178 Anuranjan_Pandey B Sept. 28, 2020, 4:09 a.m. OK PyPy 3 TESTS 31 202 11980800 1100
94012427 vermakunal088 B Sept. 27, 2020, 4:45 p.m. OK PyPy 3 TESTS 31 248 12390400 1100
94041983 FahimSifnatul B Sept. 28, 2020, 2:26 a.m. OK PyPy 3 TESTS 31 249 12185600 1100
94022975 2019ucp1350 B Sept. 27, 2020, 5:54 p.m. OK PyPy 3 TESTS 31 249 13004800 1100
94050892 a0976531005 B Sept. 28, 2020, 5:37 a.m. OK PyPy 3 TESTS 31 249 15667200 1100
94037370 Bovniova B Sept. 27, 2020, 11:30 p.m. OK PyPy 3 TESTS 31 265 14745600 1100
94038596 MilkyW B Sept. 28, 2020, 12:28 a.m. OK PyPy 3 TESTS 31 280 11264000 1100
94043789 AggarwalRaghav B Sept. 28, 2020, 3:13 a.m. OK PyPy 3 TESTS 31 280 11571200 1100
94039123 Akilaksha B Sept. 28, 2020, 12:49 a.m. OK PyPy 3 TESTS 31 296 12390400 1100

remove filters

Back to search problems