Codeforces Round 751 (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
1602 Codeforces Round 751 (Div. 2) FINISHED False 7200 102036263 Oct. 25, 2021, 6:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14221 ) B Divine Array PROGRAMMING constructive algorithms implementation 1100

B'Black is gifted with a Divine array a consisting of n ( 1 <= n <= 2000 ) integers. Each position in a has an initial value. After shouting a curse over the array, it becomes angry and starts an unstoppable transformation. The transformation consists of infinite steps. Array a changes at the i -th step in the following way: for every position j , a_j becomes equal to the number of occurrences of a_j in a before starting this step. Here is an example to help you understand the process better: In the initial array, we had two 2 -s, three 1 -s, only one 4 and only one 3 , so after the first step, each element became equal to the number of its occurrences in the initial array: all twos changed to 2 , all ones changed to 3 , four changed to 1 and three changed to 1 . The transformation steps continue forever. You have to process q queries: in each query, Black is curious to know the value of a_x after the k -th step of transformation. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). Description of the test cases follows. The first line of each test case contains an integer n ( 1 <= n <= 2000 ) -- the size of the array a . The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) -- the initial values of array a . The third line of each test case contains a single integer q ( 1 <= q <= 100 ,000 ) -- the number of queries. Next q lines contain the information about queries -- one query per line. The i -th line contains two integers x_i and k_i ( 1 <= x_i <= n ; 0 <= k_i <= 10^9 ), meaning that Black is asking for the value of a_{x_i} after the k_i -th step of transformation. k_i = 0 means that Black is interested in values of the '...

Tutorials

