Skip to content

Commit

Permalink
Second update as of 24 June 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellDash332 committed Jun 24, 2024
1 parent 7247d82 commit 7beac79
Show file tree
Hide file tree
Showing 10 changed files with 192 additions and 39 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Kattis Solutions
![Visitors](https://count.getloli.com/get/@RussellDash332)

## Total problems solved: 2429
## Total problems solved: 2433

Note that the tables below are auto-generated using [autokattis](https://github.com/RussellDash332/autokattis).

Expand Down Expand Up @@ -294,6 +294,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Bread Sorting](https://open.kattis.com/problems/bread)| bread |4.8|[![py](images/python.png)]()|
|[Breaking Bad](https://open.kattis.com/problems/breakingbad)| breakingbad |3.3|[![py](images/python.png)]()|
|[Breaking Branches](https://open.kattis.com/problems/breakingbranches)| breakingbranches |1.7|[![py](images/python.png)]()|
|[Breaking Cake](https://open.kattis.com/problems/breakingcake)| breakingcake |5.7|[![py](images/python.png)](src/Breaking%20Cake/breakingcake.py)|
|[Brexit](https://open.kattis.com/problems/brexit)| brexit |3.0|[![py](images/python.png)]()|
|[Brexit Negotiations](https://open.kattis.com/problems/brexitnegotiations)| brexitnegotiations |5.2|[![py](images/python.png)]()|
|[Bribe](https://open.kattis.com/problems/bribe)| bribe |5.6|[![py](images/python.png)](src/Bribe/bribe.py)|
Expand Down Expand Up @@ -380,8 +381,8 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Catering](https://open.kattis.com/problems/catering)| catering |4.0|[![py](images/python.png)]()|
|[A Feast For Cats](https://open.kattis.com/problems/cats)| cats |3.6|[![java](images/java.png)]()|
|[Cat vs. Dog](https://open.kattis.com/problems/catvsdog)| catvsdog |6.0|[![py](images/python.png)](src/Cat%20vs.%20Dog/catvsdog.py)|
|[Cave Exploration](https://open.kattis.com/problems/caveexploration)| caveexploration |3.1|[![py](images/python.png)]()|
|[Cave Exploration](https://open.kattis.com/problems/caveexploration2)| caveexploration2 |4.0|[![py](images/python.png)]()|
|[Cave Exploration (1)](https://open.kattis.com/problems/caveexploration)| caveexploration |3.1|[![py](images/python.png)]()|
|[Cave Exploration (2)](https://open.kattis.com/problems/caveexploration2)| caveexploration2 |4.0|[![py](images/python.png)]()|
|[CD](https://open.kattis.com/problems/cd)| cd |4.3|[![py](images/python.png)]()|
|[Ceiling Function](https://open.kattis.com/problems/ceiling)| ceiling |2.2|[![py](images/python.png)]()|
|[Celebrity Split](https://open.kattis.com/problems/celebritysplit)| celebritysplit |8.2|[![py](images/python.png)](src/Celebrity%20Split/celebritysplit.py)|
Expand Down Expand Up @@ -511,8 +512,8 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Convex Hull (1)](https://open.kattis.com/problems/convexhull)| convexhull |4.1|[![py](images/python.png)]()|
|[Convex Hull (2)](https://open.kattis.com/problems/convexhull2)| convexhull2 |7.1|[![py](images/python.png)](src/Convex%20Hull%20(2)/convexhull2.py)|
|[Convex Polygon Area](https://open.kattis.com/problems/convexpolygonarea)| convexpolygonarea |2.0|[![cpp](images/cpp.png)]()|
|[Conveyor Belts](https://open.kattis.com/problems/conveyorbelts)| conveyorbelts |4.9|[![py](images/python.png)]()|
|[Conveyor Belts](https://open.kattis.com/problems/conveyorbelts2)| conveyorbelts2 |5.5|[![py](images/python.png)](src/Conveyor%20Belts/conveyorbelts2.py)|
|[Conveyor Belts (1)](https://open.kattis.com/problems/conveyorbelts)| conveyorbelts |4.9|[![py](images/python.png)]()|
|[Conveyor Belts (2)](https://open.kattis.com/problems/conveyorbelts2)| conveyorbelts2 |5.5|[![py](images/python.png)](src/Conveyor%20Belts%20(2)/conveyorbelts2.py)|
|[Convoy](https://open.kattis.com/problems/convoy)| convoy |4.3|[![py](images/python.png)]()|
|[Cookie Cutters](https://open.kattis.com/problems/cookiecutter)| cookiecutter |2.3|[![py](images/python.png)]()|
|[Cookie Selection](https://open.kattis.com/problems/cookieselection)| cookieselection |5.0|[![java](images/java.png)]()|
Expand Down Expand Up @@ -691,6 +692,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Driving Lanes](https://open.kattis.com/problems/drivinglanes)| drivinglanes |3.6|[![py](images/python.png)]()|
|[Driving Range](https://open.kattis.com/problems/drivingrange)| drivingrange |3.9|[![java](images/java.png)]()|
|[DRM Messages](https://open.kattis.com/problems/drmmessages)| drmmessages |1.6|[![cpp](images/cpp.png)]()|
|[Dropping Ball](https://open.kattis.com/problems/droppingball2)| droppingball2 |4.3|[![py](images/python.png)]()|
|[Dropping Directions](https://open.kattis.com/problems/droppingdirections)| droppingdirections |3.7|[![py](images/python.png)]()|
|[Drunk Vigenère](https://open.kattis.com/problems/drunkvigenere)| drunkvigenere |1.7|[![cpp](images/cpp.png)]()|
|[Daylight Saving Time](https://open.kattis.com/problems/dst)| dst |2.2|[![py](images/python.png)]()|
Expand Down Expand Up @@ -943,6 +945,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Gandalf's Spell](https://open.kattis.com/problems/gandalfsspell)| gandalfsspell |2.1|[![py](images/python.png)]()|
|[Gangur](https://open.kattis.com/problems/gangur)| gangur |2.7|[![py](images/python.png)]()|
|[Gas Station Numbers](https://open.kattis.com/problems/gasstationnumbers)| gasstationnumbers |7.9|[![py](images/python.png)](src/Gas%20Station%20Numbers/gasstationnumbers.py)|
|[Gathering in Yorknew](https://open.kattis.com/problems/gatheringinyorknew)| gatheringinyorknew |5.9|[![py](images/python.png)](src/Gathering%20in%20Yorknew/gatheringinyorknew.py)|
|[GCD](https://open.kattis.com/problems/gcd)| gcd |1.5|[![py](images/python.png)]()|
|[GCD and LCM](https://open.kattis.com/problems/gcdandlcm)| gcdandlcm |6.3|[![py](images/python.png)](src/GCD%20and%20LCM/gcdandlcm.py)|
|[GCDs](https://open.kattis.com/problems/gcds)| gcds |5.0|[![py](images/python.png)]()|
Expand Down Expand Up @@ -1058,7 +1061,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Heart Rate](https://open.kattis.com/problems/heartrate)| heartrate |1.5|[![cpp](images/cpp.png)]()|
|[Heating Up](https://open.kattis.com/problems/heatingup)| heatingup |6.1|[![py](images/python.png)]()|
|[Height Ordering](https://open.kattis.com/problems/height)| height |2.1|[![py](images/python.png)]()|
|[Homework](https://open.kattis.com/problems/heimavinna)| heimavinna |1.6|[![cpp](images/cpp.png)]()|
|[Homework (1)](https://open.kattis.com/problems/heimavinna)| heimavinna |1.6|[![cpp](images/cpp.png)]()|
|[Heir's Dilemma](https://open.kattis.com/problems/heirsdilemma)| heirsdilemma |1.7|[![py](images/python.png)]()|
|[Heliocentric](https://open.kattis.com/problems/heliocentric)| heliocentric |2.1|[![py](images/python.png)]()|
|[Hello World!](https://open.kattis.com/problems/hello)| hello |1.1|[![c](images/c.png)]()[![cpp](images/cpp.png)]()[![go](images/go.png)]()[![java](images/java.png)]()[![js](images/javascript.png)]()[![kt](images/kotlin.png)]()[![php](images/php.png)]()[![py](images/python.png)]()[![rb](images/ruby.png)]()|
Expand Down Expand Up @@ -1095,7 +1098,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Hogwarts](https://open.kattis.com/problems/hogwarts2)| hogwarts2 |5.1|[![py](images/python.png)]()|
|[Holey N-Queens (Batman)](https://open.kattis.com/problems/holeynqueensbatman)| holeynqueensbatman |2.6|[![py](images/python.png)]()|
|[Holiday Stars](https://open.kattis.com/problems/holidaystars)| holidaystars |6.0|[![py](images/python.png)](src/Holiday%20Stars/holidaystars.py)|
|[Homework](https://open.kattis.com/problems/homework)| homework |7.1|[![py](images/python.png)](src/Homework/homework.py)|
|[Homework (2)](https://open.kattis.com/problems/homework)| homework |7.1|[![py](images/python.png)](src/Homework%20(2)/homework.py)|
|[Honeycomb Walk](https://open.kattis.com/problems/honey)| honey |2.9|[![py](images/python.png)]()|
|[Honey Heist](https://open.kattis.com/problems/honeyheist)| honeyheist |3.5|[![py](images/python.png)]()|
|[Honi](https://open.kattis.com/problems/honi)| honi |3.0|[![py](images/python.png)]()|
Expand Down Expand Up @@ -1177,7 +1180,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Interplanetary Tunnels](https://open.kattis.com/problems/interplanetarytunnels)| interplanetarytunnels |2.2|[![py](images/python.png)]()|
|[Interpreter](https://open.kattis.com/problems/interpreter)| interpreter |3.6|[![py](images/python.png)]()|
|[Interval Cover](https://open.kattis.com/problems/intervalcover)| intervalcover |5.1|[![py](images/python.png)](src/Interval%20Cover/intervalcover.py)|
|[Interval Scheduling](https://open.kattis.com/problems/intervalscheduling)| intervalscheduling |1.8|[![java](images/java.png)]()[![py](images/python.png)]()|
|[Interval Scheduling (1)](https://open.kattis.com/problems/intervalscheduling)| intervalscheduling |1.8|[![java](images/java.png)]()[![py](images/python.png)]()|
|[Interview Question](https://open.kattis.com/problems/interviewquestion)| interviewquestion |3.1|[![py](images/python.png)]()|
|[Interview Queue](https://open.kattis.com/problems/interviewqueue)| interviewqueue |7.5|[![py](images/python.png)](src/Interview%20Queue/interviewqueue.py)|
|[Integer Rotation](https://open.kattis.com/problems/introtation)| introtation |6.1|[![py](images/python.png)](src/Integer%20Rotation/introtation.py)|
Expand Down Expand Up @@ -2131,6 +2134,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Subway Planning](https://open.kattis.com/problems/subwayplanning)| subwayplanning |2.2|[![py](images/python.png)]()|
|[Successful Zoom](https://open.kattis.com/problems/successfulzoom)| successfulzoom |2.4|[![py](images/python.png)]()|
|[Succession](https://open.kattis.com/problems/succession)| succession |3.1|[![py](images/python.png)]()|
|[Sudokunique](https://open.kattis.com/problems/sudokunique)| sudokunique |8.7|[![py](images/python.png)](src/Sudokunique/sudokunique.py)|
|[Suffix Array Re-construction](https://open.kattis.com/problems/suffixarrayreconstruction)| suffixarrayreconstruction |3.9|[![py](images/python.png)](src/Suffix%20Array%20Re-construction/suffixarrayreconstruction.py)|
|[Suffix Sorting](https://open.kattis.com/problems/suffixsorting)| suffixsorting |5.6|[![c](images/c.png)](src/Suffix%20Sorting/suffixsorting.c)[![cpp](images/cpp.png)](src/Suffix%20Sorting/suffixsorting.cpp)[![py](images/python.png)](src/Suffix%20Sorting/suffixsorting.py)|
|[Šuma](https://open.kattis.com/problems/suma)| suma |6.4|[![py](images/python.png)](src/Šuma/suma.py)|
Expand Down Expand Up @@ -2161,8 +2165,8 @@ For more Python data structure implementations, head over to [pytils](https://gi
|[Tajna](https://open.kattis.com/problems/tajna)| tajna |2.1|[![py](images/python.png)]()|
|[Takk fyrir mig](https://open.kattis.com/problems/takkfyrirmig)| takkfyrirmig |1.2|[![py](images/python.png)]()|
|[Talnalás](https://open.kattis.com/problems/talnalas)| talnalas |4.0|[![py](images/python.png)]()|
|[Target Practice (2)](https://open.kattis.com/problems/target)| target |6.7|[![py](images/python.png)](src/Target%20Practice%20(2)/target.py)|
|[Target Practice (1)](https://open.kattis.com/problems/targetpractice)| targetpractice |4.6|[![py](images/python.png)]()|
|[Target Practice (1)](https://open.kattis.com/problems/target)| target |6.7|[![py](images/python.png)](src/Target%20Practice%20(1)/target.py)|
|[Target Practice (2)](https://open.kattis.com/problems/targetpractice)| targetpractice |4.6|[![py](images/python.png)]()|
|[Tarifa](https://open.kattis.com/problems/tarifa)| tarifa |1.4|[![java](images/java.png)]()[![py](images/python.png)]()|
|[Tautology](https://open.kattis.com/problems/tautology)| tautology |3.0|[![py](images/python.png)]()|
|[Taxi Cab Scheme](https://open.kattis.com/problems/taxicab)| taxicab |5.8|[![py](images/python.png)](src/Taxi%20Cab%20Scheme/taxicab.py)|
Expand Down Expand Up @@ -2461,7 +2465,7 @@ These problems can only be found in NUS Kattis and therefore do not contribute t
|[Graph Data Structure 1](https://nus.kattis.com/problems/graphds1)| graphds1 |[![py](images/python.png)]()|
|[Hard Array Problem](https://nus.kattis.com/problems/hardarray)| hardarray |[![java](images/java.png)]()|
|[Hero Leveling](https://nus.kattis.com/problems/heroleveling)| heroleveling |[![cpp](images/cpp.png)]()|
|[Interval Scheduling](https://nus.kattis.com/problems/intervalscheduling2)| intervalscheduling2 |[![py](images/python.png)]()|
|[Interval Scheduling (2)](https://nus.kattis.com/problems/intervalscheduling2)| intervalscheduling2 |[![py](images/python.png)]()|
|[Joining Points](https://nus.kattis.com/problems/joiningpoints)| joiningpoints |[![py](images/python.png)]()|
|[Journey of the Repetitor](https://nus.kattis.com/problems/journeyoftherepetitor)| journeyoftherepetitor |[![py](images/python.png)]()|
|[Key Item Recovery](https://nus.kattis.com/problems/keyitemrecovery)| keyitemrecovery |[![py](images/python.png)]()|
Expand Down
4 changes: 4 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
nus_readme_contents = []
open_html_contents = []
nus_html_contents = []
paths = set(); duplicate_paths = set()

# Go through local files
for main_dir in ['src', 'Secret']:
Expand Down Expand Up @@ -104,8 +105,11 @@
else:
open_readme_contents.append([pid, f"|[{path}]({url})| {pid} |{''.join(readme_image_links).replace(' ','%20')}|\n"])
open_html_contents.append([pid, url, path, html_image_links])
if path in paths: duplicate_paths.add(path)
paths.add(path)

# Sanity check before writing
assert not duplicate_paths, duplicate_paths
assert not diff_mapper, diff_mapper
assert not nus_problems, nus_problems
print('Mapper exists:', diff_mapper != None)
Expand Down
98 changes: 85 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5202,6 +5202,24 @@ <h2>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/breakingcake">
Breaking Cake
</a>
</td>
<td>
breakingcake
</td>
<td>
5.7
</td>
<td>
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Breaking Cake/breakingcake.py">
<img alt="py" src="images/python.png"/>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/brexit">
Expand Down Expand Up @@ -6777,7 +6795,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/caveexploration">
Cave Exploration
Cave Exploration (1)
</a>
</td>
<td>
Expand All @@ -6795,7 +6813,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/caveexploration2">
Cave Exploration
Cave Exploration (2)
</a>
</td>
<td>
Expand Down Expand Up @@ -9150,7 +9168,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/conveyorbelts">
Conveyor Belts
Conveyor Belts (1)
</a>
</td>
<td>
Expand All @@ -9168,7 +9186,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/conveyorbelts2">
Conveyor Belts
Conveyor Belts (2)
</a>
</td>
<td>
Expand All @@ -9178,7 +9196,7 @@ <h2>
5.5
</td>
<td>
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Conveyor Belts/conveyorbelts2.py">
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Conveyor Belts (2)/conveyorbelts2.py">
<img alt="py" src="images/python.png"/>
</a>
</td>
Expand Down Expand Up @@ -12438,6 +12456,24 @@ <h2>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/droppingball2">
Dropping Ball
</a>
</td>
<td>
droppingball2
</td>
<td>
4.3
</td>
<td>
<a href="#">
<img alt="py" src="images/python.png"/>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/droppingdirections">
Expand Down Expand Up @@ -17004,6 +17040,24 @@ <h2>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/gatheringinyorknew">
Gathering in Yorknew
</a>
</td>
<td>
gatheringinyorknew
</td>
<td>
5.9
</td>
<td>
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Gathering in Yorknew/gatheringinyorknew.py">
<img alt="py" src="images/python.png"/>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/gcd">
Expand Down Expand Up @@ -19080,7 +19134,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/heimavinna">
Homework
Homework (1)
</a>
</td>
<td>
Expand Down Expand Up @@ -19770,7 +19824,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/homework">
Homework
Homework (2)
</a>
</td>
<td>
Expand All @@ -19780,7 +19834,7 @@ <h2>
7.1
</td>
<td>
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Homework/homework.py">
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Homework (2)/homework.py">
<img alt="py" src="images/python.png"/>
</a>
</td>
Expand Down Expand Up @@ -21249,7 +21303,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/intervalscheduling">
Interval Scheduling
Interval Scheduling (1)
</a>
</td>
<td>
Expand Down Expand Up @@ -38613,6 +38667,24 @@ <h2>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/sudokunique">
Sudokunique
</a>
</td>
<td>
sudokunique
</td>
<td>
8.7
</td>
<td>
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Sudokunique/sudokunique.py">
<img alt="py" src="images/python.png"/>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/suffixarrayreconstruction">
Expand Down Expand Up @@ -39171,7 +39243,7 @@ <h2>
<tr>
<td>
<a href="https://open.kattis.com/problems/target">
Target Practice (2)
Target Practice (1)
</a>
</td>
<td>
Expand All @@ -39181,15 +39253,15 @@ <h2>
6.7
</td>
<td>
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Target Practice (2)/target.py">
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Target Practice (1)/target.py">
<img alt="py" src="images/python.png"/>
</a>
</td>
</tr>
<tr>
<td>
<a href="https://open.kattis.com/problems/targetpractice">
Target Practice (1)
Target Practice (2)
</a>
</td>
<td>
Expand Down Expand Up @@ -44468,7 +44540,7 @@ <h2>
<tr>
<td>
<a href="https://nus.kattis.com/problems/intervalscheduling2">
Interval Scheduling
Interval Scheduling (2)
</a>
</td>
<td>
Expand Down
18 changes: 18 additions & 0 deletions src/Breaking Cake/breakingcake.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys; input = sys.stdin.readline; from collections import *
while True:
try: X, Y, Z, N = map(int, input().split()); R = {}; A = {}
except: break
for _ in range(N):
x, y, z = map(int, input().split())
if x not in R: R[x] = {}
if y not in R[x]: R[x][y] = []
R[x][y].append(z); A[(x, y, z)] = len(A)
print('YES'); sx = 1; mx = max(R); C = [None]*N
for x in sorted(R):
ex = x if x != mx else X; sy = 1; my = max(R[x])
for y in sorted(R[x]):
ey = y if y != my else Y; sz = 1; mz = max(R[x][y])
for z in sorted(R[x][y]): C[A[(x, y, z)]] = (sx, sy, sz, ex, ey, z if z != mz else Z); sz = z+1
sy = y+1
sx = x+1
for c in C: print(*c)
Loading

0 comments on commit 7beac79

Please sign in to comment.