Codeforces Round 874 (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
1833 Codeforces Round 874 (Div. 3) FINISHED False 8100 47316299 May 19, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 26800 ) B Restore the Weather PROGRAMMING greedy sortings

B'You are given an array a containing the weather forecast for Berlandia for the last n days. That is, a_i -- is the estimated air temperature on day i ( 1 <= i <= n ). You are also given an array b -- the air temperature that was actually present on each of the days. However, all the values in array b are mixed up. Determine which day was which temperature, if you know that the weather never differs from the forecast by more than k degrees. In other words, if on day i the real air temperature was c , then the equality |a_i - c| <= k is always true. For example, let an array a = [ 1, 3, 5, 3, 9 ] of length n = 5 and k = 2 be given and an array b = [ 2, 5, 11, 2, 4 ]. Then, so that the value of b_i corresponds to the air temperature on day i , we can rearrange the elements of the array b so: [ 2, 2, 5, 4, 11 ]. Indeed: The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n ( 1 <= n <= 10^5 ) and k ( 0 <= k <= 10^9 ) -- the number of days and the maximum difference between the expected and actual air temperature on each day. The second line of each test case contains exactly n integers -- elements of array a ( -10^9 <= a_i <= 10^9 ). The third line of each test case contains exactly n integers -- elements of array b ( -10^9 <= b_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 , and that the elements of array b can always be rearranged so that the equality |a_i - b_i| <= k is true for all i . On a separate line for each test case, output exactly n numbers -- the values of air temperature on each of the days in the correct order. If ther'...

Tutorials