95865

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
133093947 Mrgglock B Oct. 25, 2021, 5:28 p.m. OK GNU C11 TESTS 11 46 164044800 1100
133072897 InTiMiDaToR B Oct. 25, 2021, 2:27 p.m. OK GNU C11 TESTS 11 62 19865600 1100
133008252 Aditi_ag B Oct. 25, 2021, 7:44 a.m. OK GNU C11 TESTS 11 514 4096000 1100
133023549 murali_33 B Oct. 25, 2021, 8:22 a.m. OK GNU C11 TESTS 11 1903 21094400 1100
133008332 wcdr B Oct. 25, 2021, 7:45 a.m. OK GNU C++14 TESTS 11 31 3379200 1100
133010397 dcz B Oct. 25, 2021, 7:54 a.m. OK GNU C++14 TESTS 11 46 1228800 1100
133060345 Syf2020 B Oct. 25, 2021, 12:22 p.m. OK GNU C++14 TESTS 11 46 1228800 1100
133113092 pavan709 B Oct. 26, 2021, 1:36 a.m. OK GNU C++14 TESTS 11 46 1331200 1100
133099031 SU_N_NY B Oct. 25, 2021, 6:35 p.m. OK GNU C++14 TESTS 11 46 1331200 1100
133063081 Sakib.2019 B Oct. 25, 2021, 12:46 p.m. OK GNU C++14 TESTS 11 46 1331200 1100
133006929 SureLosk B Oct. 25, 2021, 7:38 a.m. OK GNU C++14 TESTS 11 46 1331200 1100
133122329 Syf2020 B Oct. 26, 2021, 5:26 a.m. OK GNU C++14 TESTS 11 46 1331200 1100
133051081 __Winter__ B Oct. 25, 2021, 10:48 a.m. OK GNU C++14 TESTS 11 46 1433600 1100
133052858 shikhaa B Oct. 25, 2021, 11:09 a.m. OK GNU C++14 TESTS 11 46 1433600 1100
133047273 peterwuyihong B Oct. 25, 2021, 10:05 a.m. OK GNU C++17 TESTS 11 15 3072000 1100
133113699 fneleq B Oct. 26, 2021, 1:56 a.m. OK GNU C++17 TESTS 11 31 6656000 1100
133085095 sky123 B Oct. 25, 2021, 4:24 p.m. OK GNU C++17 TESTS 11 46 1228800 1100
133066264 raypeng1729 B Oct. 25, 2021, 1:17 p.m. OK GNU C++17 TESTS 11 46 1228800 1100
133056570 MIG29 B Oct. 25, 2021, 11:46 a.m. OK GNU C++17 TESTS 11 46 1228800 1100
133049604 31ballons B Oct. 25, 2021, 10:32 a.m. OK GNU C++17 TESTS 11 46 1228800 1100
133049058 A.khalil11 B Oct. 25, 2021, 10:25 a.m. OK GNU C++17 TESTS 11 46 1228800 1100
133006794 dhuynguyen2002 B Oct. 25, 2021, 7:38 a.m. OK GNU C++17 TESTS 11 46 1228800 1100
133109230 owhut B Oct. 25, 2021, 10:47 p.m. OK GNU C++17 TESTS 11 46 1228800 1100
133115560 WWW.H B Oct. 26, 2021, 2:53 a.m. OK GNU C++17 TESTS 11 46 1331200 1100
133109783 jt.cheng26_orz B Oct. 25, 2021, 11:12 p.m. OK GNU C++17 (64) TESTS 11 15 1740800 1100
133071448 ZetaFunction B Oct. 25, 2021, 2:11 p.m. OK GNU C++17 (64) TESTS 11 31 1331200 1100
133049934 shivansh_jaiswal B Oct. 25, 2021, 10:35 a.m. OK GNU C++17 (64) TESTS 11 31 1331200 1100
133042943 folly_fish B Oct. 25, 2021, 9:33 a.m. OK GNU C++17 (64) TESTS 11 31 1433600 1100
133037528 lfif B Oct. 25, 2021, 9:09 a.m. OK GNU C++17 (64) TESTS 11 31 1433600 1100
133030953 DenMusya B Oct. 25, 2021, 8:30 a.m. OK GNU C++17 (64) TESTS 11 31 1945600 1100
133076995 yukihana0416 B Oct. 25, 2021, 2:56 p.m. OK GNU C++17 (64) TESTS 11 31 4403200 1100
133050757 vinayak_7989 B Oct. 25, 2021, 10:44 a.m. OK GNU C++17 (64) TESTS 11 31 33484800 1100
133053990 thusloop B Oct. 25, 2021, 11:20 a.m. OK GNU C++17 (64) TESTS 11 31 38297600 1100
133110416 Tovarisch B Oct. 25, 2021, 11:43 p.m. OK GNU C++17 (64) TESTS 11 46 1331200 1100
133070222 Ayush__AT B Oct. 25, 2021, 1:57 p.m. OK GNU C++20 (64) TESTS 11 15 3481600 1100
133085814 wildkite B Oct. 25, 2021, 4:32 p.m. OK GNU C++20 (64) TESTS 11 31 1331200 1100
133084291 the_hyp0cr1t3 B Oct. 25, 2021, 4:15 p.m. OK GNU C++20 (64) TESTS 11 31 1331200 1100
133057830 imtiyazrasool92 B Oct. 25, 2021, 11:59 a.m. OK GNU C++20 (64) TESTS 11 31 1331200 1100
133048738 hackingmachine B Oct. 25, 2021, 10:21 a.m. OK GNU C++20 (64) TESTS 11 31 1331200 1100
133095865 Anwar-Rizk B Oct. 25, 2021, 5:53 p.m. OK GNU C++20 (64) TESTS 11 31 1331200 1100
133046848 zap4eg B Oct. 25, 2021, 10 a.m. OK GNU C++20 (64) TESTS 11 31 1331200 1100
133037630 Anisur_rahaman B Oct. 25, 2021, 9:10 a.m. OK GNU C++20 (64) TESTS 11 31 1433600 1100
133009579 iamvaruag B Oct. 25, 2021, 7:50 a.m. OK GNU C++20 (64) TESTS 11 31 1433600 1100
133104535 pranavsawant1212 B Oct. 25, 2021, 8:15 p.m. OK GNU C++20 (64) TESTS 11 31 1433600 1100
133007860 rdamir86 B Oct. 25, 2021, 7:42 a.m. OK Go TESTS 11 155 13004800 1100
133050382 codelegend B Oct. 25, 2021, 10:40 a.m. OK Haskell TESTS 11 936 31129600 1100
133053367 ayush__1411 B Oct. 25, 2021, 11:14 a.m. OK Java 11 TESTS 11 217 24780800 1100
133014269 Sandy_coder2001 B Oct. 25, 2021, 8 a.m. OK Java 11 TESTS 11 217 24883200 1100
133042137 dhruvil_8803 B Oct. 25, 2021, 9:25 a.m. OK Java 11 TESTS 11 218 24576000 1100
133047083 RegalBeast B Oct. 25, 2021, 10:03 a.m. OK Java 11 TESTS 11 218 24883200 1100
133042012 lavesh80 B Oct. 25, 2021, 9:24 a.m. OK Java 11 TESTS 11 233 24678400 1100
133006437 karunapal_chava B Oct. 25, 2021, 7:36 a.m. OK Java 11 TESTS 11 233 24678400 1100
133122550 chevish B Oct. 26, 2021, 5:29 a.m. OK Java 11 TESTS 11 233 24780800 1100
133103612 Eslamprog32 B Oct. 25, 2021, 7:57 p.m. OK Java 11 TESTS 11 249 25190400 1100
133068524 KarMa_ B Oct. 25, 2021, 1:40 p.m. OK Java 11 TESTS 11 264 24780800 1100
133007713 sumitchavan B Oct. 25, 2021, 7:42 a.m. OK Java 11 TESTS 11 265 43622400 1100
133063035 di_halt B Oct. 25, 2021, 12:46 p.m. OK Java 8 TESTS 11 140 18944000 1100
133072091 anjali001 B Oct. 25, 2021, 2:18 p.m. OK Java 8 TESTS 11 140 19046400 1100
133006994 Ghost_Fox_Sledgehammer B Oct. 25, 2021, 7:39 a.m. OK Java 8 TESTS 11 140 19353600 1100
133061242 di_halt B Oct. 25, 2021, 12:30 p.m. OK Java 8 TESTS 11 155 18944000 1100
133029149 invincible777 B Oct. 25, 2021, 8:28 a.m. OK Java 8 TESTS 11 155 19251200 1100
133048167 altik_nik B Oct. 25, 2021, 10:15 a.m. OK Java 8 TESTS 11 155 35020800 1100
133036827 RonWonWon B Oct. 25, 2021, 9:04 a.m. OK Java 8 TESTS 11 155 37990400 1100
133045807 TheBlueBird B Oct. 25, 2021, 9:48 a.m. OK Java 8 TESTS 11 171 19046400 1100
133037057 Srikanth1777 B Oct. 25, 2021, 9:05 a.m. OK Java 8 TESTS 11 171 19865600 1100
133026139 themadknight45 B Oct. 25, 2021, 8:24 a.m. OK Java 8 TESTS 11 186 37580800 1100
133009411 dextron99 B Oct. 25, 2021, 7:49 a.m. OK Kotlin 1.4 TESTS 11 202 26521600 1100
133038624 StaRFall B Oct. 25, 2021, 9:18 a.m. OK Kotlin 1.4 TESTS 11 982 19865600 1100
133077920 BruteForcee B Oct. 25, 2021, 3:07 p.m. OK Kotlin 1.5 TESTS 11 249 24780800 1100
133054561 daniilzimin4 B Oct. 25, 2021, 11:26 a.m. OK Kotlin 1.5 TESTS 11 967 45363200 1100
133008682 ERIWUG B Oct. 25, 2021, 7:46 a.m. OK Kotlin 1.5 TESTS 11 1122 67686400 1100
133036638 xiayufengchen B Oct. 25, 2021, 9:03 a.m. OK MS C++ 2017 TESTS 11 77 1740800 1100
133006563 lrbdxh B Oct. 25, 2021, 7:37 a.m. OK MS C++ 2017 TESTS 11 78 1945600 1100
133118936 UnHingedFrog B Oct. 26, 2021, 4:18 a.m. OK MS C++ 2017 TESTS 11 187 17305600 1100
133007926 DBijection B Oct. 25, 2021, 7:43 a.m. OK MS C++ 2017 TESTS 11 217 1331200 1100
133115472 swz B Oct. 26, 2021, 2:49 a.m. OK MS C++ 2017 TESTS 11 233 33382400 1100
133012671 vvzagorovskiy B Oct. 25, 2021, 7:59 a.m. OK MS C++ 2017 TESTS 11 234 1331200 1100
133008763 BurnInMine B Oct. 25, 2021, 7:47 a.m. OK MS C++ 2017 TESTS 11 249 2764800 1100
133026593 zeratul_34 B Oct. 25, 2021, 8:26 a.m. OK MS C++ 2017 TESTS 11 436 17203200 1100
133012750 WUT_ZJL B Oct. 25, 2021, 7:59 a.m. OK MS C++ 2017 TESTS 11 514 1228800 1100
133114473 visyyds B Oct. 26, 2021, 2:19 a.m. OK MS C++ 2017 TESTS 11 514 1331200 1100
133042532 addabis B Oct. 25, 2021, 9:29 a.m. OK .NET Core C# TESTS 11 374 13926400 1100
133053288 Prog_Farag B Oct. 25, 2021, 11:13 a.m. OK .NET Core C# TESTS 11 654 13721600 1100
133007515 saratcsss B Oct. 25, 2021, 7:41 a.m. OK .NET Core C# TESTS 11 654 37683200 1100
133017443 Mop B Oct. 25, 2021, 8:09 a.m. OK PHP TESTS 11 389 5632000 1100
133006661 kagu B Oct. 25, 2021, 7:37 a.m. OK PyPy 2 TESTS 11 217 32768000 1100
133100797 hxu10 B Oct. 25, 2021, 7:06 p.m. OK PyPy 3 TESTS 11 202 27238400 1100
133015163 peakyfuckingblinder B Oct. 25, 2021, 8:04 a.m. OK PyPy 3 TESTS 11 233 26931200 1100
133110337 kirito18086 B Oct. 25, 2021, 11:38 p.m. OK PyPy 3 TESTS 11 264 27340800 1100
133098650 PuruKumar B Oct. 25, 2021, 6:30 p.m. OK PyPy 3 TESTS 11 280 32153600 1100
133010688 gokufan1769 B Oct. 25, 2021, 7:55 a.m. OK PyPy 3 TESTS 11 311 29696000 1100
133076632 Munchy_1 B Oct. 25, 2021, 2:52 p.m. OK PyPy 3 TESTS 11 327 27340800 1100
133112226 BingHa B Oct. 26, 2021, 1:09 a.m. OK PyPy 3 TESTS 11 343 27238400 1100
133053887 AKM_ka_Nibba B Oct. 25, 2021, 11:19 a.m. OK PyPy 3 TESTS 11 358 31129600 1100
133045571 lebron87 B Oct. 25, 2021, 9:46 a.m. OK PyPy 3 TESTS 11 373 27340800 1100
133083031 Siddharth_Mehta1311 B Oct. 25, 2021, 4:03 p.m. OK PyPy 3 TESTS 11 374 159436800 1100
133052470 HETRAKESHFADIA B Oct. 25, 2021, 11:04 a.m. OK PyPy 3-64 TESTS 11 233 40038400 1100
133073120 eepsilon B Oct. 25, 2021, 2:30 p.m. OK PyPy 3-64 TESTS 11 311 39731200 1100
133100838 mayank35 B Oct. 25, 2021, 7:07 p.m. OK PyPy 3-64 TESTS 11 404 76083200 1100
133009057 Land_oF_cOdErS B Oct. 25, 2021, 7:48 a.m. OK PyPy 3-64 TESTS 11 405 262963200 1100
133104272 Grim_Firefly B Oct. 25, 2021, 8:09 p.m. OK PyPy 3-64 TESTS 11 467 77414400 1100
133047226 jainil4801 B Oct. 25, 2021, 10:04 a.m. OK PyPy 3-64 TESTS 11 468 45465600 1100
133026235 Himanshu_Kaithal B Oct. 25, 2021, 8:24 a.m. OK PyPy 3-64 TESTS 11 935 55808000 1100
133008066 swatantra209 B Oct. 25, 2021, 7:43 a.m. OK PyPy 3-64 TESTS 11 1310 40652800 1100
133076970 JangaMan B Oct. 25, 2021, 2:56 p.m. OK PyPy 3-64 TESTS 11 1325 40448000 1100
133014732 dipeshk111 B Oct. 25, 2021, 8:02 a.m. OK PyPy 3-64 TESTS 11 1325 40652800 1100
133009702 elistark B Oct. 25, 2021, 7:51 a.m. OK Python 2 TESTS 11 280 4198400 1100
133090560 r57shell B Oct. 25, 2021, 4:47 p.m. OK Python 3 TESTS 11 186 10649600 1100
133119258 nutakki.harsha B Oct. 26, 2021, 4:26 a.m. OK Python 3 TESTS 11 295 5120000 1100
133119240 sergeantsnape B Oct. 26, 2021, 4:25 a.m. OK Python 3 TESTS 11 295 5120000 1100
133008010 tieros B Oct. 25, 2021, 7:43 a.m. OK Python 3 TESTS 11 342 15360000 1100
133026471 juicy_mango B Oct. 25, 2021, 8:25 a.m. OK Python 3 TESTS 11 405 11673600 1100
133069127 Coding_RDX B Oct. 25, 2021, 1:45 p.m. OK Python 3 TESTS 11 405 13824000 1100
133037350 orazbek B Oct. 25, 2021, 9:08 a.m. OK Python 3 TESTS 11 436 6348800 1100
133037237 orazbek B Oct. 25, 2021, 9:07 a.m. OK Python 3 TESTS 11 468 7168000 1100
133050852 megurine B Oct. 25, 2021, 10:45 a.m. OK Python 3 TESTS 11 514 16179200 1100
133009088 sch896205 B Oct. 25, 2021, 7:48 a.m. OK Python 3 TESTS 11 685 13107200 1100
133118716 Spheniscine B Oct. 26, 2021, 4:12 a.m. OK Rust TESTS 11 46 1433600 1100

remove filters

Back to search problems