Ken Lee, thoughts and et cetera

Jan 2020 Kattis

January 01, 20201 min read

Just before 2019 ended, Jen and I set out to review and plan our one-year resolution for the year of 2020, AKA, new year resolution. As part of my list of resolutions, I had set myself to reach a certain goal in kattis. It will be a busy yet exciting year ahead :)

Things to be careful of, to avoid WA

  1. map.insert doesn’t replace value if it exists had to insert and then find and replace again

    using map['foo'] = bar is simpler

  2. #include <iomanip> DOCS for various io manipulation, such as setw, setfill, hex, and uppercase

Things to be careful of, to avoid TLE

Shorthands that are useful

  1. define query variables as global antipattern IRL, but we are problem-solving instead of software building :P

  2. #define psi pair<string, int> for map usage

  3. stringstream ss(query) is useful if needed to tokenize

  4. stream.peek() == EOF can be used to detect if EOF

Completion list (cs) (edge case with whole numbers) (maze) (ds, edge case with neg) (string manipulation in c++) (cs)

Uncompletion list (WA) (WA) (no solution)