Skip to content

Commit 7beac79

Browse files
Second update as of 24 June 2024
1 parent 7247d82 commit 7beac79

File tree

10 files changed

+192
-39
lines changed

10 files changed

+192
-39
lines changed

README.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Kattis Solutions
22
![Visitors](https://count.getloli.com/get/@RussellDash332)
33

4-
## Total problems solved: 2429
4+
## Total problems solved: 2433
55

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

@@ -294,6 +294,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
294294
|[Bread Sorting](https://open.kattis.com/problems/bread)| bread |4.8|[![py](images/python.png)]()|
295295
|[Breaking Bad](https://open.kattis.com/problems/breakingbad)| breakingbad |3.3|[![py](images/python.png)]()|
296296
|[Breaking Branches](https://open.kattis.com/problems/breakingbranches)| breakingbranches |1.7|[![py](images/python.png)]()|
297+
|[Breaking Cake](https://open.kattis.com/problems/breakingcake)| breakingcake |5.7|[![py](images/python.png)](src/Breaking%20Cake/breakingcake.py)|
297298
|[Brexit](https://open.kattis.com/problems/brexit)| brexit |3.0|[![py](images/python.png)]()|
298299
|[Brexit Negotiations](https://open.kattis.com/problems/brexitnegotiations)| brexitnegotiations |5.2|[![py](images/python.png)]()|
299300
|[Bribe](https://open.kattis.com/problems/bribe)| bribe |5.6|[![py](images/python.png)](src/Bribe/bribe.py)|
@@ -380,8 +381,8 @@ For more Python data structure implementations, head over to [pytils](https://gi
380381
|[Catering](https://open.kattis.com/problems/catering)| catering |4.0|[![py](images/python.png)]()|
381382
|[A Feast For Cats](https://open.kattis.com/problems/cats)| cats |3.6|[![java](images/java.png)]()|
382383
|[Cat vs. Dog](https://open.kattis.com/problems/catvsdog)| catvsdog |6.0|[![py](images/python.png)](src/Cat%20vs.%20Dog/catvsdog.py)|
383-
|[Cave Exploration](https://open.kattis.com/problems/caveexploration)| caveexploration |3.1|[![py](images/python.png)]()|
384-
|[Cave Exploration](https://open.kattis.com/problems/caveexploration2)| caveexploration2 |4.0|[![py](images/python.png)]()|
384+
|[Cave Exploration (1)](https://open.kattis.com/problems/caveexploration)| caveexploration |3.1|[![py](images/python.png)]()|
385+
|[Cave Exploration (2)](https://open.kattis.com/problems/caveexploration2)| caveexploration2 |4.0|[![py](images/python.png)]()|
385386
|[CD](https://open.kattis.com/problems/cd)| cd |4.3|[![py](images/python.png)]()|
386387
|[Ceiling Function](https://open.kattis.com/problems/ceiling)| ceiling |2.2|[![py](images/python.png)]()|
387388
|[Celebrity Split](https://open.kattis.com/problems/celebritysplit)| celebritysplit |8.2|[![py](images/python.png)](src/Celebrity%20Split/celebritysplit.py)|
@@ -511,8 +512,8 @@ For more Python data structure implementations, head over to [pytils](https://gi
511512
|[Convex Hull (1)](https://open.kattis.com/problems/convexhull)| convexhull |4.1|[![py](images/python.png)]()|
512513
|[Convex Hull (2)](https://open.kattis.com/problems/convexhull2)| convexhull2 |7.1|[![py](images/python.png)](src/Convex%20Hull%20(2)/convexhull2.py)|
513514
|[Convex Polygon Area](https://open.kattis.com/problems/convexpolygonarea)| convexpolygonarea |2.0|[![cpp](images/cpp.png)]()|
514-
|[Conveyor Belts](https://open.kattis.com/problems/conveyorbelts)| conveyorbelts |4.9|[![py](images/python.png)]()|
515-
|[Conveyor Belts](https://open.kattis.com/problems/conveyorbelts2)| conveyorbelts2 |5.5|[![py](images/python.png)](src/Conveyor%20Belts/conveyorbelts2.py)|
515+
|[Conveyor Belts (1)](https://open.kattis.com/problems/conveyorbelts)| conveyorbelts |4.9|[![py](images/python.png)]()|
516+
|[Conveyor Belts (2)](https://open.kattis.com/problems/conveyorbelts2)| conveyorbelts2 |5.5|[![py](images/python.png)](src/Conveyor%20Belts%20(2)/conveyorbelts2.py)|
516517
|[Convoy](https://open.kattis.com/problems/convoy)| convoy |4.3|[![py](images/python.png)]()|
517518
|[Cookie Cutters](https://open.kattis.com/problems/cookiecutter)| cookiecutter |2.3|[![py](images/python.png)]()|
518519
|[Cookie Selection](https://open.kattis.com/problems/cookieselection)| cookieselection |5.0|[![java](images/java.png)]()|
@@ -691,6 +692,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
691692
|[Driving Lanes](https://open.kattis.com/problems/drivinglanes)| drivinglanes |3.6|[![py](images/python.png)]()|
692693
|[Driving Range](https://open.kattis.com/problems/drivingrange)| drivingrange |3.9|[![java](images/java.png)]()|
693694
|[DRM Messages](https://open.kattis.com/problems/drmmessages)| drmmessages |1.6|[![cpp](images/cpp.png)]()|
695+
|[Dropping Ball](https://open.kattis.com/problems/droppingball2)| droppingball2 |4.3|[![py](images/python.png)]()|
694696
|[Dropping Directions](https://open.kattis.com/problems/droppingdirections)| droppingdirections |3.7|[![py](images/python.png)]()|
695697
|[Drunk Vigenère](https://open.kattis.com/problems/drunkvigenere)| drunkvigenere |1.7|[![cpp](images/cpp.png)]()|
696698
|[Daylight Saving Time](https://open.kattis.com/problems/dst)| dst |2.2|[![py](images/python.png)]()|
@@ -943,6 +945,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
943945
|[Gandalf's Spell](https://open.kattis.com/problems/gandalfsspell)| gandalfsspell |2.1|[![py](images/python.png)]()|
944946
|[Gangur](https://open.kattis.com/problems/gangur)| gangur |2.7|[![py](images/python.png)]()|
945947
|[Gas Station Numbers](https://open.kattis.com/problems/gasstationnumbers)| gasstationnumbers |7.9|[![py](images/python.png)](src/Gas%20Station%20Numbers/gasstationnumbers.py)|
948+
|[Gathering in Yorknew](https://open.kattis.com/problems/gatheringinyorknew)| gatheringinyorknew |5.9|[![py](images/python.png)](src/Gathering%20in%20Yorknew/gatheringinyorknew.py)|
946949
|[GCD](https://open.kattis.com/problems/gcd)| gcd |1.5|[![py](images/python.png)]()|
947950
|[GCD and LCM](https://open.kattis.com/problems/gcdandlcm)| gcdandlcm |6.3|[![py](images/python.png)](src/GCD%20and%20LCM/gcdandlcm.py)|
948951
|[GCDs](https://open.kattis.com/problems/gcds)| gcds |5.0|[![py](images/python.png)]()|
@@ -1058,7 +1061,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
10581061
|[Heart Rate](https://open.kattis.com/problems/heartrate)| heartrate |1.5|[![cpp](images/cpp.png)]()|
10591062
|[Heating Up](https://open.kattis.com/problems/heatingup)| heatingup |6.1|[![py](images/python.png)]()|
10601063
|[Height Ordering](https://open.kattis.com/problems/height)| height |2.1|[![py](images/python.png)]()|
1061-
|[Homework](https://open.kattis.com/problems/heimavinna)| heimavinna |1.6|[![cpp](images/cpp.png)]()|
1064+
|[Homework (1)](https://open.kattis.com/problems/heimavinna)| heimavinna |1.6|[![cpp](images/cpp.png)]()|
10621065
|[Heir's Dilemma](https://open.kattis.com/problems/heirsdilemma)| heirsdilemma |1.7|[![py](images/python.png)]()|
10631066
|[Heliocentric](https://open.kattis.com/problems/heliocentric)| heliocentric |2.1|[![py](images/python.png)]()|
10641067
|[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)]()|
@@ -1095,7 +1098,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
10951098
|[Hogwarts](https://open.kattis.com/problems/hogwarts2)| hogwarts2 |5.1|[![py](images/python.png)]()|
10961099
|[Holey N-Queens (Batman)](https://open.kattis.com/problems/holeynqueensbatman)| holeynqueensbatman |2.6|[![py](images/python.png)]()|
10971100
|[Holiday Stars](https://open.kattis.com/problems/holidaystars)| holidaystars |6.0|[![py](images/python.png)](src/Holiday%20Stars/holidaystars.py)|
1098-
|[Homework](https://open.kattis.com/problems/homework)| homework |7.1|[![py](images/python.png)](src/Homework/homework.py)|
1101+
|[Homework (2)](https://open.kattis.com/problems/homework)| homework |7.1|[![py](images/python.png)](src/Homework%20(2)/homework.py)|
10991102
|[Honeycomb Walk](https://open.kattis.com/problems/honey)| honey |2.9|[![py](images/python.png)]()|
11001103
|[Honey Heist](https://open.kattis.com/problems/honeyheist)| honeyheist |3.5|[![py](images/python.png)]()|
11011104
|[Honi](https://open.kattis.com/problems/honi)| honi |3.0|[![py](images/python.png)]()|
@@ -1177,7 +1180,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
11771180
|[Interplanetary Tunnels](https://open.kattis.com/problems/interplanetarytunnels)| interplanetarytunnels |2.2|[![py](images/python.png)]()|
11781181
|[Interpreter](https://open.kattis.com/problems/interpreter)| interpreter |3.6|[![py](images/python.png)]()|
11791182
|[Interval Cover](https://open.kattis.com/problems/intervalcover)| intervalcover |5.1|[![py](images/python.png)](src/Interval%20Cover/intervalcover.py)|
1180-
|[Interval Scheduling](https://open.kattis.com/problems/intervalscheduling)| intervalscheduling |1.8|[![java](images/java.png)]()[![py](images/python.png)]()|
1183+
|[Interval Scheduling (1)](https://open.kattis.com/problems/intervalscheduling)| intervalscheduling |1.8|[![java](images/java.png)]()[![py](images/python.png)]()|
11811184
|[Interview Question](https://open.kattis.com/problems/interviewquestion)| interviewquestion |3.1|[![py](images/python.png)]()|
11821185
|[Interview Queue](https://open.kattis.com/problems/interviewqueue)| interviewqueue |7.5|[![py](images/python.png)](src/Interview%20Queue/interviewqueue.py)|
11831186
|[Integer Rotation](https://open.kattis.com/problems/introtation)| introtation |6.1|[![py](images/python.png)](src/Integer%20Rotation/introtation.py)|
@@ -2131,6 +2134,7 @@ For more Python data structure implementations, head over to [pytils](https://gi
21312134
|[Subway Planning](https://open.kattis.com/problems/subwayplanning)| subwayplanning |2.2|[![py](images/python.png)]()|
21322135
|[Successful Zoom](https://open.kattis.com/problems/successfulzoom)| successfulzoom |2.4|[![py](images/python.png)]()|
21332136
|[Succession](https://open.kattis.com/problems/succession)| succession |3.1|[![py](images/python.png)]()|
2137+
|[Sudokunique](https://open.kattis.com/problems/sudokunique)| sudokunique |8.7|[![py](images/python.png)](src/Sudokunique/sudokunique.py)|
21342138
|[Suffix Array Re-construction](https://open.kattis.com/problems/suffixarrayreconstruction)| suffixarrayreconstruction |3.9|[![py](images/python.png)](src/Suffix%20Array%20Re-construction/suffixarrayreconstruction.py)|
21352139
|[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)|
21362140
|[Šuma](https://open.kattis.com/problems/suma)| suma |6.4|[![py](images/python.png)](src/Šuma/suma.py)|
@@ -2161,8 +2165,8 @@ For more Python data structure implementations, head over to [pytils](https://gi
21612165
|[Tajna](https://open.kattis.com/problems/tajna)| tajna |2.1|[![py](images/python.png)]()|
21622166
|[Takk fyrir mig](https://open.kattis.com/problems/takkfyrirmig)| takkfyrirmig |1.2|[![py](images/python.png)]()|
21632167
|[Talnalás](https://open.kattis.com/problems/talnalas)| talnalas |4.0|[![py](images/python.png)]()|
2164-
|[Target Practice (2)](https://open.kattis.com/problems/target)| target |6.7|[![py](images/python.png)](src/Target%20Practice%20(2)/target.py)|
2165-
|[Target Practice (1)](https://open.kattis.com/problems/targetpractice)| targetpractice |4.6|[![py](images/python.png)]()|
2168+
|[Target Practice (1)](https://open.kattis.com/problems/target)| target |6.7|[![py](images/python.png)](src/Target%20Practice%20(1)/target.py)|
2169+
|[Target Practice (2)](https://open.kattis.com/problems/targetpractice)| targetpractice |4.6|[![py](images/python.png)]()|
21662170
|[Tarifa](https://open.kattis.com/problems/tarifa)| tarifa |1.4|[![java](images/java.png)]()[![py](images/python.png)]()|
21672171
|[Tautology](https://open.kattis.com/problems/tautology)| tautology |3.0|[![py](images/python.png)]()|
21682172
|[Taxi Cab Scheme](https://open.kattis.com/problems/taxicab)| taxicab |5.8|[![py](images/python.png)](src/Taxi%20Cab%20Scheme/taxicab.py)|
@@ -2461,7 +2465,7 @@ These problems can only be found in NUS Kattis and therefore do not contribute t
24612465
|[Graph Data Structure 1](https://nus.kattis.com/problems/graphds1)| graphds1 |[![py](images/python.png)]()|
24622466
|[Hard Array Problem](https://nus.kattis.com/problems/hardarray)| hardarray |[![java](images/java.png)]()|
24632467
|[Hero Leveling](https://nus.kattis.com/problems/heroleveling)| heroleveling |[![cpp](images/cpp.png)]()|
2464-
|[Interval Scheduling](https://nus.kattis.com/problems/intervalscheduling2)| intervalscheduling2 |[![py](images/python.png)]()|
2468+
|[Interval Scheduling (2)](https://nus.kattis.com/problems/intervalscheduling2)| intervalscheduling2 |[![py](images/python.png)]()|
24652469
|[Joining Points](https://nus.kattis.com/problems/joiningpoints)| joiningpoints |[![py](images/python.png)]()|
24662470
|[Journey of the Repetitor](https://nus.kattis.com/problems/journeyoftherepetitor)| journeyoftherepetitor |[![py](images/python.png)]()|
24672471
|[Key Item Recovery](https://nus.kattis.com/problems/keyitemrecovery)| keyitemrecovery |[![py](images/python.png)]()|

build.py

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
nus_readme_contents = []
3939
open_html_contents = []
4040
nus_html_contents = []
41+
paths = set(); duplicate_paths = set()
4142

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

108111
# Sanity check before writing
112+
assert not duplicate_paths, duplicate_paths
109113
assert not diff_mapper, diff_mapper
110114
assert not nus_problems, nus_problems
111115
print('Mapper exists:', diff_mapper != None)

docs/index.html

+85-13
Original file line numberDiff line numberDiff line change
@@ -5202,6 +5202,24 @@ <h2>
52025202
</a>
52035203
</td>
52045204
</tr>
5205+
<tr>
5206+
<td>
5207+
<a href="https://open.kattis.com/problems/breakingcake">
5208+
Breaking Cake
5209+
</a>
5210+
</td>
5211+
<td>
5212+
breakingcake
5213+
</td>
5214+
<td>
5215+
5.7
5216+
</td>
5217+
<td>
5218+
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Breaking Cake/breakingcake.py">
5219+
<img alt="py" src="images/python.png"/>
5220+
</a>
5221+
</td>
5222+
</tr>
52055223
<tr>
52065224
<td>
52075225
<a href="https://open.kattis.com/problems/brexit">
@@ -6777,7 +6795,7 @@ <h2>
67776795
<tr>
67786796
<td>
67796797
<a href="https://open.kattis.com/problems/caveexploration">
6780-
Cave Exploration
6798+
Cave Exploration (1)
67816799
</a>
67826800
</td>
67836801
<td>
@@ -6795,7 +6813,7 @@ <h2>
67956813
<tr>
67966814
<td>
67976815
<a href="https://open.kattis.com/problems/caveexploration2">
6798-
Cave Exploration
6816+
Cave Exploration (2)
67996817
</a>
68006818
</td>
68016819
<td>
@@ -9150,7 +9168,7 @@ <h2>
91509168
<tr>
91519169
<td>
91529170
<a href="https://open.kattis.com/problems/conveyorbelts">
9153-
Conveyor Belts
9171+
Conveyor Belts (1)
91549172
</a>
91559173
</td>
91569174
<td>
@@ -9168,7 +9186,7 @@ <h2>
91689186
<tr>
91699187
<td>
91709188
<a href="https://open.kattis.com/problems/conveyorbelts2">
9171-
Conveyor Belts
9189+
Conveyor Belts (2)
91729190
</a>
91739191
</td>
91749192
<td>
@@ -9178,7 +9196,7 @@ <h2>
91789196
5.5
91799197
</td>
91809198
<td>
9181-
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Conveyor Belts/conveyorbelts2.py">
9199+
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Conveyor Belts (2)/conveyorbelts2.py">
91829200
<img alt="py" src="images/python.png"/>
91839201
</a>
91849202
</td>
@@ -12438,6 +12456,24 @@ <h2>
1243812456
</a>
1243912457
</td>
1244012458
</tr>
12459+
<tr>
12460+
<td>
12461+
<a href="https://open.kattis.com/problems/droppingball2">
12462+
Dropping Ball
12463+
</a>
12464+
</td>
12465+
<td>
12466+
droppingball2
12467+
</td>
12468+
<td>
12469+
4.3
12470+
</td>
12471+
<td>
12472+
<a href="#">
12473+
<img alt="py" src="images/python.png"/>
12474+
</a>
12475+
</td>
12476+
</tr>
1244112477
<tr>
1244212478
<td>
1244312479
<a href="https://open.kattis.com/problems/droppingdirections">
@@ -17004,6 +17040,24 @@ <h2>
1700417040
</a>
1700517041
</td>
1700617042
</tr>
17043+
<tr>
17044+
<td>
17045+
<a href="https://open.kattis.com/problems/gatheringinyorknew">
17046+
Gathering in Yorknew
17047+
</a>
17048+
</td>
17049+
<td>
17050+
gatheringinyorknew
17051+
</td>
17052+
<td>
17053+
5.9
17054+
</td>
17055+
<td>
17056+
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Gathering in Yorknew/gatheringinyorknew.py">
17057+
<img alt="py" src="images/python.png"/>
17058+
</a>
17059+
</td>
17060+
</tr>
1700717061
<tr>
1700817062
<td>
1700917063
<a href="https://open.kattis.com/problems/gcd">
@@ -19080,7 +19134,7 @@ <h2>
1908019134
<tr>
1908119135
<td>
1908219136
<a href="https://open.kattis.com/problems/heimavinna">
19083-
Homework
19137+
Homework (1)
1908419138
</a>
1908519139
</td>
1908619140
<td>
@@ -19770,7 +19824,7 @@ <h2>
1977019824
<tr>
1977119825
<td>
1977219826
<a href="https://open.kattis.com/problems/homework">
19773-
Homework
19827+
Homework (2)
1977419828
</a>
1977519829
</td>
1977619830
<td>
@@ -19780,7 +19834,7 @@ <h2>
1978019834
7.1
1978119835
</td>
1978219836
<td>
19783-
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Homework/homework.py">
19837+
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Homework (2)/homework.py">
1978419838
<img alt="py" src="images/python.png"/>
1978519839
</a>
1978619840
</td>
@@ -21249,7 +21303,7 @@ <h2>
2124921303
<tr>
2125021304
<td>
2125121305
<a href="https://open.kattis.com/problems/intervalscheduling">
21252-
Interval Scheduling
21306+
Interval Scheduling (1)
2125321307
</a>
2125421308
</td>
2125521309
<td>
@@ -38613,6 +38667,24 @@ <h2>
3861338667
</a>
3861438668
</td>
3861538669
</tr>
38670+
<tr>
38671+
<td>
38672+
<a href="https://open.kattis.com/problems/sudokunique">
38673+
Sudokunique
38674+
</a>
38675+
</td>
38676+
<td>
38677+
sudokunique
38678+
</td>
38679+
<td>
38680+
8.7
38681+
</td>
38682+
<td>
38683+
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Sudokunique/sudokunique.py">
38684+
<img alt="py" src="images/python.png"/>
38685+
</a>
38686+
</td>
38687+
</tr>
3861638688
<tr>
3861738689
<td>
3861838690
<a href="https://open.kattis.com/problems/suffixarrayreconstruction">
@@ -39171,7 +39243,7 @@ <h2>
3917139243
<tr>
3917239244
<td>
3917339245
<a href="https://open.kattis.com/problems/target">
39174-
Target Practice (2)
39246+
Target Practice (1)
3917539247
</a>
3917639248
</td>
3917739249
<td>
@@ -39181,15 +39253,15 @@ <h2>
3918139253
6.7
3918239254
</td>
3918339255
<td>
39184-
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Target Practice (2)/target.py">
39256+
<a href="https://raw.githubusercontent.com/RussellDash332/kattis/main/src/Target Practice (1)/target.py">
3918539257
<img alt="py" src="images/python.png"/>
3918639258
</a>
3918739259
</td>
3918839260
</tr>
3918939261
<tr>
3919039262
<td>
3919139263
<a href="https://open.kattis.com/problems/targetpractice">
39192-
Target Practice (1)
39264+
Target Practice (2)
3919339265
</a>
3919439266
</td>
3919539267
<td>
@@ -44468,7 +44540,7 @@ <h2>
4446844540
<tr>
4446944541
<td>
4447044542
<a href="https://nus.kattis.com/problems/intervalscheduling2">
44471-
Interval Scheduling
44543+
Interval Scheduling (2)
4447244544
</a>
4447344545
</td>
4447444546
<td>

src/Breaking Cake/breakingcake.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import sys; input = sys.stdin.readline; from collections import *
2+
while True:
3+
try: X, Y, Z, N = map(int, input().split()); R = {}; A = {}
4+
except: break
5+
for _ in range(N):
6+
x, y, z = map(int, input().split())
7+
if x not in R: R[x] = {}
8+
if y not in R[x]: R[x][y] = []
9+
R[x][y].append(z); A[(x, y, z)] = len(A)
10+
print('YES'); sx = 1; mx = max(R); C = [None]*N
11+
for x in sorted(R):
12+
ex = x if x != mx else X; sy = 1; my = max(R[x])
13+
for y in sorted(R[x]):
14+
ey = y if y != my else Y; sz = 1; mz = max(R[x][y])
15+
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
16+
sy = y+1
17+
sx = x+1
18+
for c in C: print(*c)

0 commit comments

Comments
 (0)