Codeforces Round 452 (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
899 Codeforces Round 452 (Div. 2) FINISHED False 7200 218330699 Dec. 17, 2017, 6:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2768 ) D Shovel Sale PROGRAMMING constructive algorithms math 1800

B"There are n shovels in Polycarp's shop. The i-th shovel costs i burles, that is, the first shovel costs 1 burle, the second shovel costs 2 burles, the third shovel costs 3 burles, and so on. Polycarps wants to sell shovels in pairs. Visitors are more likely to buy a pair of shovels if their total cost ends with several 9s. Because of this, Polycarp wants to choose a pair of shovels to sell in such a way that the sum of their costs ends with maximum possible number of nines. For example, if he chooses shovels with costs 12345 and 37454, their total cost is 49799, it ends with two nines. You are to compute the number of pairs of shovels such that their total cost ends with maximum possible number of nines. Two pairs are considered different if there is a shovel presented in one pair, but not in the other. The first line contains a single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the number of shovels in Polycarp's shop. Print the number of pairs of shovels such that their total cost ends with maximum possible number of nines. Note that it is possible that the largest number of 9s at the end is 0, then you should count all such ways. It is guaranteed that for every n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109 the answer doesn't exceed 2 xc2 xb7109. In the first example the maximum possible number of nines at the end is one. Polycarp cah choose the following pairs of shovels for that purpose: In the second example the maximum number of nines at the end of total cost of two shovels is one. The following pairs of shovels suit Polycarp: In the third example it is necessary to choose shovels 49 and 50, because the sum of their cost is 99, that means that the total number of nines is equal to two, which is maximum possible for n xe2 x80 x89= xe2 x80 x8950. "...

Tutorials

