Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
Competitive Programming
3.3K+ articles
Combinatorial
707+ articles
Modular Arithmetic
207+ articles
combinatorics
46+ articles
Algorithms-Divide and Conquer
8+ articles
In-house
+ articles
Binary Exponentiation
11 posts
Recent Articles
Popular Articles
Binary Exponentiation for Competitive Programming
Last Updated: 14 May 2024
In competitive programming, we often need to do a lot of big number calculations fast. Binary exponentiation is like a super shortcut for doing powers and can make program...
read more
Competitive Programming
DSA
Modular Arithmetic
Binary Exponentiation
Number of ways to Color the Boxes
Last Updated: 13 December 2023
Given N boxes (N = 5) aligned in a line, we need to color all the boxes with using K colors such that the length of the longest segment of boxes with same color is equal t...
read more
Combinatorial
Competitive Programming
DSA
Binary Exponentiation
Rearrange Even and Odd Index Elements in K Operations
Last Updated: 15 February 2024
Given an array arr[] of size N (N is even) and a positive integer K, the task is to apply an operation to the array arr[] for K times. Applying the operation once will shi...
read more
Competitive Programming
DSA
Arrays
Algorithms-Divide and Conquer
Binary Exponentiation
Apply Given Permutation on Array K times
Last Updated: 29 July 2024
Given two arrays arr[] and P[] of length N and an integer K. The task is to find the final array if permutation P[] is applied on given array arr[] for K times. If we app...
read more
Competitive Programming
Picked
Geeks Premier League
DSA
Arrays
Geeks Premier League 2023
Binary Exponentiation
Counting K-Length Strings with Fixed Character in a Unique String
Last Updated: 08 March 2024
Given a string S of length n containing distinct characters and a character C , the task is to count k-length strings that can be formed using characters from the string S...
read more
Strings
Combinatorial
Competitive Programming
Geeks Premier League
DSA
Geeks Premier League 2023
Binary Exponentiation
Counting k-Length Strings with Character C Allowing Repeated Characters
Last Updated: 08 March 2024
Given a string S of length n containing distinct characters and a character C, the task is to count k-length strings that can be formed using characters from the string S,...
read more
Strings
Combinatorial
Competitive Programming
Geeks Premier League
DSA
Geeks Premier League 2023
Binary Exponentiation
Counting numbers with given digits and digit sum
Last Updated: 20 March 2024
Given a number N, count the numbers X of length exactly N such that the number X and the sum of digits of the number X have digits A and B only in their decimal representa...
read more
Combinatorial
Competitive Programming
Picked
DSA
number-theory
Binary Exponentiation
CSES Solutions - Bit Strings
Last Updated: 27 March 2024
Your task is to calculate the number of bit strings of length N. For example, if N=3, the correct answer is 8, because the possible bit strings are 000, 001, 010, 011, 100...
read more
Bit Magic
Competitive Programming
Picked
DSA
Binary Exponentiation
CSES Problems
Ways to arrange N balls of K colors with no adjacent same colors
Last Updated: 29 April 2024
Given infinite balls of K distinct colors. Count the number of ways to arrange N balls in a line such that no two adjacent balls are of same color. Since the answer may be...
read more
Mathematical
Combinatorial
DSA
combinatorics
Binary Exponentiation
CSES Solutions - Exponentiation II
Last Updated: 15 April 2024
Your task is to efficiently calculate values a^(b^c) modulo 109+7.Note that in this task we assume that 00 = 1.Examples:Input: N = 2, queries[][] = {{3, 7, 1}, {2, 3, 2}}O...
read more
Mathematical
Competitive Programming
Picked
DSA
Modular Arithmetic
Binary Exponentiation
CSES Problems
CSES Solutions - Exponentiation
Last Updated: 18 April 2024
Your task is to efficiently calculate values a^b modulo 109+7. Note that in this task we assume that 00=1.Examples:Input: N = 3, queries[][] = {{3, 4}, {2, 8}, {123, 123}}...
read more
Mathematical
Competitive Programming
Picked
DSA
number-theory
Binary Exponentiation
CSES Problems
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !