Codeforces Round 480 (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
980 Codeforces Round 480 (Div. 2) FINISHED False 7200 211733723 May 8, 2018, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3809 ) C Posterized PROGRAMMING games greedy 1700

B'Professor Ibrahim has prepared the final homework for his algorithm xe2 x80 x99s class. He asked his students to implement the Posterization Image Filter. Their algorithm will be tested on an array of integers, where the i -th integer represents the color of the i -th pixel in the image. The image is in black and white, therefore the color of each pixel will be an integer between 0 and 255 (inclusive). To implement the filter, students are required to divide the black and white color range [0, 255] into groups of consecutive colors, and select one color in each group to be the group xe2 x80 x99s key. In order to preserve image details, the size of a group must not be greater than k , and each color should belong to exactly one group. Finally, the students will replace the color of each pixel in the array with that color xe2 x80 x99s assigned group key. To better understand the effect, here is an image of a basking turtle where the Posterization Filter was applied with increasing k to the right. To make the process of checking the final answer easier, Professor Ibrahim wants students to divide the groups and assign the keys in a way that produces the lexicographically smallest possible array. The first line of input contains two integers n and k ( 1 <= q n <= q 10^5 , 1 <= q k <= q 256 ), the number of pixels in the image, and the maximum size of a group, respectively. The second line contains n integers p_1, p_2, ... , p_n ( 0 <= q p_i <= q 255 ), where p_i is the color of the i -th pixel. Print n space-separated integers; the lexicographically smallest possible array that represents the image after applying the Posterization filter. One possible way to group colors and assign keys for the first sample: Color 2 belongs to the group [0,2] , with group key 0 . Color 14 belongs to the group [12,14] , with group key 12 . Colors 3 and 4 belong to group [3, 5] , wi'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
38392063 admire.japan C May 18, 2018, 6:57 a.m. OK D TESTS 82 46 4505600 1700
38035251 fluffyowl C May 8, 2018, 3:46 p.m. OK D TESTS 82 62 8601600 1700
38043330 ia7ck C May 8, 2018, 4:30 p.m. OK D TESTS 82 77 8601600 1700
38048559 arukuka C May 8, 2018, 5:01 p.m. OK D TESTS 82 78 8601600 1700
38076374 ruban C May 9, 2018, 3:53 p.m. OK Delphi TESTS 82 77 36044800 1700
38133432 AHTOH._. C May 12, 2018, 9:01 a.m. OK FPC TESTS 82 218 3072000 1700
38052928 forlfs C May 8, 2018, 7:11 p.m. OK GNU C TESTS 82 46 3686400 1700
38063722 UP_ENDER C May 9, 2018, 7:18 a.m. OK GNU C TESTS 82 61 3379200 1700
38083721 ambitionly C May 10, 2018, 3:02 a.m. OK GNU C TESTS 82 61 3686400 1700
38985412 C1ariS C June 6, 2018, 6:34 a.m. OK GNU C TESTS 82 62 1228800 1700
38090507 TsReaper C May 10, 2018, 11:45 a.m. OK GNU C TESTS 82 62 3379200 1700
38189880 Jatboy C May 13, 2018, 12:17 p.m. OK GNU C TESTS 82 62 3686400 1700
38047626 tjsdn35 C May 8, 2018, 4:56 p.m. OK GNU C TESTS 82 62 4096000 1700
40932188 ReaLNero1 C July 30, 2018, 1:38 a.m. OK GNU C++ TESTS 82 31 2252800 1700
38103479 Scut82 C May 11, 2018, 1:30 a.m. OK GNU C++ TESTS 82 31 3481600 1700
39814385 Sooke C July 1, 2018, 7:13 a.m. OK GNU C++ TESTS 82 46 0 1700
39814428 Sooke C July 1, 2018, 7:15 a.m. OK GNU C++ TESTS 82 46 0 1700
39210105 primy C June 13, 2018, 8:20 a.m. OK GNU C++ TESTS 82 46 0 1700
38578366 e_e C May 24, 2018, 6:36 a.m. OK GNU C++ TESTS 82 46 0 1700
40689539 vjudge3 C July 24, 2018, 5:02 a.m. OK GNU C++ TESTS 82 46 204800 1700
38448369 vjudge5 C May 20, 2018, 5:43 a.m. OK GNU C++ TESTS 82 46 409600 1700
38447070 vjudge2 C May 20, 2018, 4:32 a.m. OK GNU C++ TESTS 82 46 409600 1700
38449373 vjudge2 C May 20, 2018, 6:27 a.m. OK GNU C++ TESTS 82 46 1024000 1700
58966423 STNR C Aug. 17, 2019, 6 p.m. OK GNU C11 TESTS 82 373 0 1700
38648294 xiao-xiao C May 27, 2018, 6:04 a.m. OK GNU C11 TESTS 82 436 0 1700
38048195 sansen C May 8, 2018, 4:59 p.m. OK GNU C11 TESTS 82 467 3788800 1700
38043396 LittleFall C May 8, 2018, 4:30 p.m. OK GNU C++11 TESTS 82 31 3891200 1700
38389203 ILoveU3000 C May 18, 2018, 4:57 a.m. OK GNU C++11 TESTS 82 46 0 1700
39047619 WYWDMX C June 8, 2018, 1:39 p.m. OK GNU C++11 TESTS 82 46 0 1700
38718384 251 C May 29, 2018, 12:28 p.m. OK GNU C++11 TESTS 82 46 0 1700
48719355 wolfdan666 C Jan. 22, 2019, 12:50 p.m. OK GNU C++11 TESTS 82 46 0 1700
40477244 Rebirth_A C July 17, 2018, 12:28 p.m. OK GNU C++11 TESTS 82 46 204800 1700
38430501 Staring suzie_lin Samidare C May 19, 2018, 12:23 p.m. OK GNU C++11 TESTS 82 46 204800 1700
49031795 FetalBagel C Jan. 26, 2019, 11:07 p.m. OK GNU C++11 TESTS 82 46 409600 1700
60825539 Anoyer C Sept. 19, 2019, 3:42 a.m. OK GNU C++11 TESTS 82 46 409600 1700
46265458 codefield C Nov. 27, 2018, 2:01 a.m. OK GNU C++11 TESTS 82 46 409600 1700
49030579 wleung_bvg C Jan. 26, 2019, 9:51 p.m. OK GNU C++14 TESTS 82 31 409600 1700
38035104 lionadis C May 8, 2018, 3:46 p.m. OK GNU C++14 TESTS 82 31 3891200 1700
56432957 Klight1994 C July 2, 2019, 12:52 p.m. OK GNU C++14 TESTS 82 46 0 1700
39328087 thebihari C June 17, 2018, 7:33 a.m. OK GNU C++14 TESTS 82 46 409600 1700
39088336 Error_404 C June 10, 2018, 9:35 a.m. OK GNU C++14 TESTS 82 46 409600 1700
51161159 cs71107 C March 11, 2019, 12:27 p.m. OK GNU C++14 TESTS 82 46 512000 1700
38683523 tieuchanlong C May 28, 2018, 3:22 a.m. OK GNU C++14 TESTS 82 46 1024000 1700
38038921 Linkus C May 8, 2018, 4:05 p.m. OK GNU C++14 TESTS 82 46 3379200 1700
38257195 sahilnikum C May 15, 2018, 5:30 a.m. OK GNU C++14 TESTS 82 46 3481600 1700
38034846 osamahatem C May 8, 2018, 3:44 p.m. OK GNU C++14 TESTS 82 46 3481600 1700
38354339 Dpbest C May 17, 2018, 3:47 p.m. OK GNU C++17 TESTS 82 46 409600 1700
46772648 Saurabh303 C Dec. 8, 2018, 5:55 p.m. OK GNU C++17 TESTS 82 46 409600 1700
38062277 Amovement C May 9, 2018, 6:10 a.m. OK GNU C++17 TESTS 82 46 3379200 1700
38057223 razouq C May 9, 2018, 12:28 a.m. OK GNU C++17 TESTS 82 46 3788800 1700
38335941 yeguanghao C May 17, 2018, 1:56 a.m. OK GNU C++17 TESTS 82 46 3788800 1700
38082899 BNUZ-ACM C May 10, 2018, 1:28 a.m. OK GNU C++17 TESTS 82 46 3788800 1700
38071401 whquddn55 C May 9, 2018, 12:41 p.m. OK GNU C++17 TESTS 82 46 3788800 1700
38043347 Nuu C May 8, 2018, 4:30 p.m. OK GNU C++17 TESTS 82 46 3788800 1700
38038392 Bobrosoft C May 8, 2018, 4:02 p.m. OK GNU C++17 TESTS 82 46 3788800 1700
38038335 huangzhen C May 8, 2018, 4:01 p.m. OK GNU C++17 TESTS 82 46 3788800 1700
38074960 Lost_dog C May 9, 2018, 2:50 p.m. OK Haskell TESTS 82 46 56524800 1700
38043970 haskellscott_wu C May 8, 2018, 4:34 p.m. OK Haskell TESTS 82 405 62873600 1700
48388316 vjudge2 C Jan. 14, 2019, 2:05 p.m. OK Java 8 TESTS 82 140 0 1700
47544488 kusomushi C Dec. 27, 2018, 9:11 a.m. OK Java 8 TESTS 82 140 0 1700
46546386 wadissimo C Dec. 3, 2018, 3 p.m. OK Java 8 TESTS 82 140 0 1700
66613854 Agnimandur C Dec. 11, 2019, 1:28 a.m. OK Java 8 TESTS 82 155 0 1700
52761366 ashcodish C April 14, 2019, 9:04 p.m. OK Java 8 TESTS 82 155 0 1700
38082357 Ahmed_Diab C May 10, 2018, 12:14 a.m. OK Java 8 TESTS 82 155 20787200 1700
38063509 thesparkboy C May 9, 2018, 7:08 a.m. OK Java 8 TESTS 82 155 20787200 1700
66206297 ijxjdjd C Dec. 3, 2019, 3:17 a.m. OK Java 8 TESTS 82 156 0 1700
54795997 gaidash C May 29, 2019, 9:38 a.m. OK Java 8 TESTS 82 156 0 1700
42799124 wery0 C Sept. 12, 2018, 1:20 p.m. OK Java 8 TESTS 82 156 0 1700
38067850 Isfandiyor C May 9, 2018, 10:32 a.m. OK JavaScript TESTS 82 93 18329600 1700
38537352 0442A403 C May 22, 2018, 1:43 p.m. OK Kotlin TESTS 82 467 0 1700
38140671 dinnot C May 12, 2018, 2:09 p.m. OK Mono C# TESTS 82 78 20172800 1700
38207431 fr0st C May 14, 2018, 6:42 a.m. OK Mono C# TESTS 82 78 22630400 1700
58440971 og.kostya C Aug. 7, 2019, 3:03 p.m. OK Mono C# TESTS 82 93 2355200 1700
38048441 keymoon C May 8, 2018, 5 p.m. OK Mono C# TESTS 82 93 20070400 1700
38056437 wleung_bvg C May 8, 2018, 10:57 p.m. OK Mono C# TESTS 82 93 222617600 1700
38040768 riantkb C May 8, 2018, 4:15 p.m. OK Mono C# TESTS 82 109 20070400 1700
38042986 vivek17geek C May 8, 2018, 4:28 p.m. OK Mono C# TESTS 82 109 20377600 1700
38044961 SleipnirF C May 8, 2018, 4:39 p.m. OK Mono C# TESTS 82 312 22220800 1700
39464067 Kovler C June 21, 2018, 1:51 p.m. OK MS C++ TESTS 82 61 819200 1700
38062252 vjudge2 C May 9, 2018, 6:09 a.m. OK MS C++ TESTS 82 61 3481600 1700
38206420 vjudge4 C May 14, 2018, 5:39 a.m. OK MS C++ TESTS 82 61 3891200 1700
38057676 Loesen C May 9, 2018, 1:14 a.m. OK MS C++ TESTS 82 61 4403200 1700
38208360 yp0416160202 C May 14, 2018, 7:43 a.m. OK MS C++ TESTS 82 61 4505600 1700
45953336 EatingMelonPublic C Nov. 19, 2018, 7:47 a.m. OK MS C++ TESTS 82 62 0 1700
45953152 EatingMelonPublic C Nov. 19, 2018, 7:41 a.m. OK MS C++ TESTS 82 62 0 1700
40685695 vjudge3 C July 24, 2018, 1:56 a.m. OK MS C++ TESTS 82 62 409600 1700
38449957 vjudge2 C May 20, 2018, 6:49 a.m. OK MS C++ TESTS 82 62 409600 1700
38074011 vjudge1 C May 9, 2018, 2:10 p.m. OK MS C++ TESTS 82 62 3481600 1700
56432876 youx C July 2, 2019, 12:50 p.m. OK MS C++ 2017 TESTS 82 62 1331200 1700
63101788 YHHxBULIATANIA C Oct. 22, 2019, 1:16 a.m. OK MS C++ 2017 TESTS 82 78 409600 1700
57759926 Still_Theory C July 25, 2019, 5:36 p.m. OK MS C++ 2017 TESTS 82 140 819200 1700
54250268 chetanag35 C May 16, 2019, 4:52 p.m. OK MS C++ 2017 TESTS 82 140 3993600 1700
38053592 X_Bot C May 8, 2018, 7:37 p.m. OK PascalABC.NET TESTS 82 529 15564800 1700
39523348 mayakin C June 22, 2018, 5:17 p.m. OK PHP TESTS 82 62 7987200 1700
38091465 2011aad C May 10, 2018, 1 p.m. OK PHP TESTS 82 93 15974400 1700
38083258 Ehzyo C May 10, 2018, 2:14 a.m. OK PyPy 2 TESTS 82 140 31334400 1700
48566460 vjudge3 C Jan. 19, 2019, 9:49 a.m. OK PyPy 2 TESTS 82 155 6963200 1700
49030039 aeternalis1 C Jan. 26, 2019, 9:26 p.m. OK PyPy 2 TESTS 82 155 8601600 1700
38053528 yan4ik C May 8, 2018, 7:34 p.m. OK PyPy 3 TESTS 82 202 32870400 1700
38142314 Teferi C May 12, 2018, 3:20 p.m. OK PyPy 3 TESTS 82 217 33075200 1700
38037606 Teferi C May 8, 2018, 3:58 p.m. OK PyPy 3 TESTS 82 218 37478400 1700
38040488 pedrofreire C May 8, 2018, 4:13 p.m. OK PyPy 3 TESTS 82 280 32153600 1700
58528589 xuzhengqi C Aug. 10, 2019, 8:23 a.m. OK PyPy 3 TESTS 82 529 12902400 1700
38121930 aki167yuuki C May 11, 2018, 7:01 p.m. OK PyPy 3 TESTS 82 841 32665600 1700
38035125 nwi C May 8, 2018, 3:46 p.m. OK Python 2 TESTS 82 171 10342400 1700
38199292 WyattWismer C May 13, 2018, 6:54 p.m. OK Python 2 TESTS 82 187 10342400 1700
38041869 jakab922 C May 8, 2018, 4:21 p.m. OK Python 2 TESTS 82 187 10547200 1700
38616474 snusmumrik C May 25, 2018, 6:56 p.m. OK Python 2 TESTS 82 202 4403200 1700
38140174 fromexptolog C May 12, 2018, 1:48 p.m. OK Python 2 TESTS 82 218 10752000 1700
38045562 durgesha C May 8, 2018, 4:43 p.m. OK Python 2 TESTS 82 233 10137600 1700
38203831 eightants C May 14, 2018, 2:15 a.m. OK Python 2 TESTS 82 234 10137600 1700
38202763 WNG C May 14, 2018, 12:06 a.m. OK Python 2 TESTS 82 264 10649600 1700
49032363 Zeyu C Jan. 26, 2019, 11:53 p.m. OK Python 2 TESTS 82 265 4608000 1700
38056765 hatienl0i261299 C May 8, 2018, 11:41 p.m. OK Python 3 TESTS 82 155 12492800 1700
38057854 nguyenqh C May 9, 2018, 1:30 a.m. OK Python 3 TESTS 82 156 13004800 1700
38042137 pyrus C May 8, 2018, 4:23 p.m. OK Python 3 TESTS 82 171 12390400 1700
38044069 MichelJ C May 8, 2018, 4:34 p.m. OK Python 3 TESTS 82 171 13004800 1700
38072825 nowyyz C May 9, 2018, 1:30 p.m. OK Python 3 TESTS 82 186 12390400 1700
38051239 sw_enthusiast C May 8, 2018, 6:26 p.m. OK Python 3 TESTS 82 187 12595200 1700
38050883 denny_sem C May 8, 2018, 6:20 p.m. OK Python 3 TESTS 82 187 13004800 1700
38036027 CrazyMerlyn C May 8, 2018, 3:50 p.m. OK Python 3 TESTS 82 187 13004800 1700
38061560 joe_joe C May 9, 2018, 5:34 a.m. OK Python 3 TESTS 82 202 12800000 1700
38057199 hAtchiko C May 9, 2018, 12:26 a.m. OK Python 3 TESTS 82 202 13004800 1700
38048756 Hillmouse C May 8, 2018, 5:02 p.m. OK Rust TESTS 82 46 5222400 1700
38053867 Leonardone C May 8, 2018, 7:49 p.m. OK Rust TESTS 82 108 4505600 1700
38104906 cylixstar C May 11, 2018, 4:04 a.m. OK Scala TESTS 82 654 44339200 1700

remove filters

Back to search problems