Codeforces Round 496 (Div. 3)

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
1005 Codeforces Round 496 (Div. 3) FINISHED False 7200 200672699 July 9, 2018, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10223 ) D Polycarp and Div 3 PROGRAMMING dp greedy number theory 1500

B"Polycarp likes numbers that are divisible by 3. He has a huge number s . Polycarp wants to cut from it the maximum number of numbers that are divisible by 3 . To do this, he makes an arbitrary number of vertical cuts between pairs of adjacent digits. As a result, after m such cuts, there will be m+1 parts in total. Polycarp analyzes each of the obtained numbers and finds the number of those that are divisible by 3 . For example, if the original number is s=3121 , then Polycarp can cut it into three parts with two cuts: 3|1|21 . As a result, he will get two numbers that are divisible by 3 . Polycarp can make an arbitrary number of vertical cuts, where each cut is made between a pair of adjacent digits. The resulting numbers cannot contain extra leading zeroes (that is, the number can begin with 0 if and only if this number is exactly one character '0'). For example, 007, 01 and 00099 are not valid numbers, but 90, 0 and 10001 are valid. What is the maximum number of numbers divisible by 3 that Polycarp can obtain? The first line of the input contains a positive integer s . The number of digits of the number s is between 1 and 2 cdot10^5 , inclusive. The first (leftmost) digit is not equal to 0. Print the maximum number of numbers divisible by 3 that Polycarp can get by making vertical cuts in the given number s . In the first example, an example set of optimal cuts on the number is 3|1|21. In the second example, you do not need to make any cuts. The specified number 6 forms one number that is divisible by 3 . In the third example, cuts must be made between each pair of digits. As a result, Polycarp gets one digit 1 and 33 digits 0. Each of the 33 digits 0 forms a number that is divisible by 3 . In the fourth example, an example set of optimal cuts is 2|0|1|9|201|81. The numbers 0 , 9 , 201 and 81 are divisible by 3 . "...

Tutorials

