Skip to content

t3nsor/SPOJ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 30, 2024
97a3757 · Oct 30, 2024
Oct 30, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 10, 2014
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Dec 25, 2023
Oct 8, 2014
Oct 8, 2014
Dec 25, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Dec 25, 2023
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Sep 15, 2022
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 14, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 27, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Sep 8, 2024
Oct 8, 2014
Feb 27, 2024
Oct 8, 2014
Sep 1, 2024
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Apr 4, 2024
Jan 13, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 2, 2023
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Apr 17, 2023
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Dec 17, 2023
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Sep 4, 2024
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 29, 2024
Jan 30, 2015
Apr 29, 2016
Oct 8, 2014
Mar 25, 2024
Jan 6, 2024
Jan 30, 2015
Feb 13, 2024
Aug 18, 2024
Oct 7, 2024
Jan 30, 2015
Dec 25, 2023
Oct 8, 2014
Aug 2, 2022
Aug 2, 2022
Oct 8, 2014
Oct 8, 2014
Sep 5, 2024
Jul 25, 2024
Oct 8, 2014
Oct 19, 2023
Oct 8, 2014
Aug 13, 2021
Aug 7, 2022
Sep 11, 2022
Sep 11, 2022
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 5, 2024
Oct 8, 2014
Oct 12, 2024
Jan 8, 2024
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Dec 29, 2023
Jan 30, 2015
Oct 8, 2014
Dec 12, 2023
Nov 15, 2023
Nov 20, 2023
Nov 20, 2023
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Oct 21, 2023
Jan 30, 2015
Sep 5, 2024
Sep 20, 2024
Nov 9, 2023
Oct 8, 2014
Sep 22, 2024
Oct 3, 2023
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Dec 25, 2023
Jan 30, 2015
Jan 30, 2015
Apr 5, 2024
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Sep 20, 2024
Oct 23, 2023
Sep 24, 2021
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Sep 25, 2023
Dec 25, 2023
Oct 8, 2014
Sep 24, 2021
Dec 25, 2023
Mar 3, 2024
Sep 29, 2023
Dec 11, 2023
Oct 8, 2014
Apr 17, 2023
Mar 18, 2024
Oct 7, 2024
Jan 30, 2015
Apr 14, 2017
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Aug 19, 2021
Jan 30, 2015
Oct 21, 2023
Jan 30, 2015
Jan 30, 2015
Dec 25, 2023
Oct 8, 2014
Jan 4, 2024
Oct 8, 2014
Oct 7, 2021
Aug 23, 2022
Nov 5, 2015
Oct 8, 2014
Sep 23, 2024
Dec 25, 2023
Sep 29, 2021
Jan 30, 2015
Oct 8, 2014
Sep 8, 2024
Feb 17, 2024
Mar 11, 2024
Oct 20, 2024
Jan 30, 2015
Oct 8, 2014
Aug 15, 2022
Oct 22, 2023
Oct 8, 2014
Aug 18, 2021
Jan 30, 2015
Dec 28, 2022
Dec 28, 2022
Apr 16, 2024
Oct 8, 2014
May 11, 2024
Dec 25, 2023
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Sep 3, 2024
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Oct 21, 2023
Jan 30, 2015
Aug 6, 2022
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 28, 2023
Feb 9, 2024
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Jan 5, 2024
Jan 30, 2015
Sep 6, 2024
Oct 8, 2014
Feb 14, 2024
Sep 20, 2022
Aug 19, 2024
Oct 25, 2023
Oct 11, 2021
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 13, 2023
Oct 8, 2014
Oct 8, 2014
Oct 23, 2023
Jan 30, 2015
Dec 23, 2023
Oct 8, 2014
Oct 23, 2023
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Sep 23, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Aug 21, 2022
Jan 30, 2015
Mar 10, 2024
Jan 30, 2015
Oct 21, 2023
Apr 9, 2023
Oct 30, 2024
Oct 30, 2024
Jan 30, 2015
Feb 18, 2024
Oct 8, 2014
Dec 26, 2023
Oct 8, 2014
Dec 25, 2023
Jan 30, 2015
Jul 2, 2016
Oct 8, 2014
Sep 23, 2024
Oct 8, 2014
Jul 9, 2017
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Apr 7, 2023
Dec 25, 2023
Dec 25, 2023
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 21, 2023
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Feb 12, 2024
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 30, 2023
Oct 8, 2014
Oct 8, 2014
Dec 25, 2023
Oct 21, 2023
Oct 8, 2014
Feb 8, 2024
Jan 30, 2015
Jul 27, 2024
Jan 8, 2024
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Dec 25, 2023
Feb 16, 2024
Oct 27, 2016
Apr 2, 2023
Oct 8, 2014
Feb 27, 2024
Dec 25, 2023
Aug 31, 2022
Oct 8, 2014
Mar 10, 2024
Jan 30, 2015
Mar 2, 2024
Aug 18, 2024
Aug 19, 2021
Oct 20, 2023
Oct 20, 2023
Jan 30, 2015
Feb 25, 2024
Oct 8, 2014
Aug 18, 2021
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Oct 30, 2023
Oct 8, 2014
Oct 8, 2014
Aug 19, 2021
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 2, 2021
Sep 2, 2024
Sep 26, 2021
May 28, 2024
Oct 8, 2014
Sep 3, 2024
Jan 29, 2023
Dec 17, 2023
Oct 8, 2014
Jan 30, 2015
Sep 1, 2024
Jan 30, 2015
Jan 30, 2015
Nov 2, 2023
Nov 2, 2023
Dec 25, 2023
Dec 25, 2023
Oct 8, 2014
Oct 8, 2014
Oct 21, 2023
Mar 11, 2024
Jan 30, 2015
Dec 25, 2023
Oct 8, 2014
Apr 5, 2024
Dec 25, 2023
Sep 30, 2024
Oct 8, 2014
Sep 24, 2024
Sep 30, 2024
Oct 8, 2014
Nov 22, 2023
Oct 8, 2014
Sep 11, 2023
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Feb 8, 2024
Jul 25, 2016
Oct 8, 2014
Oct 8, 2014
Jan 24, 2024
Mar 21, 2024
Nov 14, 2023
Nov 14, 2023
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Aug 16, 2024
Dec 18, 2023
Oct 8, 2014
Jan 30, 2015
Oct 21, 2023
Oct 8, 2014
Oct 4, 2023
Dec 25, 2023
Mar 10, 2024
Apr 5, 2023
Oct 28, 2024
Oct 8, 2014
Jan 30, 2015
Aug 16, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 12, 2023
Oct 8, 2014
Sep 2, 2024
Dec 23, 2023
Feb 17, 2024
Jan 30, 2015
Feb 13, 2024
Dec 29, 2023
Oct 8, 2014
Apr 2, 2023
Aug 21, 2024
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Sep 15, 2022
Apr 4, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Nov 21, 2023
Oct 25, 2024
Feb 24, 2024
Dec 25, 2023
Oct 8, 2014
Dec 25, 2023
Oct 8, 2014
Oct 8, 2014
Aug 23, 2022
Oct 8, 2014
Oct 21, 2023
Dec 25, 2023
Oct 8, 2014
Jan 30, 2015
Dec 25, 2023
Oct 8, 2014
Jan 30, 2015
Apr 7, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Sep 4, 2024
Apr 30, 2016
Oct 21, 2023
Oct 8, 2014
Oct 11, 2021
Oct 8, 2014
Dec 25, 2023
Oct 30, 2023
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Aug 16, 2024
Oct 8, 2014
Nov 3, 2023
Dec 21, 2023
Jan 30, 2015
Dec 23, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 9, 2014
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Dec 25, 2023
Dec 25, 2023
Dec 25, 2023
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Mar 12, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Sep 2, 2024
Oct 22, 2024
Oct 8, 2014
Dec 27, 2023
Dec 27, 2023
Sep 8, 2024
Sep 26, 2023
Jul 29, 2024
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Sep 24, 2023
Sep 25, 2023
Oct 14, 2023
Apr 29, 2016
Oct 8, 2014
Apr 3, 2023
Apr 4, 2024
Sep 20, 2024
Jan 30, 2015
Mar 25, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Oct 25, 2023
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Jan 8, 2024
Feb 8, 2024
Oct 8, 2014
Apr 4, 2023
Oct 15, 2023
Sep 28, 2021
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Jan 7, 2024
Jan 7, 2024
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Nov 2, 2023
Oct 8, 2014
Oct 8, 2014
Sep 7, 2024
Jan 4, 2024
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Dec 23, 2023
Apr 15, 2018
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 13, 2023
Oct 8, 2014
Oct 8, 2014
Dec 23, 2023
Aug 20, 2024
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Apr 29, 2016
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Dec 25, 2023
Oct 8, 2014
Oct 8, 2014
Jan 18, 2023
Sep 6, 2024
Jan 30, 2015
Feb 26, 2024
Aug 14, 2022
Jan 30, 2015
Oct 8, 2014
Oct 8, 2023
Dec 24, 2023
Oct 11, 2021
Oct 8, 2014
Aug 7, 2024
Oct 21, 2023
Mar 26, 2023
Oct 8, 2014
Mar 11, 2024
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 15, 2023
Dec 25, 2023
Oct 8, 2014
Mar 9, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Aug 13, 2024
Oct 8, 2014
Dec 25, 2023
Jan 30, 2015
Oct 8, 2014
Aug 11, 2021
Aug 11, 2021
Oct 8, 2014
Apr 17, 2023
Mar 10, 2024
Oct 8, 2014
Dec 21, 2023
Oct 8, 2014
Sep 25, 2021
Jan 30, 2015
Sep 24, 2021
Dec 31, 2022
Oct 8, 2014
Oct 13, 2024
Oct 16, 2024
Aug 4, 2024
Sep 2, 2024
Mar 21, 2023
Aug 20, 2024
Oct 8, 2014
Oct 15, 2023
Jan 30, 2015
Aug 7, 2022
Jan 30, 2015
Oct 8, 2014
Oct 9, 2023
Dec 25, 2023
Mar 25, 2023
Oct 14, 2023
Sep 9, 2024
Oct 8, 2014
Mar 2, 2024
Sep 3, 2024
Dec 25, 2023
Mar 26, 2023
Jan 30, 2015
Oct 21, 2023
Oct 8, 2014
Oct 8, 2014
Aug 31, 2024
Mar 28, 2023
Jan 30, 2015
Sep 11, 2022
Oct 11, 2023
Jan 30, 2015
Oct 8, 2014
Oct 8, 2014
May 28, 2024
Jan 30, 2015
Dec 25, 2023
Oct 8, 2014
Dec 24, 2023
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Sep 26, 2021
Dec 29, 2023
Oct 8, 2014
Apr 7, 2023
Feb 14, 2024
Apr 5, 2024
Jan 30, 2015
Jan 30, 2015
Mar 10, 2024
Oct 8, 2014
Oct 8, 2014
Aug 31, 2024
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Oct 8, 2014
Aug 20, 2024
Oct 8, 2014
Oct 21, 2023
Jan 30, 2015
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Jan 30, 2015
Feb 19, 2024
Apr 5, 2024
Mar 3, 2024
Apr 3, 2023
Mar 9, 2024
Sep 2, 2024
Apr 1, 2024
Apr 1, 2024
Aug 21, 2024
Oct 11, 2021
Aug 23, 2022
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Sep 2, 2024
Aug 20, 2021
Jan 30, 2015
Jan 30, 2015
Oct 8, 2014
Mar 26, 2023
Oct 8, 2014
Oct 8, 2014
Oct 8, 2014
Jan 30, 2015
Jan 7, 2024
Aug 14, 2024
Oct 8, 2014
Sep 8, 2024
Mar 12, 2024
May 28, 2024
Oct 15, 2023
Dec 19, 2018
Oct 8, 2014
Oct 23, 2023
Oct 21, 2023
Oct 8, 2014
Oct 2, 2023
Oct 15, 2023
Oct 8, 2014
Sep 29, 2023
Jan 30, 2015
Oct 8, 2014
May 8, 2020
Jan 30, 2015
Oct 8, 2014
Oct 30, 2024
Oct 23, 2023
Oct 8, 2014
Nov 3, 2023
Oct 8, 2014
Oct 8, 2014
Apr 16, 2024

