Ken Lee, thoughts and et cetera

Dec 2019 Kattis

December 14, 20191 min read

Things to be careful of, to avoid WA

  1. std::fixed for fp number.

    when cout of fp number, they might be scientific or fixed depending on number of decimals

  2. std::cin delimits automatically by spaces.

  3. std::cin can be chained

    std::cin >> a >> b;

    populates first and second token to a and b respectively

Things to be care of, to avoid TLE

  1. Try calculating big O of algorithm
  2. Try using simple hash
  3. Try using DP

Shorthands that are useful

  1. #define ii pair<int, int> storing two integers, useful in 2d-mazes. Access elements by first and second

  2. #define vii vector<pair<int, int>> storing ii in vectors

Problems I’m able to solve

  • math-based
  • general knowledge
  • dp

Problems I’m unable to solve

  • advanced graphing
  • pathing

Completion list (math) (js/node) (math) (math) (string algo) (maze/graph/hard edgecases) (math) (math) (tsp, obviously) (math) (math/hacks)

Uncompletion list (maze/graph)