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 |
---|---|---|---|---|---|---|
1622 | Educational Codeforces Round 120 (Rated for Div. 2) | FINISHED | False | 7200 | 91207499 | Dec. 27, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 21154 ) | B | Berland Music | PROGRAMMING | greedy sortings |
B"Berland Music is a music streaming service built specifically to support Berland local artist. Its developers are currently working on a song recommendation module. So imagine Monocarp got recommended n songs, numbered from 1 to n . The i -th song had its predicted rating equal to p_i , where 1 <= p_i <= n and every integer from 1 to n appears exactly once. In other words, p is a permutation. After listening to each of them, Monocarp pressed either a like or a dislike button. Let his vote sequence be represented with a string s , such that s_i=0 means that he disliked the i -th song, and s_i=1 means that he liked it. Now the service has to re-evaluate the song ratings in such a way that: Among all valid permutations q find the one that has the smallest value of sum limits_{i=1}^n |p_i-q_i| , where |x| is an absolute value of x . Print the permutation q_1, q_2, ... , q_n . If there are multiple answers, you can print any of them. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of songs. The second line of each testcase contains n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n ) -- the permutation of the predicted ratings. The third line contains a single string s , consisting of n characters. Each character is either a 0 or a 1 . 0 means that Monocarp disliked the song, and 1 means that he liked it. The sum of n over all testcases doesn't exceed 2 cdot 10^5 . For each testcase, print a permutation q -- the re-evaluated ratings of the songs. If there are multiple answers such that sum limits_{i=1}^n |p_i-q_i| is minimum possible, you can print any of them. In the first testcase, there exists only one permutati"... |
Educational Codeforces Round 120 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
140856847 | AbdurahmonMuhammadjanov | B | Dec. 28, 2021, 4:53 a.m. | OK | Clang++17 Diagnostics | TESTS | 4 | 1419 | 14643200 | ||
140857578 | Asliddin | B | Dec. 28, 2021, 5:05 a.m. | OK | Clang++17 Diagnostics | TESTS | 4 | 1731 | 25088000 | ||
140822418 | rainboy | B | Dec. 27, 2021, 4:41 p.m. | OK | GNU C11 | TESTS | 4 | 826 | 1843200 | ||
140821989 | plant_a_seedling | B | Dec. 27, 2021, 4:39 p.m. | OK | GNU C++14 | TESTS | 4 | 61 | 2969600 | ||
140821582 | edcr1790 | B | Dec. 27, 2021, 4:37 p.m. | OK | GNU C++14 | TESTS | 4 | 77 | 1228800 | ||
140846719 | Heartlessplaye | B | Dec. 27, 2021, 11:47 p.m. | OK | GNU C++14 | TESTS | 4 | 77 | 1945600 | ||
140826833 | batu_16 | B | Dec. 27, 2021, 5:12 p.m. | OK | GNU C++14 | TESTS | 4 | 77 | 1945600 | ||
140844077 | mp_mishra16 | B | Dec. 27, 2021, 9:52 p.m. | OK | GNU C++14 | TESTS | 4 | 77 | 1945600 | ||
140821296 | huju222000 | B | Dec. 27, 2021, 4:36 p.m. | OK | GNU C++14 | TESTS | 4 | 77 | 2662400 | ||
140860394 | kunalbabbar2843 | B | Dec. 28, 2021, 5:46 a.m. | OK | GNU C++14 | TESTS | 4 | 77 | 2867200 | ||
140816524 | Medo_Adel | B | Dec. 27, 2021, 4:27 p.m. | OK | GNU C++14 | TESTS | 4 | 77 | 3072000 | ||
140849095 | theksg | B | Dec. 28, 2021, 1:41 a.m. | OK | GNU C++14 | TESTS | 4 | 77 | 3379200 | ||
140850988 | RAYL | B | Dec. 28, 2021, 2:42 a.m. | OK | GNU C++14 | TESTS | 4 | 77 | 3993600 | ||
140847749 | RandomLB | B | Dec. 28, 2021, 12:44 a.m. | OK | GNU C++17 | TESTS | 4 | 77 | 1945600 | ||
140856864 | AbdurahmonMuhammadjanov | B | Dec. 28, 2021, 4:53 a.m. | OK | GNU C++17 | TESTS | 4 | 77 | 2048000 | ||
140841790 | edju03 | B | Dec. 27, 2021, 8:48 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 2048000 | ||
140827791 | Mr_Crusher | B | Dec. 27, 2021, 5:21 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 2048000 | ||
140830408 | R0N0T | B | Dec. 27, 2021, 5:49 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 2867200 | ||
140842463 | CTRLPLUSC | B | Dec. 27, 2021, 9:06 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 3993600 | ||
140822508 | Ngochoc | B | Dec. 27, 2021, 4:42 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 3993600 | ||
140823289 | _Gargera_ | B | Dec. 27, 2021, 4:47 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 4505600 | ||
140831914 | VietHuy1 | B | Dec. 27, 2021, 6:07 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 4812800 | ||
140830757 | Ashutosh_Aswal | B | Dec. 27, 2021, 5:53 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 4812800 | ||
140841148 | superMAXX | B | Dec. 27, 2021, 8:33 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 2764800 | ||
140853443 | Nihon_virtua | B | Dec. 28, 2021, 3:42 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 3379200 | ||
140848452 | Akib_2612 | B | Dec. 28, 2021, 1:14 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 4710400 | ||
140860809 | ashu414 | B | Dec. 28, 2021, 5:52 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 5734400 | ||
140838667 | Golden | B | Dec. 27, 2021, 7:43 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 5836800 | ||
140837284 | Codurr | B | Dec. 27, 2021, 7:21 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 6451200 | ||
140849436 | zcx111 | B | Dec. 28, 2021, 1:54 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 62 | 2867200 | ||
140852732 | Ravishu5 | B | Dec. 28, 2021, 3:26 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 62 | 4096000 | ||
140837634 | kwee | B | Dec. 27, 2021, 7:26 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 62 | 4096000 | ||
140860202 | adityasonani | B | Dec. 28, 2021, 5:44 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 62 | 4198400 | ||
140857190 | indpndntartist | B | Dec. 28, 2021, 4:59 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 31 | 2150400 | ||
140847146 | Spectre97 | B | Dec. 28, 2021, 12:11 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 2150400 | ||
140827908 | Mr_Crusher | B | Dec. 27, 2021, 5:22 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 2150400 | ||
140836905 | tdsb | B | Dec. 27, 2021, 7:14 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3072000 | ||
140821928 | IntoTheNight | B | Dec. 27, 2021, 4:38 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3072000 | ||
140817699 | pittsy | B | Dec. 27, 2021, 4:29 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3174400 | ||
140825024 | phanlong2811 | B | Dec. 27, 2021, 4:59 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3379200 | ||
140841273 | BloodEagle | B | Dec. 27, 2021, 8:36 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3891200 | ||
140825196 | luong2k3vip | B | Dec. 27, 2021, 5 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3891200 | ||
140830320 | UnHingedFrog | B | Dec. 27, 2021, 5:48 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 3993600 | ||
140853753 | tovenja | B | Dec. 28, 2021, 3:50 a.m. | OK | Go | TESTS | 4 | 217 | 6656000 | ||
140853105 | SadFriedRice | B | Dec. 28, 2021, 3:35 a.m. | OK | Go | TESTS | 4 | 234 | 7680000 | ||
140853735 | pqhuy98 | B | Dec. 28, 2021, 3:49 a.m. | OK | Go | TESTS | 4 | 810 | 5324800 | ||
140827849 | MoonPractice1234 | B | Dec. 27, 2021, 5:22 p.m. | OK | Java 11 | TESTS | 4 | 249 | 0 | ||
140852915 | __Serendipity | B | Dec. 28, 2021, 3:31 a.m. | OK | Java 11 | TESTS | 4 | 327 | 0 | ||
140821288 | MoonPractice1234 | B | Dec. 27, 2021, 4:36 p.m. | OK | Java 11 | TESTS | 4 | 342 | 3276800 | ||
140857085 | kingku_sahu | B | Dec. 28, 2021, 4:57 a.m. | OK | Java 11 | TESTS | 4 | 343 | 4403200 | ||
140841899 | WalrusRamen21 | B | Dec. 27, 2021, 8:50 p.m. | OK | Java 11 | TESTS | 4 | 343 | 5222400 | ||
140823822 | LucunJi | B | Dec. 27, 2021, 4:50 p.m. | OK | Java 11 | TESTS | 4 | 343 | 14540800 | ||
140828619 | ___bonk___ | B | Dec. 27, 2021, 5:30 p.m. | OK | Java 11 | TESTS | 4 | 343 | 15974400 | ||
140842066 | WalrusRamen21 | B | Dec. 27, 2021, 8:54 p.m. | OK | Java 11 | TESTS | 4 | 358 | 5222400 | ||
140843276 | mphillotry | B | Dec. 27, 2021, 9:27 p.m. | OK | Java 11 | TESTS | 4 | 358 | 5632000 | ||
140815481 | lucky1305 | B | Dec. 27, 2021, 4:25 p.m. | OK | Java 11 | TESTS | 4 | 404 | 15974400 | ||
140833922 | DeepthansuGvs | B | Dec. 27, 2021, 6:33 p.m. | OK | Java 8 | TESTS | 4 | 218 | 2867200 | ||
140842117 | WalrusRamen21 | B | Dec. 27, 2021, 8:56 p.m. | OK | Java 8 | TESTS | 4 | 233 | 2969600 | ||
140842130 | WalrusRamen21 | B | Dec. 27, 2021, 8:56 p.m. | OK | Java 8 | TESTS | 4 | 234 | 2969600 | ||
140824906 | Piyushnagpal80 | B | Dec. 27, 2021, 4:58 p.m. | OK | Java 8 | TESTS | 4 | 265 | 4198400 | ||
140842451 | AbdelrahmanFathy | B | Dec. 27, 2021, 9:05 p.m. | OK | Java 8 | TESTS | 4 | 280 | 9728000 | ||
140840021 | ss1237 | B | Dec. 27, 2021, 8:09 p.m. | OK | Java 8 | TESTS | 4 | 296 | 13926400 | ||
140836467 | naitikvarshney | B | Dec. 27, 2021, 7:08 p.m. | OK | Java 8 | TESTS | 4 | 311 | 11468800 | ||
140825095 | LITT_UP | B | Dec. 27, 2021, 4:59 p.m. | OK | Java 8 | TESTS | 4 | 389 | 28979200 | ||
140817123 | riusmalt | B | Dec. 27, 2021, 4:28 p.m. | OK | Java 8 | TESTS | 4 | 436 | 10342400 | ||
140822930 | narayan.xrd | B | Dec. 27, 2021, 4:44 p.m. | OK | Java 8 | TESTS | 4 | 810 | 2969600 | ||
140841750 | Uditpatel78 | B | Dec. 27, 2021, 8:47 p.m. | OK | MS C++ 2017 | TESTS | 4 | 280 | 2867200 | ||
140817715 | akash_iitr002 | B | Dec. 27, 2021, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 4 | 280 | 6246400 | ||
140820151 | GYKI. | B | Dec. 27, 2021, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 4 | 1637 | 5427200 | ||
140823885 | giovannielias9500 | B | Dec. 27, 2021, 4:51 p.m. | OK | .NET Core C# | TESTS | 4 | 139 | 31436800 | ||
140822925 | 1_2_3_4_5_9 | B | Dec. 27, 2021, 4:44 p.m. | OK | PyPy 2 | TESTS | 4 | 717 | 25292800 | ||
140849232 | derghost | B | Dec. 28, 2021, 1:47 a.m. | OK | PyPy 3 | TESTS | 4 | 436 | 26419200 | ||
140854998 | sw_enthusiast | B | Dec. 28, 2021, 4:17 a.m. | OK | PyPy 3 | TESTS | 4 | 483 | 86732800 | ||
140847793 | MongyTrad | B | Dec. 28, 2021, 12:45 a.m. | OK | PyPy 3 | TESTS | 4 | 592 | 23756800 | ||
140861564 | pks667553 | B | Dec. 28, 2021, 6:02 a.m. | OK | PyPy 3 | TESTS | 4 | 639 | 21606400 | ||
140822739 | ArjitShrivastava | B | Dec. 27, 2021, 4:43 p.m. | OK | PyPy 3 | TESTS | 4 | 670 | 21299200 | ||
140823714 | ArkaDutt007 | B | Dec. 27, 2021, 4:50 p.m. | OK | PyPy 3 | TESTS | 4 | 685 | 35737600 | ||
140828115 | kaki1013 | B | Dec. 27, 2021, 5:25 p.m. | OK | PyPy 3 | TESTS | 4 | 795 | 19865600 | ||
140841807 | lapwood | B | Dec. 27, 2021, 8:48 p.m. | OK | PyPy 3 | TESTS | 4 | 858 | 26828800 | ||
140837923 | brimstone | B | Dec. 27, 2021, 7:30 p.m. | OK | PyPy 3 | TESTS | 4 | 873 | 20377600 | ||
140856364 | rahin1301 | B | Dec. 28, 2021, 4:44 a.m. | OK | PyPy 3 | TESTS | 4 | 920 | 25702400 | ||
140854985 | coolstreaming | B | Dec. 28, 2021, 4:17 a.m. | OK | PyPy 3-64 | TESTS | 4 | 233 | 25088000 | ||
140845771 | Ayushman_123 | B | Dec. 27, 2021, 11 p.m. | OK | PyPy 3-64 | TESTS | 4 | 451 | 42700800 | ||
140836840 | AzulLapisLazuli | B | Dec. 27, 2021, 7:13 p.m. | OK | PyPy 3-64 | TESTS | 4 | 514 | 33894400 | ||
140824539 | tommypranay | B | Dec. 27, 2021, 4:55 p.m. | OK | PyPy 3-64 | TESTS | 4 | 545 | 37376000 | ||
140834916 | dragon_reborn | B | Dec. 27, 2021, 6:46 p.m. | OK | PyPy 3-64 | TESTS | 4 | 560 | 37990400 | ||
140852791 | happywater | B | Dec. 28, 2021, 3:27 a.m. | OK | PyPy 3-64 | TESTS | 4 | 561 | 30208000 | ||
140855098 | del-user-774348 | B | Dec. 28, 2021, 4:19 a.m. | OK | PyPy 3-64 | TESTS | 4 | 577 | 17612800 | ||
140825634 | saketh_2513 | B | Dec. 27, 2021, 5:03 p.m. | OK | PyPy 3-64 | TESTS | 4 | 592 | 31027200 | ||
140859584 | abhi_dhanraj | B | Dec. 28, 2021, 5:35 a.m. | OK | PyPy 3-64 | TESTS | 4 | 607 | 35225600 | ||
140844738 | freakbuoyancy | B | Dec. 27, 2021, 10:16 p.m. | OK | PyPy 3-64 | TESTS | 4 | 638 | 30412800 | ||
140823993 | OLOGY | B | Dec. 27, 2021, 4:51 p.m. | OK | Python 2 | TESTS | 4 | 529 | 30105600 | ||
140854861 | Ratree | B | Dec. 28, 2021, 4:14 a.m. | OK | Python 3 | TESTS | 4 | 420 | 32972800 | ||
140839737 | a_sc | B | Dec. 27, 2021, 8:03 p.m. | OK | Python 3 | TESTS | 4 | 483 | 13414400 | ||
140858777 | dddl | B | Dec. 28, 2021, 5:24 a.m. | OK | Python 3 | TESTS | 4 | 483 | 30208000 | ||
140832832 | akk5597 | B | Dec. 27, 2021, 6:19 p.m. | OK | Python 3 | TESTS | 4 | 529 | 22118400 | ||
140834883 | _stylebender_ | B | Dec. 27, 2021, 6:46 p.m. | OK | Python 3 | TESTS | 4 | 546 | 27545600 | ||
140830995 | Harsha_Gajjala | B | Dec. 27, 2021, 5:56 p.m. | OK | Python 3 | TESTS | 4 | 561 | 13414400 | ||
140840247 | satishcrazy | B | Dec. 27, 2021, 8:14 p.m. | OK | Python 3 | TESTS | 4 | 576 | 22016000 | ||
140852123 | franckmy | B | Dec. 28, 2021, 3:11 a.m. | OK | Python 3 | TESTS | 4 | 577 | 22016000 | ||
140819209 | Virurepswal | B | Dec. 27, 2021, 4:32 p.m. | OK | Python 3 | TESTS | 4 | 592 | 20377600 | ||
140831622 | the_emerging_coder | B | Dec. 27, 2021, 6:04 p.m. | OK | Python 3 | TESTS | 4 | 607 | 19968000 | ||
140829068 | apilat | B | Dec. 27, 2021, 5:34 p.m. | OK | Rust 2021 | TESTS | 4 | 46 | 6860800 | ||
140853871 | satylogin | B | Dec. 28, 2021, 3:52 a.m. | OK | Rust 2021 | TESTS | 4 | 46 | 11776000 | ||
140853676 | satylogin | B | Dec. 28, 2021, 3:48 a.m. | OK | Rust 2021 | TESTS | 4 | 46 | 11776000 | ||
140839194 | takezawa | B | Dec. 27, 2021, 7:53 p.m. | OK | Rust 2021 | TESTS | 4 | 61 | 18534400 | ||
140848761 | Spheniscine | B | Dec. 28, 2021, 1:26 a.m. | OK | Rust 2021 | TESTS | 4 | 62 | 9216000 | ||
140815551 | Ganxel | B | Dec. 27, 2021, 4:25 p.m. | OK | Rust 2021 | TESTS | 4 | 170 | 16588800 | ||
140858947 | pili | B | Dec. 28, 2021, 5:26 a.m. | OK | Rust 2021 | TESTS | 4 | 186 | 16179200 |
Back to search problems