Codeforces Round 486 (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
988 Codeforces Round 486 (Div. 3) FINISHED False 7200 209316263 June 1, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4050 ) E Divisibility by 25 PROGRAMMING brute force greedy 2100

B'You are given an integer n from 1 to 10^{18} without leading zeroes. In one move you can swap any two adjacent digits in the given number in such a way that the resulting number will not contain leading zeroes. In other words, after each move the number you have cannot contain any leading zeroes. What is the minimum number of moves you have to make to obtain a number that is divisible by 25 ? Print -1 if it is impossible to obtain a number that is divisible by 25 . The first line contains an integer n ( 1 <= n <= 10^{18} ). It is guaranteed that the first (left) digit of the number n is not a zero. If it is impossible to obtain a number that is divisible by 25 , print -1. Otherwise print the minimum number of moves required to obtain such number. Note that you can swap only adjacent digits in the given number. In the first example one of the possible sequences of moves is 5071 rightarrow 5701 rightarrow 7501 rightarrow 7510 rightarrow 7150. '...

Tutorials

59810

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
39129304 Denor E June 10, 2018, 6:27 p.m. OK Delphi TESTS 52 15 0 2100
40204267 Oompaloompa E July 11, 2018, 2:28 p.m. OK FPC TESTS 52 31 0 2100
46206217 tranquangtien942qn E Nov. 25, 2018, 2:27 p.m. OK FPC TESTS 52 31 102400 2100
38985907 Luxon E June 6, 2018, 6:51 a.m. OK GNU C TESTS 52 31 0 2100
39455036 AotoriChiaki E June 21, 2018, 8:02 a.m. OK GNU C++ TESTS 52 15 0 2100
39204305 RohamKaveie E June 13, 2018, 2:05 a.m. OK GNU C++ TESTS 52 15 0 2100
38915813 Scut82 E June 3, 2018, 9:05 a.m. OK GNU C++ TESTS 52 15 3481600 2100
39460909 DavidLei E June 21, 2018, 11:52 a.m. OK GNU C++ TESTS 52 30 0 2100
39658899 gurpreet_ait E June 25, 2018, 7:35 p.m. OK GNU C++ TESTS 52 30 0 2100
39415268 CQUzbx E June 19, 2018, 3:24 p.m. OK GNU C++ TESTS 52 30 0 2100
39393556 Emmanuell E June 18, 2018, 10:37 p.m. OK GNU C++ TESTS 52 30 0 2100
39335980 saenyakorn E June 17, 2018, 1:11 p.m. OK GNU C++ TESTS 52 30 0 2100
39329123 Eric1028 E June 17, 2018, 8:12 a.m. OK GNU C++ TESTS 52 30 0 2100
40700874 vjudge5 E July 24, 2018, 10:46 a.m. OK GNU C++ TESTS 52 30 0 2100
39074648 pandrei E June 9, 2018, 4:55 p.m. OK GNU C11 TESTS 52 31 0 2100
43522993 Shajib_ E Sept. 28, 2018, 9:41 a.m. OK GNU C11 TESTS 52 31 307200 2100
39330199 20175259 E June 17, 2018, 8:56 a.m. OK GNU C++11 TESTS 52 15 0 2100
39010310 mengda E June 7, 2018, 6:22 a.m. OK GNU C++11 TESTS 52 15 0 2100
38995911 vic006 E June 6, 2018, 1:24 p.m. OK GNU C++11 TESTS 52 15 307200 2100
38922371 Amaryllis3 E June 3, 2018, 1:42 p.m. OK GNU C++11 TESTS 52 15 3481600 2100
38965947 zjtzjt E June 5, 2018, 10:42 a.m. OK GNU C++11 TESTS 52 15 3788800 2100
40745571 JeanYan E July 25, 2018, 2:30 p.m. OK GNU C++11 TESTS 52 30 0 2100
40467646 mcqueen1 E July 17, 2018, 7:37 a.m. OK GNU C++11 TESTS 52 30 0 2100
39588509 smiken E June 24, 2018, 3:52 a.m. OK GNU C++11 TESTS 52 30 0 2100
39417480 UncleBobbyB E June 19, 2018, 5:04 p.m. OK GNU C++11 TESTS 52 30 0 2100
54506296 WOSHIGEPACHONG2 E May 23, 2019, 4:09 a.m. OK GNU C++11 TESTS 52 30 0 2100
39183602 Princ_iple E June 12, 2018, 7:32 a.m. OK GNU C++14 TESTS 52 15 0 2100
55675978 ishankjain E June 17, 2019, 10:26 a.m. OK GNU C++14 TESTS 52 15 0 2100
39648802 matcoder E June 25, 2018, 12:06 p.m. OK GNU C++14 TESTS 52 15 0 2100
39642177 Pawan_29 E June 25, 2018, 7:46 a.m. OK GNU C++14 TESTS 52 15 0 2100
39496569 H_inverse E June 21, 2018, 5:44 p.m. OK GNU C++14 TESTS 52 15 0 2100
39429879 Rawhy E June 20, 2018, 8:18 a.m. OK GNU C++14 TESTS 52 15 0 2100
39351535 Daryusz E June 18, 2018, 9:03 a.m. OK GNU C++14 TESTS 52 15 0 2100
39256572 mAVerIcK__ E June 15, 2018, 3:47 a.m. OK GNU C++14 TESTS 52 15 0 2100
39076776 Raihanur_R E June 9, 2018, 7 p.m. OK GNU C++14 TESTS 52 15 0 2100
39067341 square1001 E June 9, 2018, 11:07 a.m. OK GNU C++14 TESTS 52 15 0 2100
39731864 fredbr E June 28, 2018, 3:49 a.m. OK GNU C++17 TESTS 52 15 0 2100
39643352 fzh0917 E June 25, 2018, 8:32 a.m. OK GNU C++17 TESTS 52 15 0 2100
39443701 Coruncanius E June 20, 2018, 6:17 p.m. OK GNU C++17 TESTS 52 15 0 2100
39363650 razouq E June 18, 2018, 4:43 p.m. OK GNU C++17 TESTS 52 15 0 2100
39129287 chort E June 10, 2018, 6:26 p.m. OK GNU C++17 TESTS 52 15 0 2100
39039638 ILoveU3000 E June 8, 2018, 8:15 a.m. OK GNU C++17 TESTS 52 15 0 2100
39039371 schureedgood E June 8, 2018, 8:02 a.m. OK GNU C++17 TESTS 52 15 0 2100
39011345 anta E June 7, 2018, 7:16 a.m. OK GNU C++17 TESTS 52 15 0 2100
52027031 ceass20xx E March 30, 2019, 3:26 p.m. OK GNU C++17 TESTS 52 15 0 2100
55335841 vjudge5 E June 9, 2019, 1:42 p.m. OK GNU C++17 TESTS 52 15 0 2100
38916860 megaspazz E June 3, 2018, 9:47 a.m. OK Go TESTS 52 31 24576000 2100
38916854 megaspazz E June 3, 2018, 9:46 a.m. OK Go TESTS 52 31 24576000 2100
68988937 GiantTornado E Jan. 17, 2020, 1:30 p.m. OK Java 11 TESTS 52 171 0 2100
68987393 GiantTornado E Jan. 17, 2020, 1 p.m. OK Java 11 TESTS 52 171 0 2100
46446805 YahiaBadr E Dec. 1, 2018, 1:55 p.m. OK Java 8 TESTS 52 109 0 2100
57559804 Java E July 22, 2019, 11:09 p.m. OK Java 8 TESTS 52 109 0 2100
56675595 Hemose E July 7, 2019, 3:20 p.m. OK Java 8 TESTS 52 109 0 2100
51917249 Krimpai E March 27, 2019, 11:33 p.m. OK Java 8 TESTS 52 109 0 2100
47344900 xodiac E Dec. 21, 2018, 7:12 p.m. OK Java 8 TESTS 52 109 0 2100
46446890 YahiaBadr E Dec. 1, 2018, 1:57 p.m. OK Java 8 TESTS 52 109 0 2100
63131736 anto777 E Oct. 22, 2019, 2:26 p.m. OK Java 8 TESTS 52 124 0 2100
58955083 LAKOUAM_IMAD E Aug. 17, 2019, 12:37 p.m. OK Java 8 TESTS 52 124 0 2100
51992872 mikkk E March 29, 2019, 9:35 p.m. OK Java 8 TESTS 52 124 0 2100
69547165 luchy0120 E Jan. 26, 2020, 3:53 a.m. OK Java 8 TESTS 52 124 0 2100
38917933 0442A403 E June 3, 2018, 10:39 a.m. OK Kotlin TESTS 52 140 21094400 2100
41487384 stepanovep E Aug. 11, 2018, 2:29 p.m. OK Kotlin TESTS 52 155 0 2100
39276111 iwillhackyou E June 15, 2018, 11:05 p.m. OK MS C++ TESTS 52 15 0 2100
38971810 mayflower E June 5, 2018, 2:48 p.m. OK MS C++ TESTS 52 15 3481600 2100
39232986 j4357j E June 14, 2018, 6:24 a.m. OK MS C++ TESTS 52 30 0 2100
38946151 vjudge1 E June 4, 2018, 1:34 p.m. OK MS C++ TESTS 52 30 3481600 2100
67402439 vjudge4 E Dec. 22, 2019, 4:43 a.m. OK MS C++ TESTS 52 31 0 2100
67469908 vjudge3 E Dec. 23, 2019, 12:25 p.m. OK MS C++ TESTS 52 31 0 2100
67468263 vjudge5 E Dec. 23, 2019, 11:52 a.m. OK MS C++ TESTS 52 31 0 2100
67404220 vjudge5 E Dec. 22, 2019, 5:37 a.m. OK MS C++ TESTS 52 31 0 2100
67062939 vjudge3 E Dec. 17, 2019, 9:54 a.m. OK MS C++ TESTS 52 31 0 2100
55608097 vjudge3 E June 16, 2019, 3:03 a.m. OK MS C++ TESTS 52 31 0 2100
54060556 zkq111 E May 13, 2019, 11:01 a.m. OK MS C++ 2017 TESTS 52 31 0 2100
50628895 work_hard. E March 1, 2019, 7:53 a.m. OK MS C++ 2017 TESTS 52 31 0 2100
63749347 Samanter E Oct. 29, 2019, 7:39 p.m. OK MS C++ 2017 TESTS 52 31 307200 2100
39459784 DerUbermensch E June 21, 2018, 11:12 a.m. OK Node.js TESTS 52 140 204800 2100
39008526 gabe E June 7, 2018, 4:21 a.m. OK Perl TESTS 52 46 0 2100
49149559 mayakin E Jan. 29, 2019, 12:08 p.m. OK PHP TESTS 52 46 512000 2100
38944043 dbhrockzz E June 4, 2018, 12:15 p.m. OK PyPy 2 TESTS 52 109 23961600 2100
53438774 vjudge3 E April 27, 2019, 9:10 p.m. OK PyPy 2 TESTS 52 124 0 2100
58656904 c1729 E Aug. 12, 2019, 9:25 a.m. OK PyPy 2 TESTS 52 124 307200 2100
53441091 pajenegod E April 28, 2019, 12:19 a.m. OK PyPy 2 TESTS 52 389 5324800 2100
39443702 kevinsogo E June 20, 2018, 6:17 p.m. OK PyPy 3 TESTS 52 124 204800 2100
52595149 meooow E April 11, 2019, 8:31 a.m. OK PyPy 3 TESTS 52 139 0 2100
39040361 arsrivish2 E June 8, 2018, 8:45 a.m. OK PyPy 3 TESTS 52 139 0 2100
52278029 aleonov drobucs E April 3, 2019, 3:37 p.m. OK PyPy 3 TESTS 52 140 0 2100
51549262 knight-erraunt E March 19, 2019, 10:30 p.m. OK PyPy 3 TESTS 52 140 0 2100
49122122 Sevlll E Jan. 28, 2019, 7:55 p.m. OK PyPy 3 TESTS 52 140 0 2100
58413446 shiv1470 E Aug. 7, 2019, 3:07 a.m. OK PyPy 3 TESTS 52 140 102400 2100
41607875 Yash_ E Aug. 15, 2018, 4:21 a.m. OK PyPy 3 TESTS 52 155 0 2100
66236004 SMMaster E Dec. 3, 2019, 4:11 p.m. OK PyPy 3 TESTS 52 155 307200 2100
65354804 BQPOH E Nov. 19, 2019, 2:43 p.m. OK PyPy 3 TESTS 52 155 307200 2100
39031661 Jota E June 7, 2018, 9:07 p.m. OK Python 2 TESTS 52 109 0 2100
53438761 cowboy E April 27, 2019, 9:10 p.m. OK Python 2 TESTS 52 171 0 2100
46373750 tnowakow E Nov. 29, 2018, 5:19 p.m. OK Python 2 TESTS 52 171 0 2100
39124640 NickLatkovich E June 10, 2018, 2:58 p.m. OK Python 3 TESTS 52 78 0 2100
39050443 LHamster E June 8, 2018, 4:01 p.m. OK Python 3 TESTS 52 78 0 2100
39000403 timkoff E June 6, 2018, 5:05 p.m. OK Python 3 TESTS 52 78 0 2100
38909767 eugalt E June 3, 2018, 5:03 a.m. OK Python 3 TESTS 52 78 7065600 2100
39684286 sev7enn E June 26, 2018, 7:03 p.m. OK Python 3 TESTS 52 93 0 2100
39137408 the_white_devil E June 11, 2018, 5:41 a.m. OK Python 3 TESTS 52 93 0 2100
39131766 EugeneJudo E June 10, 2018, 8:49 p.m. OK Python 3 TESTS 52 93 0 2100
39113095 s_p E June 10, 2018, 11:42 a.m. OK Python 3 TESTS 52 93 0 2100
39088123 moedhia69 E June 10, 2018, 9:24 a.m. OK Python 3 TESTS 52 93 0 2100
39054724 LintuStorm E June 8, 2018, 8:38 p.m. OK Python 3 TESTS 52 93 0 2100
38974177 vamsi1281977 E June 5, 2018, 4:33 p.m. OK Rust TESTS 52 30 2867200 2100
39275710 jrodrigues E June 15, 2018, 10:11 p.m. OK Rust TESTS 52 31 0 2100
38974037 vamsi1281977 E June 5, 2018, 4:25 p.m. OK Rust TESTS 52 31 2867200 2100
38973418 vamsi1281977 E June 5, 2018, 3:59 p.m. OK Rust TESTS 52 31 2867200 2100
39284397 kobae964 E June 16, 2018, 10:15 a.m. OK Rust TESTS 52 62 105164800 2100

remove filters

Back to search problems