PrevNext
Has Not Appeared
 0/4

(Optional) Intro to Bitwise Operators

Author: Siyong Huang

Goes over the six bitwise operators and the common ways they are used.

Note that so far, no Silver problem has required knowledge of bitwise operators, so you can skip this module if you want.

Resources
CFGreat explanation by Errichto
GFGThe same operators are used in java and python

Let's take a look at some examples to better understand bitwise operators. Note that you typically won't be asked to use bitwise operators to implement addition/multiplication.

Example: Addition

Try implementing addition using bitwise operators! (Here's an online judge if you want to test it)

Solution

Example: Multiplication

Now try implementing multiplication using bitwise operators! (I couldn't find an online judge for multiplication, but here's a similar problem: link)

Solution

StatusSourceProblem NameDifficultyTagsSolutionURL
CFNormal
Show Tags

Math, Brute Force

Check CF
CFNormal
Show Tags

Math, Greedy

Check CF
CFNormal
Show Tags

Math, Greedy

Check CF
CFHard
Show Tags

Math, Interactive

Check CF

Module Progress:

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!

Give Us Feedback on (Optional) Intro to Bitwise Operators!

PrevNext