Main Logo
Current Projects
All Projects

CSCE 420: Competitive Programming

Coursework Disclaimer: This project is coursework that is reused year to year; Details are left somewhat vague so as to not provide answers.

Or more correctly Problem Solving Strategies

CSCE 420 is a newer course, focused on Problem Solving Strategies. We just did problem off of Kattis and got graded on them. Every week we had a lab and a leaderboard. It wasn't a competition, but when there is a time limit and a leaderboard it tends to turn into one. Over the course of the semester we attempted about 140 problems of which I successfully completed 120 or so.

This space is reserved for discussing some of my favorite problems. For obvious reasons I'm not going to publish GitHub. However, I'm not even going to share problem names. I know people look for hints on anything and am not going to help that.

I will share a strategy I employed several times: precomputing. Kattis grades you on runtime and limits you to some small file size (16KiB?) of bytes. However, there are a handful of problems that have an input space smaller than that. In these cases it may be faster to pre-compute results.

Look: a thing I said I wouldn't do:

Lucky Number has an input space of 1000 but an output space of only 26 elements (zero occurs many times). This can be solved very efficiently via a case statement.

A extension of this is to use raw strings to embed an array of compressed binary data in the maximally efficient manner. This allows you to tune very very close to the file size limit in the case of say an input space of 10000 integers with an output in the range 0-255. A word of warning if you go down the raw string route: you editor may do funny things like replacing line endings. A simple `\n` conversion to `\r\n` will change the position of everything in the array after the line ending. You have been warned.

LinkedIn Logo
GitHub Logo
GrabCad Logo
Questions? Comments? Contact:
Spencer Gautreaux
Copyright 2022 Spencer Gautreaux. All Rights Reserved.