Jan 2020 Kattis
January 01, 20202 mins 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
-
map.insert
doesn’t replace value if it exists had to insert and then find and replace againusing
map['foo'] = bar
is simpler -
#include <iomanip>
DOCS for various io manipulation, such assetw
,setfill
,hex
, anduppercase
Things to be careful of, to avoid TLE
Shorthands that are useful
-
define query variables as global antipattern IRL, but we are problem-solving instead of software building :P
-
#define psi pair<string, int>
for map usage -
stringstream ss(query)
is useful if needed to tokenize -
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)