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

https://open.kattis.com/problems/bits (cs) https://open.kattis.com/problems/guessinggame https://open.kattis.com/problems/tourdefrance (edge case with whole numbers) https://open.kattis.com/problems/treasurehunt (maze) https://open.kattis.com/problems/throwns (ds, edge case with neg) https://open.kattis.com/problems/variablearithmetic (string manipulation in c++) https://open.kattis.com/problems/arithmetic (cs) https://open.kattis.com/problems/alldifferentdirections https://open.kattis.com/problems/areyoulistening

Uncompletion list

https://open.kattis.com/problems/bard (WA) https://open.kattis.com/problems/continuousmedian (WA) https://open.kattis.com/problems/narrowartgallery (no solution)