Codeforces Round 538 (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
1114 Codeforces Round 538 (Div. 2) FINISHED False 7200 187718124 Feb. 10, 2019, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7464 ) C Trailing Loves (or L'oeufs?) PROGRAMMING brute force implementation math number theory 1700

B'Aki is fond of numbers, especially those with trailing zeros. For example, the number 9200 has two trailing zeros. Aki thinks the more trailing zero digits a number has, the prettier it is. However, Aki believes, that the number of trailing zeros of a number is not static, but depends on the base (radix) it is represented in. Thus, he considers a few scenarios with some numbers and bases. And now, since the numbers he used become quite bizarre, he asks you to help him to calculate the beauty of these numbers. Given two integers n and b (in decimal notation), your task is to calculate the number of trailing zero digits in the b -ary (in the base/radix of b ) representation of n ,! (factorial of n ). The only line of the input contains two integers n and b ( 1 <= n <= 10^{18} , 2 <= b <= 10^{12} ). Print an only integer -- the number of trailing zero digits in the b -ary representation of n! In the first example, 6!_{(10)} = 720_{(10)} = 880_{(9)} . In the third and fourth example, 5!_{(10)} = 120_{(10)} = 1111000_{(2)} . The representation of the number x in the b -ary base is d_1, d_2, ldots, d_k if x = d_1 b^{k - 1} + d_2 b^{k - 2} + ldots + d_k b^0 , where d_i are integers and 0 <= d_i <= b - 1 . For example, the number 720 from the first example is represented as 880_{(9)} since 720 = 8 cdot 9^2 + 8 cdot 9 + 0 cdot 1 . You can read more about bases here. '...

Tutorials

Codeforces Round #538 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49840648 Mohamad_AboDan C Feb. 12, 2019, 6:15 p.m. OK Clang++17 Diagnostics TESTS 75 61 0 1700
49761856 Brijesh1in C Feb. 11, 2019, 9:25 a.m. OK Clang++17 Diagnostics TESTS 75 62 0 1700
50040871 rr_ C Feb. 17, 2019, 1:44 a.m. OK D TESTS 75 46 0 1700
49824667 Tri_Phan C Feb. 12, 2019, 10:51 a.m. OK FPC TESTS 75 46 307200 1700
49835907 samreen22 C Feb. 12, 2019, 4:08 p.m. OK GNU C11 TESTS 75 31 0 1700
49752643 geeyiiz C Feb. 11, 2019, 3:59 a.m. OK GNU C11 TESTS 75 31 0 1700
49753278 sansen C Feb. 11, 2019, 4:29 a.m. OK GNU C11 TESTS 75 31 0 1700
50081847 MattG C Feb. 18, 2019, 4:49 a.m. OK GNU C11 TESTS 75 62 0 1700
50695130 vjudge1 C March 2, 2019, 5:43 p.m. OK GNU C11 TESTS 75 186 409600 1700
53306316 vjudge1 C April 26, 2019, 3:22 a.m. OK GNU C11 TESTS 75 186 819200 1700
69666898 DevC C Jan. 28, 2020, 11:40 a.m. OK GNU C++11 TESTS 75 31 0 1700
69166221 luogu_bot3 C Jan. 20, 2020, 3:55 a.m. OK GNU C++11 TESTS 75 31 0 1700
69164921 C2021hyf C Jan. 20, 2020, 3:03 a.m. OK GNU C++11 TESTS 75 31 0 1700
68954876 liv23333 C Jan. 16, 2020, 7:37 p.m. OK GNU C++11 TESTS 75 31 0 1700
68769895 vjudge1 C Jan. 14, 2020, 11:27 a.m. OK GNU C++11 TESTS 75 31 0 1700
68763262 hpp C Jan. 14, 2020, 8:57 a.m. OK GNU C++11 TESTS 75 31 0 1700
67648366 _dark_side C Dec. 26, 2019, 11:07 a.m. OK GNU C++11 TESTS 75 31 0 1700
67159107 AyoAyowei C Dec. 18, 2019, 1:24 p.m. OK GNU C++11 TESTS 75 31 0 1700
69723699 luogu_bot1 C Jan. 29, 2020, 11:33 a.m. OK GNU C++11 TESTS 75 31 0 1700
69723611 luogu_bot2 C Jan. 29, 2020, 11:31 a.m. OK GNU C++11 TESTS 75 31 0 1700
49754533 yapoo C Feb. 11, 2019, 5:25 a.m. OK GNU C++14 TESTS 75 15 0 1700
51445955 debugforever C March 18, 2019, 12:30 p.m. OK GNU C++14 TESTS 75 15 0 1700
51930939 Bakhtawar C March 28, 2019, 10:19 a.m. OK GNU C++14 TESTS 75 30 0 1700
68879912 innovate1546 C Jan. 15, 2020, 6:22 p.m. OK GNU C++14 TESTS 75 30 0 1700
60416241 robincse14 C Sept. 12, 2019, 2:25 a.m. OK GNU C++14 TESTS 75 30 0 1700
56721038 smasHR C July 8, 2019, 4:51 p.m. OK GNU C++14 TESTS 75 30 0 1700
53826368 khanhba C May 6, 2019, 4:23 p.m. OK GNU C++14 TESTS 75 30 0 1700
52771675 vjudge2 C April 15, 2019, 9:14 a.m. OK GNU C++14 TESTS 75 30 0 1700
52540070 7NationTengri C April 9, 2019, 5:36 p.m. OK GNU C++14 TESTS 75 30 0 1700
50636433 nitin_98 C March 1, 2019, 12:01 p.m. OK GNU C++14 TESTS 75 30 0 1700
52074610 LH01 C March 31, 2019, 9:24 a.m. OK GNU C++17 TESTS 75 15 0 1700
50812182 blackjack001 C March 5, 2019, 9:26 a.m. OK GNU C++17 TESTS 75 30 0 1700
53566548 egneeS C April 30, 2019, 12:45 p.m. OK GNU C++17 TESTS 75 30 0 1700
50595149 out111 C Feb. 28, 2019, 9:43 a.m. OK GNU C++17 TESTS 75 30 0 1700
53846322 vjudge5 C May 7, 2019, 11:10 a.m. OK GNU C++17 TESTS 75 30 0 1700
54382598 SmnTin C May 19, 2019, 11:39 a.m. OK GNU C++17 TESTS 75 30 0 1700
54742581 vyassamir C May 28, 2019, 8:47 a.m. OK GNU C++17 TESTS 75 30 0 1700
59370076 SilentReaper C Aug. 23, 2019, 6:43 p.m. OK GNU C++17 TESTS 75 30 0 1700
60351554 Rafat C Sept. 10, 2019, 2:30 p.m. OK GNU C++17 TESTS 75 30 0 1700
52759560 Raghav99 C April 14, 2019, 7:30 p.m. OK GNU C++17 TESTS 75 30 0 1700
50031151 Hillmouse C Feb. 16, 2019, 6:50 p.m. OK Haskell TESTS 75 93 102400 1700
49851676 Oopsimbad C Feb. 13, 2019, 4:18 a.m. OK Java 8 TESTS 75 109 0 1700
53993083 vjudge5 C May 11, 2019, 1:11 p.m. OK Java 8 TESTS 75 124 0 1700
62448575 ijxjdjd C Oct. 13, 2019, 2:10 a.m. OK Java 8 TESTS 75 124 0 1700
54859300 hasan5788 C May 30, 2019, 11:13 p.m. OK Java 8 TESTS 75 124 0 1700
50700491 Pratik_Rajani C March 2, 2019, 8:58 p.m. OK Java 8 TESTS 75 124 0 1700
50083107 ayushchaurasia2879 C Feb. 18, 2019, 5:48 a.m. OK Java 8 TESTS 75 124 0 1700
49986117 rahsutamrev C Feb. 16, 2019, 10:37 a.m. OK Java 8 TESTS 75 124 0 1700
49905273 harpreetmehra C Feb. 14, 2019, 11:38 a.m. OK Java 8 TESTS 75 124 0 1700
49905206 harpreetmehra C Feb. 14, 2019, 11:37 a.m. OK Java 8 TESTS 75 124 0 1700
49872703 GreatWhite C Feb. 13, 2019, 2:30 p.m. OK Java 8 TESTS 75 124 0 1700
50803402 exs C March 5, 2019, 2:49 a.m. OK Kotlin TESTS 75 124 0 1700
49876891 glider.g C Feb. 13, 2019, 4:18 p.m. OK Kotlin TESTS 75 155 0 1700
54861045 camypaper C May 31, 2019, 1:53 a.m. OK Mono C# TESTS 75 62 0 1700
67060448 hibatibati C Dec. 17, 2019, 8:49 a.m. OK Mono C# TESTS 75 62 1638400 1700
51657846 nemars C March 21, 2019, 11:20 p.m. OK Mono C# TESTS 75 77 0 1700
55795954 og.kostya C June 19, 2019, 5:01 p.m. OK Mono C# TESTS 75 77 3788800 1700
49755511 selpo C Feb. 11, 2019, 6:07 a.m. OK Mono C# TESTS 75 93 6246400 1700
51485153 vjudge3 C March 19, 2019, 1:15 p.m. OK MS C++ TESTS 75 31 0 1700
61980949 vjudge2 C Oct. 6, 2019, 12:01 p.m. OK MS C++ TESTS 75 31 0 1700
53993040 vjudge3 C May 11, 2019, 1:10 p.m. OK MS C++ TESTS 75 31 0 1700
51484718 ys1468362286 C March 19, 2019, 1:05 p.m. OK MS C++ TESTS 75 31 0 1700
58431054 vjudge4 C Aug. 7, 2019, 11:53 a.m. OK MS C++ TESTS 75 31 102400 1700
50352769 vjudge2 C Feb. 23, 2019, 9:18 a.m. OK MS C++ TESTS 75 31 204800 1700
50143306 vjudge5 C Feb. 19, 2019, 12:54 a.m. OK MS C++ TESTS 75 31 204800 1700
50084032 vjudge3 C Feb. 18, 2019, 6:22 a.m. OK MS C++ TESTS 75 31 204800 1700
52940929 vjudge2 C April 18, 2019, 9:12 a.m. OK MS C++ TESTS 75 31 409600 1700
60926575 vjudge1 C Sept. 20, 2019, 12:27 p.m. OK MS C++ TESTS 75 31 1638400 1700
53098814 YuChunDescz C April 21, 2019, 3:07 p.m. OK MS C++ 2017 TESTS 75 31 0 1700
49895005 kappere C Feb. 14, 2019, 6:28 a.m. OK MS C++ 2017 TESTS 75 31 0 1700
49768876 dyxx C Feb. 11, 2019, 12:50 p.m. OK MS C++ 2017 TESTS 75 31 0 1700
49758006 Gladius_Smerch C Feb. 11, 2019, 7:30 a.m. OK MS C++ 2017 TESTS 75 31 0 1700
49770990 nomiku99 C Feb. 11, 2019, 1:39 p.m. OK MS C++ 2017 TESTS 75 31 102400 1700
66187959 CtrlAlt C Dec. 2, 2019, 3:16 p.m. OK MS C++ 2017 TESTS 75 31 307200 1700
60835797 cckk4467 C Sept. 19, 2019, 8:56 a.m. OK MS C++ 2017 TESTS 75 31 11980800 1700
49882797 The-Last-Avenger C Feb. 13, 2019, 7:05 p.m. OK MS C++ 2017 TESTS 75 46 0 1700
51806189 alexxx998 C March 24, 2019, 9:59 p.m. OK MS C++ 2017 TESTS 75 46 0 1700
53038727 wisest C April 20, 2019, 8:41 a.m. OK MS C++ 2017 TESTS 75 46 0 1700
49925532 ryanr1230 C Feb. 14, 2019, 10:11 p.m. OK PyPy 2 TESTS 75 140 204800 1700
49812005 aeternalis1 C Feb. 12, 2019, 2:09 a.m. OK PyPy 2 TESTS 75 155 204800 1700
49768062 apoorv1999 C Feb. 11, 2019, 12:32 p.m. OK PyPy 2 TESTS 75 218 6860800 1700
58867636 ssk497 C Aug. 15, 2019, 2 p.m. OK PyPy 2 TESTS 75 218 8908800 1700
49754631 soumyasarkar1998 C Feb. 11, 2019, 5:29 a.m. OK PyPy 2 TESTS 75 248 1228800 1700
57597064 bcollet C July 23, 2019, 2:20 p.m. OK PyPy 2 TESTS 75 483 409600 1700
49783112 pandrei C Feb. 11, 2019, 6:23 p.m. OK PyPy 3 TESTS 75 155 0 1700
50102422 nexus.chebykin C Feb. 18, 2019, 3:35 p.m. OK PyPy 3 TESTS 75 155 102400 1700
63767739 mr_backlog C Oct. 30, 2019, 6:50 a.m. OK PyPy 3 TESTS 75 155 66355200 1700
50576275 agp231 C Feb. 27, 2019, 6:15 p.m. OK PyPy 3 TESTS 75 170 0 1700
51201838 mola.mola C March 12, 2019, 12:35 a.m. OK PyPy 3 TESTS 75 171 0 1700
49763667 syzymon C Feb. 11, 2019, 10:29 a.m. OK PyPy 3 TESTS 75 171 0 1700
49752553 Bruteforcer101 C Feb. 11, 2019, 3:54 a.m. OK PyPy 3 TESTS 75 171 0 1700
52276415 hrustim25 C April 3, 2019, 2:58 p.m. OK PyPy 3 TESTS 75 171 102400 1700
49978928 artifexbm C Feb. 16, 2019, 7:22 a.m. OK PyPy 3 TESTS 75 171 102400 1700
49888757 SHOVON588 C Feb. 14, 2019, 1:09 a.m. OK PyPy 3 TESTS 75 171 102400 1700
49920332 pkacprzak C Feb. 14, 2019, 6:30 p.m. OK Python 2 TESTS 75 592 0 1700
49935713 nealzane C Feb. 15, 2019, 7:13 a.m. OK Python 2 TESTS 75 623 0 1700
49811205 idgaf C Feb. 12, 2019, 1:17 a.m. OK Python 2 TESTS 75 639 12697600 1700
49763081 gatsko C Feb. 11, 2019, 10:07 a.m. OK Python 2 TESTS 75 1325 512000 1700
49837493 c1729 C Feb. 12, 2019, 4:50 p.m. OK Python 3 TESTS 75 155 819200 1700
49795588 c1729 C Feb. 11, 2019, 7:41 p.m. OK Python 3 TESTS 75 171 819200 1700
49900530 Black_Fregat C Feb. 14, 2019, 9:07 a.m. OK Python 3 TESTS 75 171 9216000 1700
61029446 PC_4299 C Sept. 21, 2019, 5:10 p.m. OK Python 3 TESTS 75 202 0 1700
49806897 adshin21 C Feb. 11, 2019, 8:26 p.m. OK Python 3 TESTS 75 202 0 1700
49764551 Alireza_Keshavarz C Feb. 11, 2019, 10:59 a.m. OK Python 3 TESTS 75 202 0 1700
50289893 muktan C Feb. 21, 2019, 4:53 p.m. OK Python 3 TESTS 75 202 409600 1700
49806971 adshin21 C Feb. 11, 2019, 8:29 p.m. OK Python 3 TESTS 75 202 409600 1700
49778749 krishnanarwani C Feb. 11, 2019, 4:38 p.m. OK Python 3 TESTS 75 202 409600 1700
49807146 adshin21 C Feb. 11, 2019, 8:36 p.m. OK Python 3 TESTS 75 217 409600 1700
65537895 tuna_salad C Nov. 22, 2019, 2:52 p.m. OK Rust TESTS 75 46 0 1700
49776118 Chenyao C Feb. 11, 2019, 3:32 p.m. OK Rust TESTS 75 46 0 1700
50086238 nafeezabrar C Feb. 18, 2019, 7:36 a.m. OK Scala TESTS 75 467 0 1700

remove filters

Back to search problems