116636

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
206575416 mban259 B May 19, 2023, 11:40 p.m. OK C# 10 TESTS 12 155 31334400
206577570 bluemegane B May 20, 2023, 12:57 a.m. OK C# 8 TESTS 12 296 31129600
206567082 sysadmin B May 19, 2023, 8:10 p.m. OK Clang++17 Diagnostics TESTS 12 311 3072000
206543582 meher_pranav08 B May 19, 2023, 4:49 p.m. OK GNU C11 TESTS 6 498 2048000
206540175 qiqi_1 B May 19, 2023, 4:43 p.m. OK GNU C11 TESTS 6 499 1228800
206575386 cugnanggu B May 19, 2023, 11:38 p.m. OK GNU C11 TESTS 12 514 3174400
206564314 ucf_26 B May 19, 2023, 7:29 p.m. OK GNU C++14 TESTS 6 77 1638400
206555981 AuroraAlaska B May 19, 2023, 5:53 p.m. OK GNU C++14 TESTS 6 77 1638400
206536224 comeflyaway B May 19, 2023, 4:33 p.m. OK GNU C++14 TESTS 6 77 2048000
206544903 princesharma74 B May 19, 2023, 4:54 p.m. OK GNU C++14 TESTS 6 77 2150400
206562678 suru_korlam B May 19, 2023, 7:08 p.m. OK GNU C++14 TESTS 6 77 6656000
206546319 Fyindins B May 19, 2023, 5:01 p.m. OK GNU C++14 TESTS 6 77 20070400
206539543 alshantir98 B May 19, 2023, 4:41 p.m. OK GNU C++14 TESTS 6 78 1638400
206542455 NullBrain B May 19, 2023, 4:47 p.m. OK GNU C++14 TESTS 6 78 1638400
206562571 V_Gosain B May 19, 2023, 7:06 p.m. OK GNU C++14 TESTS 6 92 1638400
206534360 Identity_Imbalance B May 19, 2023, 4:29 p.m. OK GNU C++14 TESTS 6 92 3788800
206544524 Gondozu B May 19, 2023, 4:52 p.m. OK GNU C++17 TESTS 6 77 1638400
206557925 Muhammad_Alparslan B May 19, 2023, 6:12 p.m. OK GNU C++17 TESTS 6 77 1638400
206546632 taher_benjabria B May 19, 2023, 5:03 p.m. OK GNU C++17 TESTS 6 77 1638400
206559330 sanskarn17 B May 19, 2023, 6:27 p.m. OK GNU C++17 TESTS 6 77 1638400
206554577 MouayadL7 B May 19, 2023, 5:39 p.m. OK GNU C++17 TESTS 6 77 1843200
206536694 gayatris B May 19, 2023, 4:34 p.m. OK GNU C++17 TESTS 6 77 2252800
206539764 srikanthm B May 19, 2023, 4:42 p.m. OK GNU C++17 TESTS 6 77 2252800
206538032 shviv1 B May 19, 2023, 4:38 p.m. OK GNU C++17 TESTS 6 77 2252800
206550090 manjuan01 B May 19, 2023, 5:15 p.m. OK GNU C++17 TESTS 6 77 2969600
206534470 saminCSE B May 19, 2023, 4:29 p.m. OK GNU C++17 TESTS 6 77 4505600
206556837 Astha_2021 B May 19, 2023, 6:01 p.m. OK GNU C++17 (64) TESTS 6 46 3584000
206561408 Proofy B May 19, 2023, 6:52 p.m. OK GNU C++17 (64) TESTS 6 61 1638400
206555203 Krzychuo B May 19, 2023, 5:46 p.m. OK GNU C++17 (64) TESTS 6 61 3174400
206561633 Saif_Dawood B May 19, 2023, 6:54 p.m. OK GNU C++17 (64) TESTS 6 61 3276800
206536235 durga_kondaveeti B May 19, 2023, 4:33 p.m. OK GNU C++17 (64) TESTS 6 61 5632000
206534607 klucse2000031799 B May 19, 2023, 4:30 p.m. OK GNU C++17 (64) TESTS 6 61 5632000
206573631 Abdelrahman_Elsayed0 B May 19, 2023, 10:37 p.m. OK GNU C++17 (64) TESTS 12 62 1638400
206547674 Shanmukh-_-estrella B May 19, 2023, 5:09 p.m. OK GNU C++17 (64) TESTS 6 62 4505600
206538914 sainagaraja03 B May 19, 2023, 4:40 p.m. OK GNU C++17 (64) TESTS 6 62 5632000
206544601 aboodj646 B May 19, 2023, 4:52 p.m. OK GNU C++17 (64) TESTS 6 62 6656000
206538955 AvidAshu B May 19, 2023, 4:40 p.m. OK GNU C++20 (64) TESTS 6 31 3686400
206552866 FirstAccpted B May 19, 2023, 5:23 p.m. OK GNU C++20 (64) TESTS 6 46 1228800
206553295 LamaSalah B May 19, 2023, 5:27 p.m. OK GNU C++20 (64) TESTS 6 46 1228800
206565364 OkClinty B May 19, 2023, 7:43 p.m. OK GNU C++20 (64) TESTS 6 46 1228800
206567938 RHEXAOC B May 19, 2023, 8:21 p.m. OK GNU C++20 (64) TESTS 12 46 1228800
206573204 Omarfarhan B May 19, 2023, 10:24 p.m. OK GNU C++20 (64) TESTS 12 46 1638400
206572157 _FireGhost_ B May 19, 2023, 9:54 p.m. OK GNU C++20 (64) TESTS 12 46 1638400
206577647 DommeUse B May 20, 2023, 1 a.m. OK GNU C++20 (64) TESTS 12 46 1638400
206576994 MinaRaouf B May 20, 2023, 12:40 a.m. OK GNU C++20 (64) TESTS 12 46 1638400
206576942 anuraggoudlingala39312 B May 20, 2023, 12:38 a.m. OK GNU C++20 (64) TESTS 12 46 1638400
206547173 pxhero B May 19, 2023, 5:06 p.m. OK Java 11 TESTS 6 326 2252800
206557016 rezairianto B May 19, 2023, 6:03 p.m. OK Java 11 TESTS 6 326 2457600
206556885 vijender_8601 B May 19, 2023, 6:02 p.m. OK Java 11 TESTS 6 327 1126400
206575672 enuguru_2002 B May 19, 2023, 11:50 p.m. OK Java 11 TESTS 12 342 16896000
206553831 Panther369 B May 19, 2023, 5:32 p.m. OK Java 11 TESTS 6 436 20582400
206553289 pranp_24 B May 19, 2023, 5:27 p.m. OK Java 11 TESTS 6 638 4096000
206562773 Abdelrahman.Salah B May 19, 2023, 7:09 p.m. OK Java 11 TESTS 6 639 2867200
206541373 2000030958 B May 19, 2023, 4:45 p.m. OK Java 11 TESTS 6 655 2355200
206567970 imvivekthakur B May 19, 2023, 8:21 p.m. OK Java 11 TESTS 12 670 4812800
206570464 OPyrohov B May 19, 2023, 9:11 p.m. OK Java 11 TESTS 12 888 7475200
206577755 humwawe B May 20, 2023, 1:03 a.m. OK Java 17 TESTS 12 264 614400
206574327 Mostafa_Murad B May 19, 2023, 11 p.m. OK Java 17 TESTS 12 312 10854400
206554337 chenxiaoming B May 19, 2023, 5:37 p.m. OK Java 17 TESTS 6 358 3276800
206573360 kamranm B May 19, 2023, 10:29 p.m. OK Java 17 TESTS 12 358 207462400
206555018 m_a_s_91 B May 19, 2023, 5:44 p.m. OK Java 17 TESTS 6 373 9932800
206566331 Eslam_Ahmed B May 19, 2023, 7:59 p.m. OK Java 17 TESTS 12 405 10240000
206546850 2745810964z B May 19, 2023, 5:04 p.m. OK Java 17 TESTS 6 514 716800
206534180 Shankar_Gowd B May 19, 2023, 4:29 p.m. OK Java 17 TESTS 6 779 19558400
206538753 aboodjdou96 B May 19, 2023, 4:39 p.m. OK Java 17 TESTS 6 841 1024000
206534796 nalluriprasanth B May 19, 2023, 4:30 p.m. OK Java 17 TESTS 6 872 1024000
206570441 lpychemistry B May 19, 2023, 9:10 p.m. OK Java 8 TESTS 12 218 0
206554117 Sylvester_ B May 19, 2023, 5:35 p.m. OK Java 8 TESTS 6 233 6963200
206545205 deni1000 B May 19, 2023, 4:55 p.m. OK Java 8 TESTS 6 233 8806400
206572333 hasan8130 B May 19, 2023, 9:58 p.m. OK Java 8 TESTS 12 280 9011200
206559040 formidablechief_27 B May 19, 2023, 6:24 p.m. OK Java 8 TESTS 6 280 85606400
206572303 grandeur19919 B May 19, 2023, 9:57 p.m. OK Java 8 TESTS 12 327 14745600
206561603 mohamedhassan_c B May 19, 2023, 6:54 p.m. OK Java 8 TESTS 6 343 20992000
206572509 hasan8130 B May 19, 2023, 10:02 p.m. OK Java 8 TESTS 12 576 9011200
206572436 hasan8130 B May 19, 2023, 10:01 p.m. OK Java 8 TESTS 12 592 9011200
206552599 kiethuynh997 B May 19, 2023, 5:21 p.m. OK Java 8 TESTS 6 904 4198400
206541802 2000030077_manvitha B May 19, 2023, 4:46 p.m. OK Mono C# TESTS 6 514 41369600
206547069 mukhaledd B May 19, 2023, 5:06 p.m. OK MS C++ 2017 TESTS 6 265 1638400
206538181 Suraksha_Dusa B May 19, 2023, 4:38 p.m. OK MS C++ 2017 TESTS 6 280 3584000
206535047 kurzwe6er B May 19, 2023, 4:31 p.m. OK MS C++ 2017 TESTS 6 358 4505600
206569345 Michele_T B May 19, 2023, 8:48 p.m. OK PyPy 3 TESTS 12 420 18636800
206555649 khanter_ B May 19, 2023, 5:50 p.m. OK PyPy 3 TESTS 6 452 18636800
206556226 jvatsal0709 B May 19, 2023, 5:56 p.m. OK PyPy 3 TESTS 6 499 16896000
206559214 brokie B May 19, 2023, 6:25 p.m. OK PyPy 3 TESTS 6 514 22323200
206566196 dominator1234 B May 19, 2023, 7:56 p.m. OK PyPy 3 TESTS 12 529 22732800
206545019 Ayushman_123 B May 19, 2023, 4:54 p.m. OK PyPy 3 TESTS 6 623 20172800
206538301 DongJM B May 19, 2023, 4:38 p.m. OK PyPy 3 TESTS 6 732 22016000
206574295 Alex_Savitskiy B May 19, 2023, 10:59 p.m. OK PyPy 3 TESTS 12 779 21196800
206559251 aspiringquant B May 19, 2023, 6:26 p.m. OK PyPy 3-64 TESTS 6 186 25804800
206562519 the_last_smilodon B May 19, 2023, 7:06 p.m. OK PyPy 3-64 TESTS 6 234 28672000
206562316 the_last_smilodon B May 19, 2023, 7:03 p.m. OK PyPy 3-64 TESTS 6 234 28672000
206572224 jerome_coding B May 19, 2023, 9:55 p.m. OK PyPy 3-64 TESTS 12 249 24371200
206555534 alexwice B May 19, 2023, 5:49 p.m. OK PyPy 3-64 TESTS 6 249 28262400
206562162 AdityaOza B May 19, 2023, 7:01 p.m. OK PyPy 3-64 TESTS 6 264 19046400
206576518 crapcode B May 20, 2023, 12:22 a.m. OK PyPy 3-64 TESTS 12 280 19865600
206553710 cholebhature B May 19, 2023, 5:31 p.m. OK PyPy 3-64 TESTS 6 280 31027200
206540510 DanSam B May 19, 2023, 4:43 p.m. OK PyPy 3-64 TESTS 6 295 31129600
206556706 imRJD14 B May 19, 2023, 6 p.m. OK PyPy 3-64 TESTS 6 374 18944000
206542340 tejash0901 B May 19, 2023, 4:47 p.m. OK Python 3 TESTS 6 280 18227200
206550091 zilj B May 19, 2023, 5:15 p.m. OK Python 3 TESTS 6 295 22118400
206535974 zilj B May 19, 2023, 4:33 p.m. OK Python 3 TESTS 6 295 23244800
206550590 Almotasembelah_Sharaf B May 19, 2023, 5:18 p.m. OK Python 3 TESTS 6 295 28364800
206550274 Almotasembelah_Sharaf B May 19, 2023, 5:16 p.m. OK Python 3 TESTS 6 295 28364800
206541833 Sepehr_Mirshahi B May 19, 2023, 4:46 p.m. OK Python 3 TESTS 6 295 28672000
206557954 orazbek B May 19, 2023, 6:12 p.m. OK Python 3 TESTS 6 296 24780800
206560212 smanikantam B May 19, 2023, 6:37 p.m. OK Python 3 TESTS 6 311 22016000
206555368 TimTim3101 B May 19, 2023, 5:47 p.m. OK Python 3 TESTS 6 311 22425600
206556024 dragonball_2002 B May 19, 2023, 5:53 p.m. OK Python 3 TESTS 6 311 28262400
206535761 klu_2000031840 B May 19, 2023, 4:32 p.m. OK Ruby 3 TESTS 6 966 21094400
206537565 KLU_30153 B May 19, 2023, 4:36 p.m. OK Ruby 3 TESTS 6 982 21606400
206540379 KrishnaSasank03 B May 19, 2023, 4:43 p.m. OK Ruby 3 TESTS 6 998 19046400

remove filters

Back to search problems