Repository files navigation

SPOJ

This repository contains solutions to almost all problems I have solved on SPOJ. They're intended as a last resort in case you've tried very hard to solve a problem but you just haven't been able to figure it out. When I was trying to solve GSS2, I mostly found vague hints on online forums, which weren't helpful. I wasn't able to solve the problem until after I looked at some code. So obviously the code helps, and there can be good reasons to just look at code rather than being stuck indefinitely.

Some of the files in this repository differ from my submitted solutions in relatively trivial ways, such as the removal of commented-out code or #ifdef'd code for an archaic compiler I used to use (Microsoft Visual C++ 6.0). However, I suspect some of them simply don't work because either they contained errors that I corrected while away from home (so the changes were not saved locally) or I made modifications locally that turned out to give incorrect solutions and forgot to revert to the older versions. If you discover an incorrect solution, please leave a comment so I can fix it!

The copyright notice (LICENSE) applies to all code except for a few algorithms copied from the Stanford ACM team notebook, which are indicated as such. There is technically no license for that code that I'm aware of, but it's unlikely you'll get into any trouble for using it or redistributing it freely. A recent version of the Stanford ACM team notebook can be found here.

There is a comment at the beginning of each file that gives the date on which the solution was submitted. Caution: Many of the older solutions have bad coding style and poor mastery of C++.

For a few problems I have multiple solutions, usually because after my first successful submission I discovered there was a much better way to solve the problem. Those are indicated as e.g. niceday-1.cpp and niceday-2.cpp. There is no possible ambiguity as SPOJ problem names aren't allowed to contain dashes (as far as I know, anyway).