CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!)

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
1870 CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 8100 36775499 Sept. 18, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11595 ) C Colorful Table PROGRAMMING binary search data structures dp implementation math sortings two pointers

B'You are given two integers n and k . You are also given an array of integers a_1, a_2, ldots, a_n of size n . It is known that for all 1 <= q i <= q n , 1 <= q a_i <= q k . Define a two-dimensional array b of size n x n as follows: b_{i, j} = min(a_i, a_j) . Represent array b as a square, where the upper left cell is b_{1, 1} , rows are numbered from top to bottom from 1 to n , and columns are numbered from left to right from 1 to n . Let the color of a cell be the number written in it (for a cell with coordinates (i, j) , this is b_{i, j} ). For each color from 1 to k , find the smallest rectangle in the array b containing all cells of this color. Output the sum of width and height of this rectangle. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Then follows the description of the test cases. The first line of each test case contains two integers n and k ( 1 <= q n, k <= q 10^5 ) -- the size of array a and the number of colors. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q k ) -- the array a . It is guaranteed that the sum of the values of n and k over all test cases does not exceed 10^5 . For each test case, output k numbers: the sums of width and height of the smallest rectangle containing all cells of a color, for each color from 1 to k . In the first test case, the entire array b consists of color 1 , so the smallest rectangle for color 1 has a size of 2 x 2 , and the sum of its sides is 4 . In the second test case, the array b looks like this: 1112 One of the corner cells has color 2 , and the other three cells have color 1 . Therefore, the smallest rectangle for color 1 has a size of 2 x 2$$'...

Tutorials

CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
223922432 tahtarovserver C Sept. 18, 2023, 5:32 p.m. OK C# 10 TESTS 23 93 17100800
223973921 bluemegane C Sept. 19, 2023, 3:55 a.m. OK C# 8 TESTS 23 202 16691200
223976407 Dhruvshahh C Sept. 19, 2023, 4:35 a.m. OK GNU C++14 TESTS 23 46 512000
223968278 prairie2022 C Sept. 19, 2023, 2:38 a.m. OK GNU C++14 TESTS 23 46 819200
223959466 Combi C Sept. 18, 2023, 11:14 p.m. OK GNU C++14 TESTS 23 46 819200
223924033 Practiceking C Sept. 18, 2023, 5:40 p.m. OK GNU C++14 TESTS 23 46 1228800
223962781 zltzlt C Sept. 19, 2023, 12:48 a.m. OK GNU C++14 TESTS 23 46 1331200
223924681 Gold_Dragon C Sept. 18, 2023, 5:44 p.m. OK GNU C++14 TESTS 23 46 1638400
223913310 Dahy C Sept. 18, 2023, 4:37 p.m. OK GNU C++14 TESTS 23 46 1945600
223972867 Zhao_Xudong C Sept. 19, 2023, 3:37 a.m. OK GNU C++14 TESTS 23 46 2048000
223961456 OvO_Zuo C Sept. 19, 2023, 12:16 a.m. OK GNU C++14 TESTS 23 46 2048000
223925345 NewTraveller C Sept. 18, 2023, 5:48 p.m. OK GNU C++14 TESTS 23 46 2048000
223978556 hbkxyz C Sept. 19, 2023, 5:10 a.m. OK GNU C++17 TESTS 23 46 409600
223977240 Phu123 C Sept. 19, 2023, 4:49 a.m. OK GNU C++17 TESTS 23 46 409600
223976217 Singh_Rajan41 C Sept. 19, 2023, 4:32 a.m. OK GNU C++17 TESTS 23 46 1228800
223964995 OobugoO C Sept. 19, 2023, 1:35 a.m. OK GNU C++17 TESTS 23 46 1228800
223959126 12312_ C Sept. 18, 2023, 11:04 p.m. OK GNU C++17 TESTS 23 46 1228800
223927543 jzhe727 C Sept. 18, 2023, 6:04 p.m. OK GNU C++17 TESTS 23 46 1228800
223922251 MeEzOo_ C Sept. 18, 2023, 5:31 p.m. OK GNU C++17 TESTS 23 46 1228800
223911525 iuxan C Sept. 18, 2023, 4:33 p.m. OK GNU C++17 TESTS 23 46 1228800
223912659 chriscake97001 C Sept. 18, 2023, 4:35 p.m. OK GNU C++17 TESTS 23 46 1331200
223971855 Rinors C Sept. 19, 2023, 3:20 a.m. OK GNU C++17 TESTS 23 46 1638400
223973936 ZXG_DZXX C Sept. 19, 2023, 3:55 a.m. OK GNU C++17 (64) TESTS 23 31 409600
223971854 lunchbox C Sept. 19, 2023, 3:20 a.m. OK GNU C++17 (64) TESTS 23 31 1638400
223912851 luowang666 C Sept. 18, 2023, 4:36 p.m. OK GNU C++17 (64) TESTS 23 31 3174400
223913796 Hrishikesh1107 C Sept. 18, 2023, 4:38 p.m. OK GNU C++17 (64) TESTS 23 31 4812800
223960972 Ceased.xp C Sept. 19, 2023, 12:02 a.m. OK GNU C++17 (64) TESTS 23 46 819200
223913086 ukhalikshina C Sept. 18, 2023, 4:37 p.m. OK GNU C++17 (64) TESTS 23 46 1638400
223943040 Pepper_yzy C Sept. 18, 2023, 7:55 p.m. OK GNU C++17 (64) TESTS 23 46 2048000
223938575 shubhan.singh22 C Sept. 18, 2023, 7:47 p.m. OK GNU C++17 (64) TESTS 23 46 2048000
223928495 forever_lose C Sept. 18, 2023, 6:11 p.m. OK GNU C++17 (64) TESTS 23 46 2048000
223922864 XH_v C Sept. 18, 2023, 5:33 p.m. OK GNU C++17 (64) TESTS 23 46 2048000
223971322 hnust_xiangjiasen C Sept. 19, 2023, 3:11 a.m. OK GNU C++20 (64) TESTS 23 31 409600
223971034 riverwalk7 C Sept. 19, 2023, 3:06 a.m. OK GNU C++20 (64) TESTS 23 31 409600
223968792 qiloudemao1 C Sept. 19, 2023, 2:47 a.m. OK GNU C++20 (64) TESTS 23 31 819200
223962614 Shahd_Mohamed230 C Sept. 19, 2023, 12:43 a.m. OK GNU C++20 (64) TESTS 23 31 819200
223961848 memaybeovai C Sept. 19, 2023, 12:25 a.m. OK GNU C++20 (64) TESTS 23 31 819200
223933630 maqi_maqi C Sept. 18, 2023, 6:53 p.m. OK GNU C++20 (64) TESTS 23 31 819200
223933589 JOO_91 C Sept. 18, 2023, 6:52 p.m. OK GNU C++20 (64) TESTS 23 31 819200
223929072 yangster67 C Sept. 18, 2023, 6:16 p.m. OK GNU C++20 (64) TESTS 23 31 819200
223971309 qbnoier C Sept. 19, 2023, 3:11 a.m. OK GNU C++20 (64) TESTS 23 31 921600
223922795 EshBiz C Sept. 18, 2023, 5:33 p.m. OK GNU C++20 (64) TESTS 23 31 921600
223912970 Platinumda C Sept. 18, 2023, 4:36 p.m. OK Go TESTS 23 109 16691200
223936673 princeayush04 C Sept. 18, 2023, 7:24 p.m. OK Java 11 TESTS 23 233 2457600
223925275 f20201214 C Sept. 18, 2023, 5:47 p.m. OK Java 11 TESTS 23 234 0
223927275 prajwaldhule36 C Sept. 18, 2023, 6:02 p.m. OK Java 11 TESTS 23 249 0
223918409 princeayush04 C Sept. 18, 2023, 4:48 p.m. OK Java 11 TESTS 23 280 0
223911515 Un_sung C Sept. 18, 2023, 4:33 p.m. OK Java 11 TESTS 23 280 0
223930033 polsage C Sept. 18, 2023, 6:21 p.m. OK Java 11 TESTS 23 280 1331200
223912384 Pranav_Sharda C Sept. 18, 2023, 4:35 p.m. OK Java 11 TESTS 23 405 23859200
223910744 sakshamjain08 C Sept. 18, 2023, 4:31 p.m. OK Java 11 TESTS 23 732 0
223913347 J99 C Sept. 18, 2023, 4:37 p.m. OK Java 11 TESTS 23 826 16076800
223912296 verma.shivam2605 C Sept. 18, 2023, 4:35 p.m. OK Java 11 TESTS 23 842 16486400
223971103 starhao C Sept. 19, 2023, 3:07 a.m. OK Java 17 TESTS 23 233 307200
223970851 starhao C Sept. 19, 2023, 3:02 a.m. OK Java 17 TESTS 23 233 716800
223952156 Utsav82 C Sept. 18, 2023, 8:37 p.m. OK Java 17 TESTS 23 248 512000
223960494 Harwinvanak C Sept. 18, 2023, 11:48 p.m. OK Java 17 TESTS 23 280 614400
223971358 Ligh0x74 C Sept. 19, 2023, 3:11 a.m. OK Java 17 TESTS 23 280 716800
223949575 daksh_02 C Sept. 18, 2023, 8 p.m. OK Java 17 TESTS 23 358 9728000
223926916 TheLastDanceCoder C Sept. 18, 2023, 5:59 p.m. OK Java 17 TESTS 23 374 4812800
223973774 sajid5ts C Sept. 19, 2023, 3:52 a.m. OK Java 17 TESTS 23 498 5939200
223933609 DependOnYourSelfe C Sept. 18, 2023, 6:53 p.m. OK Java 17 TESTS 23 670 1228800
223918979 AyushVardhan C Sept. 18, 2023, 4:49 p.m. OK Java 17 TESTS 23 794 1024000
223911715 vatsal_04 C Sept. 18, 2023, 4:33 p.m. OK Java 8 TESTS 23 217 6656000
223931967 iwarrior062 C Sept. 18, 2023, 6:37 p.m. OK Java 8 TESTS 23 358 10240000
223914501 dedsec2.0 C Sept. 18, 2023, 4:40 p.m. OK Java 8 TESTS 23 358 53657600
223932634 Sumitsingh7 C Sept. 18, 2023, 6:43 p.m. OK Java 8 TESTS 23 514 21504000
223917300 Ravitosh C Sept. 18, 2023, 4:46 p.m. OK MS C++ 2017 TESTS 23 171 1638400
223961224 YMSeah C Sept. 19, 2023, 12:09 a.m. OK PyPy 3 TESTS 23 187 11468800
223924819 Aravind C Sept. 18, 2023, 5:45 p.m. OK PyPy 3 TESTS 23 296 12185600
223916976 raghuramjee C Sept. 18, 2023, 4:46 p.m. OK PyPy 3 TESTS 23 358 12697600
223926122 ZsoldosP C Sept. 18, 2023, 5:53 p.m. OK PyPy 3 TESTS 23 451 12595200
223958742 DRDIV C Sept. 18, 2023, 10:52 p.m. OK PyPy 3 TESTS 23 467 17920000
223933281 Jayg000e C Sept. 18, 2023, 6:49 p.m. OK PyPy 3-64 TESTS 23 156 15155200
223918432 drugkeeper C Sept. 18, 2023, 4:48 p.m. OK PyPy 3-64 TESTS 23 187 20480000
223919099 Amay12 C Sept. 18, 2023, 4:49 p.m. OK PyPy 3-64 TESTS 23 202 32665600
223973518 Mohamed_Hamed C Sept. 19, 2023, 3:48 a.m. OK PyPy 3-64 TESTS 23 233 29184000
223931284 MenaceJn C Sept. 18, 2023, 6:31 p.m. OK PyPy 3-64 TESTS 23 249 22425600
223952632 RobinFromTheHood C Sept. 18, 2023, 8:43 p.m. OK PyPy 3-64 TESTS 23 296 16998400
223937659 the_last_smilodon C Sept. 18, 2023, 7:36 p.m. OK PyPy 3-64 TESTS 23 296 35737600
223912441 peter5264 C Sept. 18, 2023, 4:35 p.m. OK PyPy 3-64 TESTS 23 311 18227200
223970533 MdAbedin C Sept. 19, 2023, 2:56 a.m. OK PyPy 3-64 TESTS 23 327 17408000
223916463 yathin.rasineni08 C Sept. 18, 2023, 4:44 p.m. OK PyPy 3-64 TESTS 23 327 18841600
223935468 neuralsrg C Sept. 18, 2023, 7:11 p.m. OK Python 3 TESTS 23 156 17817600
223959286 Westin_sheep C Sept. 18, 2023, 11:09 p.m. OK Python 3 TESTS 23 249 12390400
223962891 gmbrandt C Sept. 19, 2023, 12:50 a.m. OK Python 3 TESTS 23 265 13209600
223916936 ChihoLam C Sept. 18, 2023, 4:45 p.m. OK Python 3 TESTS 23 295 27648000
223916791 Gau.Sh. C Sept. 18, 2023, 4:45 p.m. OK Python 3 TESTS 23 342 33382400
223915870 tanishq2507 C Sept. 18, 2023, 4:43 p.m. OK Python 3 TESTS 23 358 15769600
223913771 chatur123 C Sept. 18, 2023, 4:38 p.m. OK Python 3 TESTS 23 405 26009600
223916101 average_engineer C Sept. 18, 2023, 4:44 p.m. OK Python 3 TESTS 23 451 23347200
223924970 guntehi C Sept. 18, 2023, 5:46 p.m. OK Python 3 TESTS 23 607 27648000
223911481 sky C Sept. 18, 2023, 4:33 p.m. OK Rust 2021 TESTS 23 31 8294400

remove filters

Back to search problems