Codeforces Round #452 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
33341798 nanae1914 D Dec. 17, 2017, 7:39 a.m. OK D TESTS 106 30 2969600 1800
33363562 tin_ibig D Dec. 17, 2017, 9:01 p.m. OK FPC TESTS 106 15 1638400 1800
33363132 kmc1987g2002 D Dec. 17, 2017, 8:36 p.m. OK FPC TESTS 106 15 1638400 1800
33347444 LeoPro D Dec. 17, 2017, 8:27 a.m. OK FPC TESTS 106 15 1638400 1800
33468798 AsahiKasugano D Dec. 21, 2017, 2:12 a.m. OK FPC TESTS 106 15 1638400 1800
33348253 HsOH D Dec. 17, 2017, 8:32 a.m. OK FPC TESTS 106 30 1638400 1800
48270851 chaorenhaha D Jan. 12, 2019, 1:56 a.m. OK FPC TESTS 106 31 204800 1800
33354115 zz_zigzag D Dec. 17, 2017, 12:56 p.m. OK GNU C TESTS 106 15 1843200 1800
33343296 NoSoul D Dec. 17, 2017, 7:51 a.m. OK GNU C TESTS 106 15 1843200 1800
33370397 shubham_43 D Dec. 18, 2017, 6:45 a.m. OK GNU C TESTS 106 15 1843200 1800
35722206 MYNAMEISSHARIFUL D Feb. 26, 2018, 6:48 a.m. OK GNU C TESTS 106 15 2048000 1800
33348530 codemart786 D Dec. 17, 2017, 8:34 a.m. OK GNU C TESTS 106 30 1843200 1800
35056081 Neymars D Feb. 8, 2018, 11:35 a.m. OK GNU C++ TESTS 106 15 1843200 1800
34791432 vjudge3 D Feb. 1, 2018, 6:15 a.m. OK GNU C++ TESTS 106 15 1843200 1800
34652344 Nietzsche233 D Jan. 29, 2018, 6:34 a.m. OK GNU C++ TESTS 106 15 1843200 1800
33379945 ququuy D Dec. 18, 2017, 12:59 p.m. OK GNU C++ TESTS 106 15 1843200 1800
33377841 Fedya001 D Dec. 18, 2017, 11:59 a.m. OK GNU C++ TESTS 106 15 1843200 1800
33371915 adoubiq D Dec. 18, 2017, 7:58 a.m. OK GNU C++ TESTS 106 15 1843200 1800
33366092 ghostfly233 D Dec. 18, 2017, 1:13 a.m. OK GNU C++ TESTS 106 15 1843200 1800
33365651 Stump D Dec. 18, 2017, 12:21 a.m. OK GNU C++ TESTS 106 15 1843200 1800
33354312 david7ch D Dec. 17, 2017, 1:03 p.m. OK GNU C++ TESTS 106 15 1843200 1800
33345878 lyh D Dec. 17, 2017, 8:14 a.m. OK GNU C++ TESTS 106 15 1843200 1800
33410407 Smurf1 D Dec. 19, 2017, 2:03 p.m. OK GNU C11 TESTS 106 31 2048000 1800
34403934 jqs D Jan. 21, 2018, 7:13 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
34598125 Godiswithme D Jan. 27, 2018, 7:43 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
34401430 mochavic D Jan. 21, 2018, 5:40 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
34295459 fange121 D Jan. 19, 2018, 7:40 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
34097338 nibylev D Jan. 11, 2018, 10:20 p.m. OK GNU C++11 TESTS 106 15 1843200 1800
33666450 bogdi D Dec. 27, 2017, 10:38 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
33469041 ST_Lighter D Dec. 21, 2017, 2:43 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
33460544 emofunc D Dec. 20, 2017, 4 p.m. OK GNU C++11 TESTS 106 15 1843200 1800
33376946 nzpznk D Dec. 18, 2017, 11:31 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
33376068 sad_club_piece D Dec. 18, 2017, 11 a.m. OK GNU C++11 TESTS 106 15 1843200 1800
38578121 abhardwaj1998 D May 24, 2018, 6:20 a.m. OK GNU C++14 TESTS 106 15 0 1800
34960558 xuziling D Feb. 6, 2018, 4:09 a.m. OK GNU C++14 TESTS 106 15 1843200 1800
34942190 PengsenMao D Feb. 5, 2018, 11:30 a.m. OK GNU C++14 TESTS 106 15 1843200 1800
34799307 ufoetet D Feb. 1, 2018, 10:55 a.m. OK GNU C++14 TESTS 106 15 1843200 1800
34778497 Varun D Jan. 31, 2018, 6:51 p.m. OK GNU C++14 TESTS 106 15 1843200 1800
34711320 kicksilver7 D Jan. 30, 2018, 2:02 p.m. OK GNU C++14 TESTS 106 15 1843200 1800
34485030 zxnm19980609 D Jan. 23, 2018, 2:18 p.m. OK GNU C++14 TESTS 106 15 1843200 1800
34400578 Jian_Ron D Jan. 21, 2018, 4:47 a.m. OK GNU C++14 TESTS 106 15 1843200 1800
35141235 Max.D. D Feb. 11, 2018, 2:51 a.m. OK GNU C++14 TESTS 106 15 1843200 1800
35511648 ez_zkj D Feb. 20, 2018, 5:03 a.m. OK GNU C++14 TESTS 106 15 1843200 1800
35784710 Hexan D Feb. 28, 2018, 12:45 p.m. OK GNU C++17 TESTS 106 15 1945600 1800
59602681 Nickir D Aug. 28, 2019, 7:08 a.m. OK GNU C++17 TESTS 106 30 0 1800
39247253 Obada-AlAbbadi D June 14, 2018, 2:41 p.m. OK GNU C++17 TESTS 106 30 0 1800
38586927 rahul_iit D May 24, 2018, 12:50 p.m. OK GNU C++17 TESTS 106 30 0 1800
69804447 haengsyo D Jan. 30, 2020, 12:47 a.m. OK GNU C++17 TESTS 106 31 0 1800
69910584 Pippinpaddleopsicopolis D Jan. 31, 2020, 3:15 p.m. OK GNU C++17 TESTS 106 31 0 1800
69051738 Muskmelon_seed D Jan. 18, 2020, 12:59 p.m. OK GNU C++17 TESTS 106 31 0 1800
67982700 _GreatArthur_ D Dec. 30, 2019, 8:13 p.m. OK GNU C++17 TESTS 106 31 0 1800
67869521 Adamenko D Dec. 29, 2019, 10:55 a.m. OK GNU C++17 TESTS 106 31 0 1800
67860392 Dmitry_Borchuk D Dec. 29, 2019, 7:57 a.m. OK GNU C++17 TESTS 106 31 0 1800
33479147 mas3399 D Dec. 21, 2017, 12:14 p.m. OK GNU C++17 Diagnostics TESTS 106 811 100966400 1800
33479036 mas3399 D Dec. 21, 2017, 12:10 p.m. OK GNU C++17 Diagnostics TESTS 106 842 101171200 1800
33347791 djqs_-1e31th_girlfriend D Dec. 17, 2017, 8:29 a.m. OK GNU C++17 Diagnostics TESTS 106 842 101273600 1800
33478956 mas3399 D Dec. 21, 2017, 12:07 p.m. OK GNU C++17 Diagnostics TESTS 106 888 101171200 1800
33372605 filo D Dec. 18, 2017, 8:31 a.m. OK Go TESTS 106 15 23040000 1800
33352805 1406100039 D Dec. 17, 2017, 12:08 p.m. OK Go TESTS 106 30 23040000 1800
33379343 mipt.vi002 D Dec. 18, 2017, 12:44 p.m. OK Haskell TESTS 106 31 53248000 1800
33360925 mbrc D Dec. 17, 2017, 6:51 p.m. OK Haskell TESTS 106 46 53248000 1800
64729633 yaoct D Nov. 12, 2019, 7:53 a.m. OK Java 8 TESTS 106 109 0 1800
55271511 Vishal_dhanani D June 7, 2019, 4:37 p.m. OK Java 8 TESTS 106 109 0 1800
33440003 prashanth_rebala D Dec. 19, 2017, 9:05 p.m. OK Java 8 TESTS 106 109 20684800 1800
64727343 yaoct D Nov. 12, 2019, 6:59 a.m. OK Java 8 TESTS 106 124 0 1800
52565860 wadissimo D April 10, 2019, 12:23 p.m. OK Java 8 TESTS 106 124 0 1800
46727847 KulikAlex D Dec. 7, 2018, 3:54 p.m. OK Java 8 TESTS 106 124 0 1800
33525966 garnacha D Dec. 23, 2017, 5:34 a.m. OK Java 8 TESTS 106 124 20582400 1800
34204428 iamavalon D Jan. 15, 2018, 6:21 p.m. OK Java 8 TESTS 106 124 20684800 1800
35608487 AkshajK D Feb. 23, 2018, 7:49 p.m. OK Java 8 TESTS 106 124 20684800 1800
34699736 Devil. D Jan. 30, 2018, 6:35 a.m. OK Java 8 TESTS 106 124 20684800 1800
33385078 Hapsidra D Dec. 18, 2017, 4:07 p.m. OK JavaScript TESTS 106 31 5939200 1800
33343044 darkkcyan D Dec. 17, 2017, 7:49 a.m. OK Kotlin TESTS 106 124 20684800 1800
33344403 SlavaG D Dec. 17, 2017, 8:01 a.m. OK Kotlin TESTS 106 140 20684800 1800
33362631 SlavaG D Dec. 17, 2017, 8:06 p.m. OK Kotlin TESTS 106 140 21094400 1800
33341239 kuuso D Dec. 17, 2017, 7:34 a.m. OK Mono C# TESTS 106 46 9318400 1800
33363503 den.egorychev D Dec. 17, 2017, 8:58 p.m. OK MS C# TESTS 106 46 9318400 1800
33343986 haitao D Dec. 17, 2017, 7:57 a.m. OK MS C# TESTS 106 46 9318400 1800
33357197 artsin666 D Dec. 17, 2017, 3:36 p.m. OK MS C# TESTS 106 62 9318400 1800
33354486 heavenhunter D Dec. 17, 2017, 1:10 p.m. OK MS C# TESTS 106 62 11776000 1800
33343868 viia D Dec. 17, 2017, 7:56 a.m. OK MS C++ TESTS 106 15 2048000 1800
33382209 mshcherba D Dec. 18, 2017, 2:15 p.m. OK MS C++ TESTS 106 15 2048000 1800
33342227 Feigenbaum D Dec. 17, 2017, 7:42 a.m. OK MS C++ TESTS 106 15 2048000 1800
33343994 Maffka D Dec. 17, 2017, 7:57 a.m. OK MS C++ TESTS 106 15 2048000 1800
33376803 zhh D Dec. 18, 2017, 11:27 a.m. OK MS C++ TESTS 106 15 2150400 1800
36228308 RCG D March 12, 2018, 3:19 p.m. OK MS C++ TESTS 106 15 2150400 1800
33407053 tyf0530 D Dec. 19, 2017, 12:02 p.m. OK MS C++ TESTS 106 15 2150400 1800
34041120 pfh.hbq D Jan. 9, 2018, 5:41 a.m. OK MS C++ TESTS 106 30 2048000 1800
65851164 vjudge3 D Nov. 27, 2019, 2:48 p.m. OK MS C++ TESTS 106 31 0 1800
58609859 vjudge3 D Aug. 11, 2019, 2:03 p.m. OK MS C++ TESTS 106 31 0 1800
65614243 VagrantAC D Nov. 24, 2019, 2:14 a.m. OK MS C++ 2017 TESTS 106 31 0 1800
33487239 Darooha D Dec. 21, 2017, 5:36 p.m. OK Ocaml TESTS 106 15 3891200 1800
33347970 l-_-l D Dec. 17, 2017, 8:31 a.m. OK PascalABC.NET TESTS 106 46 13209600 1800
33996487 masonsbro D Jan. 8, 2018, 3:42 a.m. OK PyPy 2 TESTS 106 62 21401600 1800
43715038 apoorv1999 D Oct. 3, 2018, 6:45 a.m. OK PyPy 2 TESTS 106 140 0 1800
43714893 apoorv1999 D Oct. 3, 2018, 6:40 a.m. OK PyPy 2 TESTS 106 140 0 1800
33441560 pajenegod D Dec. 19, 2017, 11:15 p.m. OK PyPy 3 TESTS 106 109 23142400 1800
33396280 electroforce D Dec. 19, 2017, 3:31 a.m. OK PyPy 3 TESTS 106 109 23142400 1800
33351595 Artem3213212 D Dec. 17, 2017, 11:28 a.m. OK PyPy 3 TESTS 106 124 23142400 1800
58411012 mola.mola D Aug. 7, 2019, 1:39 a.m. OK PyPy 3 TESTS 106 140 0 1800
34801822 DragoonXi D Feb. 1, 2018, 12:18 p.m. OK Python 2 TESTS 106 62 4608000 1800
33379400 thegamer1907 D Dec. 18, 2017, 12:46 p.m. OK Python 2 TESTS 106 62 4608000 1800
33372085 Sor4ii D Dec. 18, 2017, 8:07 a.m. OK Python 2 TESTS 106 62 4608000 1800
33365650 sccs D Dec. 18, 2017, 12:20 a.m. OK Python 2 TESTS 106 62 4608000 1800
33345218 fourteenflames D Dec. 17, 2017, 8:08 a.m. OK Python 2 TESTS 106 62 4608000 1800
33345039 adipt D Dec. 17, 2017, 8:06 a.m. OK Python 2 TESTS 106 62 4608000 1800
33343678 RNR D Dec. 17, 2017, 7:54 a.m. OK Python 2 TESTS 106 62 4608000 1800
33337430 nwi D Dec. 17, 2017, 7:07 a.m. OK Python 2 TESTS 106 62 4608000 1800
33344522 the_nightmare D Dec. 17, 2017, 8:02 a.m. OK Python 2 TESTS 106 77 4608000 1800
33525314 Butane D Dec. 23, 2017, 5:04 a.m. OK Python 2 TESTS 106 93 4608000 1800
33444395 mtarunsai1999 D Dec. 20, 2017, 4:03 a.m. OK Python 3 TESTS 106 62 5529600 1800
33441357 algmyr D Dec. 19, 2017, 10:51 p.m. OK Python 3 TESTS 106 62 5529600 1800
33441339 algmyr D Dec. 19, 2017, 10:49 p.m. OK Python 3 TESTS 106 62 5529600 1800
33389173 surokpro D Dec. 18, 2017, 6:17 p.m. OK Python 3 TESTS 106 62 5529600 1800
33378090 Faster D Dec. 18, 2017, 12:07 p.m. OK Python 3 TESTS 106 62 5529600 1800
33375698 s_p D Dec. 18, 2017, 10:47 a.m. OK Python 3 TESTS 106 62 5529600 1800
33374558 Jiburiru D Dec. 18, 2017, 9:58 a.m. OK Python 3 TESTS 106 62 5529600 1800
33374320 Jiburiru D Dec. 18, 2017, 9:45 a.m. OK Python 3 TESTS 106 62 5529600 1800
33367928 JustAni D Dec. 18, 2017, 4:16 a.m. OK Python 3 TESTS 106 62 5529600 1800
33354023 thetest D Dec. 17, 2017, 12:53 p.m. OK Python 3 TESTS 106 62 5529600 1800
33345823 hatoo D Dec. 17, 2017, 8:14 a.m. OK Rust TESTS 106 15 1433600 1800
33340311 Hillmouse D Dec. 17, 2017, 7:27 a.m. OK Rust TESTS 106 15 1433600 1800

remove filters

Back to search problems