👋 I'm David Guan

What this talk is about

  1. The contests.
  2. How to use the online judges.
  3. TricksThings I learned.

Contests

codejam.withgoogle.com facebook.com/hackercup/register

Contest Format

Live DEMO on Codejam

Why Joining Contests 🤔

  1. Practically, helps you find jobs.
  2. Helps you push yourself to study more.
  3. The community and fun.
codeforces leetcode kattis

Using OJ

Live DEMO

Things I Learned

Know the language

Example 1, javascript


          console.log(1 << 1) // <- gives `2`
          console.log(1 << 2) // <- gives `4`

          console.log(1 << 2, Math.pow(2, 2)) // <- gives `true`
          console.log(1 << 10, Math.pow(2, 10)) // <- gives `true`
          console.log(1 << 50, Math.pow(2, 50)) // <- gives ...?
        

Know the language

Example 1, javascript


          console.log(1 << 1) // <- gives `2`
          console.log(1 << 2) // <- gives `4`

          console.log(1 << 2, Math.pow(2, 2)) // <- gives `true`
          console.log(1 << 10, Math.pow(2, 10)) // <- gives `true`
          console.log(1 << 50, Math.pow(2, 50)) // <- gives `false`
        

Okay, fine, but why it matters?

They will break when a number is big enough

Example 2, Golang


          package main

          func main() {
            n := 0
            fmt.Scan(&n) // n is big
            a := make([]int, n) // make a slice that contains n elements
            for i := 0; i < n; i++ {
            	fmt.Scan(&a[i])
            }

            // You awesome algorithm,
            //   that have good time complexity,
            //   super fast, must get passed.
            // Then...
          }
        

Let's check out what really happened

And more...

But how do to know these kind of tips?

📚

or

Tools

And more(DEMO)...

Algorithms Unlocked (newbie friendly)
awesome-competitive-programming

Practice

And, Of course, joining this meetup often.

😃

Questions?