Codeforces Round 496 (Div. 3): Problem Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
59061869 vjudge3 D Aug. 18, 2019, 10:29 p.m. OK Clang++17 Diagnostics TESTS 25 139 15974400 1500
59061963 vjudge4 D Aug. 18, 2019, 10:35 p.m. OK Clang++17 Diagnostics TESTS 25 171 15872000 1500
45947297 Aschente D Nov. 19, 2018, 2:11 a.m. OK FPC TESTS 25 30 1331200 1500
47819260 HVP.exe D Jan. 1, 2019, 4:33 p.m. OK FPC TESTS 25 31 1331200 1500
45494592 Morkovich D Nov. 9, 2018, 10:12 p.m. OK FPC TESTS 25 31 1331200 1500
54272694 chaorenhaha D May 17, 2019, 9:33 a.m. OK FPC TESTS 25 31 2150400 1500
47842800 NewbieMisis D Jan. 2, 2019, 1:04 p.m. OK FPC TESTS 25 77 60620800 1500
40240090 tanass D July 12, 2018, 5:55 p.m. OK GNU C TESTS 25 31 204800 1500
40229183 karam123 D July 12, 2018, 10:54 a.m. OK GNU C TESTS 25 31 204800 1500
40185845 PCWqt D July 11, 2018, 1:31 a.m. OK GNU C TESTS 25 31 204800 1500
40170208 david369 D July 10, 2018, 12:04 p.m. OK GNU C++ TESTS 25 15 204800 1500
40374140 n1u D July 15, 2018, 9:52 a.m. OK GNU C++ TESTS 25 15 1331200 1500
41558660 jangjie D Aug. 13, 2018, 12:56 p.m. OK GNU C++ TESTS 25 15 1638400 1500
41113234 vjudge5 D Aug. 2, 2018, 7:47 a.m. OK GNU C++ TESTS 25 15 2355200 1500
40864383 treeofapple D July 28, 2018, 1:59 a.m. OK GNU C++ TESTS 25 15 2457600 1500
40542262 vjudge5 D July 19, 2018, 9:20 a.m. OK GNU C++ TESTS 25 30 0 1500
40186794 lihao11 D July 11, 2018, 2:25 a.m. OK GNU C++ TESTS 25 30 0 1500
41468943 vjudge5 D Aug. 11, 2018, 12:31 p.m. OK GNU C++ TESTS 25 30 204800 1500
41345286 sayo_szzx D Aug. 8, 2018, 2:19 p.m. OK GNU C++ TESTS 25 30 204800 1500
40968250 vjudge4 D July 30, 2018, 12:13 p.m. OK GNU C++ TESTS 25 30 204800 1500
62831415 soumik33 D Oct. 17, 2019, 8 p.m. OK GNU C11 TESTS 25 30 204800 1500
40228630 psp.643a D July 12, 2018, 10:33 a.m. OK GNU C11 TESTS 25 31 204800 1500
57294951 You_Know_Who D July 18, 2019, 6:43 p.m. OK GNU C11 TESTS 25 31 204800 1500
68628185 vjudge2 D Jan. 12, 2020, 12:30 a.m. OK GNU C11 TESTS 25 31 204800 1500
50780343 vjudge2 D March 4, 2019, 11:03 a.m. OK GNU C11 TESTS 25 31 204800 1500
56963188 SagarCC D July 13, 2019, 7:24 a.m. OK GNU C11 TESTS 25 31 204800 1500
57294978 vjudge3 D July 18, 2019, 6:43 p.m. OK GNU C11 TESTS 25 46 204800 1500
50564746 SsSsoOoOoOo D Feb. 27, 2019, 12:40 p.m. OK GNU C++11 TESTS 25 15 512000 1500
40244189 ArianB D July 12, 2018, 9:55 p.m. OK GNU C++11 TESTS 25 15 512000 1500
61107072 luogu_bot3 D Sept. 23, 2019, 9:39 a.m. OK GNU C++11 TESTS 25 15 819200 1500
42291421 greedyman D Aug. 30, 2018, 9:08 p.m. OK GNU C++11 TESTS 25 15 1843200 1500
42325585 MiohitoKiri5474 D Sept. 1, 2018, 4:53 a.m. OK GNU C++11 TESTS 25 15 2457600 1500
40904367 vjudge5 D July 29, 2018, 4:06 a.m. OK GNU C++11 TESTS 25 30 0 1500
55337218 Max__n. D June 9, 2019, 2:36 p.m. OK GNU C++11 TESTS 25 30 204800 1500
40905465 Twenty_Fifteen D July 29, 2018, 5:12 a.m. OK GNU C++11 TESTS 25 30 204800 1500
40727016 ZED.LL D July 25, 2018, 5:36 a.m. OK GNU C++11 TESTS 25 30 204800 1500
50712659 vjudge1 D March 3, 2019, 7:14 a.m. OK GNU C++11 TESTS 25 30 204800 1500
40258330 icebound_ D July 13, 2018, 10:38 a.m. OK GNU C++14 TESTS 25 15 204800 1500
57614760 vjudge4 D July 24, 2019, 12:37 a.m. OK GNU C++14 TESTS 25 15 204800 1500
68584105 _HonEy D Jan. 11, 2020, 10:49 a.m. OK GNU C++14 TESTS 25 15 204800 1500
58102130 rennanrocha D Aug. 1, 2019, 1:47 a.m. OK GNU C++14 TESTS 25 15 512000 1500
66626362 al_Jahy D Dec. 11, 2019, 9:14 a.m. OK GNU C++14 TESTS 25 15 512000 1500
62081319 Deja_Vu D Oct. 7, 2019, 8:54 p.m. OK GNU C++14 TESTS 25 15 512000 1500
60292053 _Deku D Sept. 9, 2019, 7:53 a.m. OK GNU C++14 TESTS 25 15 512000 1500
55544045 Adarsh_kc D June 13, 2019, 11:17 p.m. OK GNU C++14 TESTS 25 15 512000 1500
52248962 papabless D April 2, 2019, 9:20 p.m. OK GNU C++14 TESTS 25 15 512000 1500
49518634 esketitt D Feb. 6, 2019, 6:06 a.m. OK GNU C++14 TESTS 25 15 512000 1500
63015332 qf1874 D Oct. 20, 2019, 12:45 p.m. OK GNU C++17 TESTS 25 15 204800 1500
40372075 16jsj107 D July 15, 2018, 8:43 a.m. OK GNU C++17 TESTS 25 15 204800 1500
58961330 vjudge2 D Aug. 17, 2019, 3:25 p.m. OK GNU C++17 TESTS 25 15 204800 1500
61105070 vjudge3 D Sept. 23, 2019, 8:47 a.m. OK GNU C++17 TESTS 25 15 204800 1500
54962317 Vrikodara D June 2, 2019, 4:34 a.m. OK GNU C++17 TESTS 25 15 512000 1500
68336773 1234 D Jan. 6, 2020, 10:48 p.m. OK GNU C++17 TESTS 25 15 512000 1500
68119798 SeyedAmirHosseini D Jan. 3, 2020, 12:52 p.m. OK GNU C++17 TESTS 25 15 512000 1500
57907727 Saket1612 D July 28, 2019, 6:23 p.m. OK GNU C++17 TESTS 25 15 512000 1500
51432434 m.hasan01 D March 18, 2019, 2:30 a.m. OK GNU C++17 TESTS 25 15 512000 1500
61319502 alif_cse_ju D Sept. 26, 2019, 12:08 p.m. OK GNU C++17 TESTS 25 15 512000 1500
40407776 vjudge2 D July 16, 2018, 10:48 a.m. OK GNU C++17 Diagnostics TESTS 25 1045 0 1500
69230880 synapse D Jan. 21, 2020, 9:26 a.m. OK Go TESTS 25 31 0 1500
69230908 vjudge4 D Jan. 21, 2020, 9:27 a.m. OK Go TESTS 25 31 0 1500
40568353 453908766 D July 20, 2018, 6:46 a.m. OK Haskell TESTS 25 46 10649600 1500
69008373 GiantTornado D Jan. 18, 2020, 1:53 a.m. OK Java 11 TESTS 25 187 0 1500
69026120 CodAR D Jan. 18, 2020, 7:15 a.m. OK Java 11 TESTS 25 217 0 1500
68138507 Shanaya D Jan. 3, 2020, 8:19 p.m. OK Java 8 TESTS 25 109 0 1500
61756189 saurabhs1206 D Oct. 3, 2019, 5:36 a.m. OK Java 8 TESTS 25 109 0 1500
56393519 yorky D July 1, 2019, 1:34 p.m. OK Java 8 TESTS 25 109 0 1500
55985017 Java D June 24, 2019, 2:27 a.m. OK Java 8 TESTS 25 109 0 1500
50487016 formalist D Feb. 25, 2019, 11:59 a.m. OK Java 8 TESTS 25 109 0 1500
50325706 mikkk D Feb. 22, 2019, 4:21 p.m. OK Java 8 TESTS 25 109 0 1500
47840439 satya26 D Jan. 2, 2019, 11:34 a.m. OK Java 8 TESTS 25 109 0 1500
47508945 SevenDeadlySins D Dec. 26, 2018, 4:49 a.m. OK Java 8 TESTS 25 109 0 1500
46826926 sooraj10 D Dec. 9, 2018, 7:06 p.m. OK Java 8 TESTS 25 109 0 1500
56486749 Hemose D July 3, 2019, 6:48 p.m. OK Java 8 TESTS 25 109 10444800 1500
40213243 fpdrot D July 11, 2018, 11:22 p.m. OK Kotlin TESTS 25 233 0 1500
40298488 NourAlhadi D July 13, 2018, 11:04 p.m. OK Kotlin TESTS 25 296 62361600 1500
40298496 NourAlhadi D July 13, 2018, 11:05 p.m. OK Kotlin TESTS 25 342 59801600 1500
56007040 og.kostya D June 24, 2019, 4:06 p.m. OK Mono C# TESTS 25 46 716800 1500
40523948 YYOne D July 18, 2018, 6:39 p.m. OK Mono C# TESTS 25 61 7168000 1500
52361497 nemars D April 5, 2019, 8:06 p.m. OK Mono C# TESTS 25 62 716800 1500
66465121 amit1509kumar D Dec. 7, 2019, 4:14 p.m. OK Mono C# TESTS 25 62 1536000 1500
40549948 YYOne D July 19, 2018, 1:47 p.m. OK Mono C# TESTS 25 62 7168000 1500
40502405 kurs D July 18, 2018, 6:53 a.m. OK Mono C# TESTS 25 77 6553600 1500
40549917 YYOne D July 19, 2018, 1:46 p.m. OK Mono C# TESTS 25 77 8294400 1500
40549650 YYOne D July 19, 2018, 1:36 p.m. OK Mono C# TESTS 25 77 9932800 1500
40549771 YYOne D July 19, 2018, 1:40 p.m. OK Mono C# TESTS 25 77 9932800 1500
40253668 Mosyagin D July 13, 2018, 7:44 a.m. OK Mono C# TESTS 25 93 5836800 1500
50721515 vjudge5 D March 3, 2019, 8:43 a.m. OK MS C++ TESTS 25 15 204800 1500
55433571 vjudge3 D June 11, 2019, 12:45 p.m. OK MS C++ TESTS 25 15 204800 1500
40224506 apologize12138 D July 12, 2018, 8:14 a.m. OK MS C++ TESTS 25 15 307200 1500
40775088 etman.x.x D July 26, 2018, 10:52 a.m. OK MS C++ TESTS 25 15 512000 1500
42879273 vjudge5 D Sept. 15, 2018, 5:18 a.m. OK MS C++ TESTS 25 15 1024000 1500
42877277 vjudge4 D Sept. 15, 2018, 2:50 a.m. OK MS C++ TESTS 25 15 1024000 1500
55395642 vjudge2 D June 10, 2019, 11:39 a.m. OK MS C++ TESTS 25 30 204800 1500
40874860 vjudge1 D July 28, 2018, 8 a.m. OK MS C++ TESTS 25 30 204800 1500
55293492 vjudge1 D June 8, 2019, 8:49 a.m. OK MS C++ TESTS 25 30 204800 1500
55394954 vjudge2 D June 10, 2019, 11:22 a.m. OK MS C++ TESTS 25 30 204800 1500
58897939 vjudge2 D Aug. 16, 2019, 8:12 a.m. OK MS C++ 2017 TESTS 25 30 204800 1500
58895864 vjudge5 D Aug. 16, 2019, 7:30 a.m. OK MS C++ 2017 TESTS 25 31 204800 1500
58897740 vjudge2 D Aug. 16, 2019, 8:08 a.m. OK MS C++ 2017 TESTS 25 31 204800 1500
68586544 vjudge5 D Jan. 11, 2020, 11:26 a.m. OK MS C++ 2017 TESTS 25 31 204800 1500
67520812 Mad112233 D Dec. 24, 2019, 12:21 p.m. OK MS C++ 2017 TESTS 25 31 614400 1500
67520975 Mad112233 D Dec. 24, 2019, 12:24 p.m. OK MS C++ 2017 TESTS 25 31 614400 1500
54513498 zkq111 D May 23, 2019, 8:29 a.m. OK MS C++ 2017 TESTS 25 31 614400 1500
53795823 zhaolonga D May 5, 2019, 3:15 p.m. OK MS C++ 2017 TESTS 25 31 614400 1500
51299995 rootuser D March 14, 2019, 1:59 p.m. OK MS C++ 2017 TESTS 25 31 614400 1500
53500712 Timonnable D April 29, 2019, 2:10 p.m. OK MS C++ 2017 TESTS 25 31 716800 1500
49321700 vjudge4 D Feb. 1, 2019, 12:34 p.m. OK Node.js TESTS 25 249 29184000 1500
40229253 sk0 D July 12, 2018, 10:58 a.m. OK Ocaml TESTS 25 31 7065600 1500
40200762 Shokha D July 11, 2018, 12:26 p.m. OK PascalABC.NET TESTS 25 62 0 1500
54826536 Mukundan314 D May 30, 2019, 6:46 a.m. OK PyPy 2 TESTS 25 155 2252800 1500
40243892 sasasagagaga D July 12, 2018, 9:27 p.m. OK PyPy 2 TESTS 25 155 7065600 1500
47687591 c1729 D Dec. 29, 2018, 3:40 p.m. OK PyPy 2 TESTS 25 249 16691200 1500
68147502 shivammishra D Jan. 4, 2020, 5:18 a.m. OK PyPy 3 TESTS 25 171 3072000 1500
55949425 scambret D June 22, 2019, 11:32 p.m. OK PyPy 3 TESTS 25 171 3072000 1500
42315878 nns2009 D Aug. 31, 2018, 5:22 p.m. OK PyPy 3 TESTS 25 171 5734400 1500
42220106 LordVader D Aug. 28, 2018, 7:49 p.m. OK PyPy 3 TESTS 25 186 2969600 1500
46234442 homoeconomicus D Nov. 26, 2018, 12:30 a.m. OK PyPy 3 TESTS 25 186 7884800 1500
66040551 lke_python D Nov. 30, 2019, 1:22 p.m. OK PyPy 3 TESTS 25 186 8192000 1500
66023831 manish.17 D Nov. 30, 2019, 8:07 a.m. OK PyPy 3 TESTS 25 187 3174400 1500
63033197 Zombie358 D Oct. 20, 2019, 7:24 p.m. OK PyPy 3 TESTS 25 187 8396800 1500
48305343 tardis39 D Jan. 12, 2019, 7:24 p.m. OK PyPy 3 TESTS 25 202 2867200 1500
40259004 dvec D July 13, 2018, 11:08 a.m. OK PyPy 3 TESTS 25 202 7884800 1500
49956822 x313x D Feb. 15, 2019, 4:26 p.m. OK Python 2 TESTS 25 327 2662400 1500
41291295 romil797 D Aug. 7, 2018, 3:17 a.m. OK Python 2 TESTS 25 436 17920000 1500
40213259 brian D July 11, 2018, 11:24 p.m. OK Python 2 TESTS 25 452 2150400 1500
52336099 gaidash D April 5, 2019, 8:03 a.m. OK Python 2 TESTS 25 467 4300800 1500
40174079 wangkan2001 D July 10, 2018, 2:01 p.m. OK Python 2 TESTS 25 483 7987200 1500
40219683 taiks D July 12, 2018, 5:40 a.m. OK Python 2 TESTS 25 561 10342400 1500
55505272 Pratik_dey18 D June 12, 2019, 5:28 p.m. OK Python 2 TESTS 25 592 4505600 1500
54798980 anshuman16423 D May 29, 2019, 11:05 a.m. OK Python 2 TESTS 25 732 2252800 1500
40242177 nealzane D July 12, 2018, 7:47 p.m. OK Python 2 TESTS 25 779 1228800 1500
40246313 orailly D July 13, 2018, 1:22 a.m. OK Python 3 TESTS 25 155 716800 1500
40248701 orailly D July 13, 2018, 4:04 a.m. OK Python 3 TESTS 25 171 716800 1500
60405847 alexlyzhov D Sept. 11, 2019, 6:37 p.m. OK Python 3 TESTS 25 233 2662400 1500
46195178 chetan52720 D Nov. 25, 2018, 7:55 a.m. OK Python 3 TESTS 25 249 716800 1500
64186055 D_J_Z D Nov. 4, 2019, 5:11 a.m. OK Python 3 TESTS 25 249 819200 1500
41079878 treasuryonly D Aug. 1, 2018, 11:09 a.m. OK Python 3 TESTS 25 249 3276800 1500
40211927 palan D July 11, 2018, 9:01 p.m. OK Python 3 TESTS 25 264 716800 1500
40180902 EliasMera D July 10, 2018, 6:44 p.m. OK Python 3 TESTS 25 265 716800 1500
62622714 irza_law D Oct. 15, 2019, 1:16 p.m. OK Python 3 TESTS 25 265 1740800 1500
68335178 GTrigger D Jan. 6, 2020, 9:13 p.m. OK Python 3 TESTS 25 280 819200 1500
41545911 betrue12 D Aug. 13, 2018, 4:53 a.m. OK Ruby TESTS 25 234 30105600 1500
40220184 kobae964 D July 12, 2018, 5:59 a.m. OK Rust TESTS 25 46 108748800 1500
47490471 yakamoto D Dec. 25, 2018, 11:48 a.m. OK Scala TESTS 25 405 0 1500
47503225 yakamoto D Dec. 25, 2018, 7:36 p.m. OK Scala TESTS 25 451 0 1500

remove filters

Back to search problems