Compare commits

...

5 Commits

Author SHA1 Message Date
f6460c8fd3 d10 part 1 and remanents of part 2 2025-12-12 14:28:13 -05:00
94f0cd13ff day 7, examples, and other junk 2025-12-12 11:13:26 -05:00
516ecb07de day 8 2025-12-12 11:11:58 -05:00
8425f18435 day 6 psl (i must have missed) 2025-12-12 08:49:14 -05:00
4a44b1c136 day9 done 2025-12-12 08:48:22 -05:00
27 changed files with 6050 additions and 10 deletions

2
src/plasl/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
a
blink.log

200
src/plasl/2025/day10/input Normal file
View File

@@ -0,0 +1,200 @@
[..#.##.##] (0,1,2,3,4,5,8) (2,3,5,7) (2,5,6,7) (0,3,4,5,6,7,8) (0,2,4,6,7,8) (0,1,2,4,5,8) (0,2,4,5,6) (0,1,3,4,7,8) (0,1) (2,3,6) {55,25,58,54,55,53,44,43,42}
[##..#..] (0,3) (0,1,2,5,6) (0,1,2,4,5) (1,3,4,6) (1,2,3,4,5) (1,6) (1,2,4,5) (0,5) (3,4,5,6) {151,96,61,49,74,197,61}
[.##..#.] (4,5) (0,1,3,6) (0,1,2,3,5,6) (1,2,5) (0,1,4,6) (0,1,2,5,6) {31,42,19,20,8,21,31}
[#...###] (1,4,6) (0,2,4,5,6) (0,1,2,3,5,6) (2,3,5) (1,4,5) {11,18,26,16,27,27,27}
[##...###] (0,1,3,4,5,6,7) (1,2,3,5,6,7) (0,5) (0,2,3,5,7) (2,3,4,5,7) (1,3,4,5,6) (0,1,3,4,6) (1,5,6) (3,5) {158,192,24,194,174,81,192,35}
[.#.##...#] (1,2) (1,3,7,8) (1,2,5,7) (4,7) (1,2,4,5,6,7) (0,1,2,3,5,6,8) (0,3,4,5,6,7,8) {22,156,139,39,6,134,25,132,39}
[.#..] (0,1,2) (0,3) (1,2) (3) (0,2) {47,24,44,16}
[#...#] (1,2,3,4) (0,2) (0,1,2,3) {4,2,6,2,2}
[..#.] (1,3) (0,3) (0,2,3) {33,7,14,40}
[.#.#..##.#] (0,4,5,6) (2,7) (4,5) (0,1,2,3,4,5,6,7) (0,1,2,3,5,6,7,8) (1,3,8) (1,3,5,9) (0) (0,2,3,4,6,8) (0,8) (4,5,6,8) (0,1,4,5,6,7,8,9) (0,2,3,4,5,6,7,9) {82,38,35,35,52,58,60,39,51,9}
[##.##] (0,2,3) (1,2) (1,2,3) (0,1,4) {22,22,36,36,4}
[#####....] (0,1,2,4,5,7) (6) (4,5) (0,1,2,5,6,7,8) (0,3,5,6,7,8) (0,1) (0,2,5,8) (0,1,2,3,4,6,8) (8) (1,3,4,6) (1,4,8) {163,146,35,26,33,46,40,33,39}
[..#.##...] (1,2,6,7,8) (1,2,5,6,7,8) (0,1) (0,1,3,4,5,8) (1,3,4,5,7) (2,3,4,6,7,8) (3,4,5) (0,3,6,8) {17,36,16,23,21,34,18,21,22}
[..#.] (0,2) (1,2) (0,2,3) (0,3) (0,1) (0) {26,9,14,12}
[.#.#] (1,3) (0,2,3) {13,16,13,29}
[#....#.##.] (3,8) (2) (1,2,5,6,8) (0,1,3,4,5,6,8) (1,2) (0,3) (0,5,9) (7,8) (1,4,9) (0,1,3,4,5,7,8,9) (4,6,7,8) (1,5) {26,36,20,20,29,32,28,23,34,18}
[#.####] (0,1,2,4) (1,2,3) (0,1,3) (1,3) (0,4) (5) (3,4,5) (1,5) {32,58,12,42,25,24}
[..#.##..##] (0,3,4,7,8) (0,1,3,4,5,6,8,9) (2,3,4) (6,9) (0,1,2,4,5,6,9) (0,5,7,8,9) (4,5,8) (4) {39,29,29,34,84,46,31,10,39,31}
[.#..#..] (1,4,5) (3,5,6) (2,5) (0,2,3,4,6) (1,3,4,5,6) (0,4) (0,1,4,5,6) {22,40,8,28,45,64,45}
[#...] (0) (0,1) (0,2) (0,3) (2) {39,14,23,5}
[.##..#] (0,1,4) (0,1,4,5) (1,2,5) (0,2,5) (1,2,4,5) (0,1,2,3,5) (2,3) {53,63,51,31,34,49}
[.#...] (1,2,3,4) (3) (0,3,4) (1) (0,2) (1,3) (3,4) {23,149,16,50,18}
[.#..#] (0,1,2) (0,2,3,4) (1,3) (2,3) (1,4) {10,31,17,15,22}
[##########] (0,2,5,6,7) (2,5,6,7,9) (0,3,4,5,6,8) (1,4) (1,6,8) (2,3,4,5,6,7) (0,1,2,3,4,6) (0,1,3,4,8) (1,4,5,6,7,8,9) (2,4,5,6,8) {42,49,54,54,87,55,77,27,57,11}
[.#.#.#.] (2,4) (0,5) (1,2,5,6) (0,1,3) (0,1,4,5,6) {22,25,13,3,23,25,22}
[.####..#] (3,5,6) (1,5,7) (0,3,4,7) (0,1,3,6) (0,2,4,6,7) (0,4) (0,1,3,5) {57,33,15,43,35,35,31,38}
[.##.#] (1,2,4) (0,1,3) (1,2) {7,35,28,7,9}
[####.] (0,1,2,3) (0,3,4) (0,2,3) (0,1,2) (2,3,4) {126,20,132,133,8}
[###..#...#] (3,6,7) (1,2,6) (0,2,3,4,5,6,9) (1) (0,1,2,5,6,7) (0,1,2,3,6,7,8,9) (0,1,2,3,5,6,8,9) (1,2,3,4,5,6,8,9) (0,5,6,8,9) (1,2,4,7,9) (0,3,8,9) (0,2,4,5,6,7,8) (2,3,5,6,8,9) {56,74,68,51,33,39,58,48,52,69}
[.#..##.##.] (1,3,5,7,8,9) (1,3,4,5,6,7,8,9) (3,8) (0,1,4,5,7) (1,3,6,8,9) (0,2,3,4,6,7,8,9) (4,7,8) (1,5) (0,1,2,3,4,5,6,8) (4,6,7,8) {27,60,19,56,49,44,47,39,74,29}
[......##] (0,1,2,7) (0,1,2,3,4,5,7) (0,1,3,4,6,7) (1,2,3,5,6) (0,2,3,6) (1,4,6,7) {47,50,46,60,35,26,56,36}
[..##.#..] (0,1,2) (0,4) (2,3,5,7) (0,2,3,4,5,6) (0,1,3,4,6,7) (0,1,3,6,7) (5,6,7) (0,4,5,6,7) (0,2,3) {253,33,46,51,226,48,55,50}
[.#.#] (0,1,2) (1,3) {0,7,0,7}
[#...#...#] (6) (5,7) (0,1,3,4,6,7,8) (0,2,3,6,7,8) (0,1,5,8) (2,7) (0,1,4,8) (4,5,6) (0,4,5,6,7,8) {44,16,26,15,27,45,48,59,44}
[#..##..] (0,1,2,4,5,6) (3,4,5) (0,1,3,4,5,6) (1,4,5) (2) (0,1,3,4,5) (1) (2,3,5) (0,1,4,5,6) {44,54,30,20,55,57,40}
[..###...##] (0,2,5,6,8) (0,1,2,3,4,5,8,9) (2,3,4,5,7) (0,3,4,5,6,8,9) (2,7,9) (0,1,2,3,4,5,7,8,9) (1,7) (1,2,3,4,5,6,7,8,9) {30,37,48,54,54,59,39,57,44,48}
[..##.###] (0,1,2,3,4,5) (1,2,3,4,5) (0,4,5,7) (0,1,4,5,6,7) (0,2,4,5,7) (0,1,5,6) (1,4) (2,3,4,5,7) (0,3,5) {58,53,56,58,72,83,10,29}
[..###...] (1,2) (0,1,3,4,5,7) (3,4,5) (1,3,4) (0,6) (0,1,2,3,6) {10,39,20,29,23,4,10,0}
[.#....##] (2,3,5) (1,2,3,4,6) (1,3,7) (1,2,3,4,6,7) (4,5) (0,4,6,7) {15,29,25,36,47,21,33,26}
[...#..] (0,1,2,4) (1,5) (0,2,5) (1,3) (0) (2,4,5) (0,2) (0,1,4,5) {168,183,164,18,158,39}
[...#.....] (0,2,4,5,6,7,8) (1,5,7,8) (0,1,6) (1,2,3,7,8) (0,4,5,6,7,8) (0,3,5,6,7,8) (1,2,6,7,8) (0,1,3,6,7,8) (1,2,3,4,5,6,7) (2,4) (0,1,2,7) {81,77,60,51,37,50,76,94,74}
[###..#..#.] (2,9) (0,2,4,6,7,9) (3,4,5,6,7,9) (0,2,3,6,7,8,9) (0,1,3,5,6,8,9) (0,1,4,5,6,7,8) (0,4,6) (3,8) (0,3,4,5,6,8,9) (0,1,2,5,6,8,9) (3,7) (0,1,2,5,6,9) {125,72,82,167,78,94,144,79,176,120}
[#.#####.] (0,1,3,5,7) (1,5,7) (2,4,6) (0,1,3,4,7) (1,3,5) (0,4,5) (0,1,2,4,6) (1,2,4,5,7) (1,2,3) (3,5,6) {48,69,36,41,57,59,20,47}
[#.#.#] (0,2,4) (1,2,4) (0,1,2) (1,3) {169,37,181,18,174}
[..##..##] (1,2) (1,3) (0,4,5,6) (5,6) (1,3,6,7) (1,2,3,4,6,7) (1,2,3,7) (1,4,5,6) (0,2,3,5) {27,67,44,56,34,45,54,33}
[###.....] (0,1,5,7) (0,2) (0,2,4,5,6,7) (3,4,6,7) (0,1,2,4,5,6,7) (1,7) {48,27,36,0,21,33,21,39}
[#....##] (1,2,4,5,6) (1,2,6) (0,2,3,5) (2,3,4,5,6) (0,2,4,5,6) (0,2,6) (0,1,3,5) (4,5) {35,43,65,13,36,46,63}
[.########] (3,4,5,6,7,8) (0,1,2,3,4,5,6) (0,2,5,6,8) (1,2,3,4,5,6,8) (1,3,4,5,6,7,8) (0,3,5,6,7,8) (0,2,3,4,6,8) (0,1,2,4,5,6,7) (2,3,5,6) (0,1,7) {38,39,37,69,69,58,75,49,56}
[##..#.] (2,3,4,5) (0,1,3,5) (1,5) (0,3,4) (2,4) {13,18,27,26,30,31}
[#...##.] (2,3) (1,4,6) (0,1,2,3,4,5,6) (1,5) (3,6) (3,5) {4,25,9,28,16,20,28}
[#####] (2,4) (0,3,4) (0,4) (2,3) (1,2,3) {16,0,24,29,24}
[.#.#.#] (1,2,5) (0,2,4,5) (0,1,2,3,4) (1,3,4) (0,4) {19,39,25,27,38,17}
[#......] (0,3,4,5,6) (1,5) (0,1,3) (0,2,3,6) (0,1,2,4,6) (1,2,3,4,5) {39,36,47,36,38,21,37}
[.##.####] (0,6) (0,5) (3,7) (0,1,3,4,6,7) (2,4,6) (1,2,3,5,7) (4,6,7) (1,4,5,6) {28,36,9,21,53,23,60,37}
[.###...] (3,4,5,6) (0,2,3,4,6) (0,2,3,6) (1,2,3,5) (2,4,6) (3,5,6) (0,4,5,6) (1,5) (1) {41,52,59,71,61,84,93}
[#..#..#.#.] (0,1,3,4,5,6,8,9) (0,3,6,8) (0,1,2,5) (4,5) (0,5) (1,2,3,6,7,9) (0,1,3,8) (1,3,9) {62,40,16,46,21,47,40,10,36,28}
[.#.###] (0,1,2,3) (1,3,5) (1,2,3,5) (2,5) (4) (0,1,2,3,5) (0,2,4,5) {28,26,48,26,19,48}
[#.##] (0,1,2) (0,2,3) (1) (2,3) {10,8,23,20}
[###..#.] (0,2,5) (0,1,2,6) (0,2,4,5,6) (0,3) (2,3,4,5,6) (1) (2,4) (2,4,6) {65,27,76,18,43,37,48}
[###..##] (0,1,2,6) (2,6) (1,3,6) (2,3,6) (2,3) (4,5) (0,1,4,6) {34,44,50,28,38,18,76}
[.##.#] (1,4) (1,2,4) (0,3,4) {2,14,4,2,16}
[###.] (0,1,2) (0,1,3) {115,115,12,103}
[..#.] (0,3) (2) (1,3) {17,16,9,33}
[....#.#] (0,3,5) (6) (1,2,4) (4,5,6) (1,2,4,5,6) (3,4,6) (0,2,3,4) (1,2,3,5,6) (4) {24,14,30,204,228,39,221}
[#..##] (2,4) (0,2) (0,1,2) (0,1,3,4) (2,3) (1,3) {30,27,176,172,18}
[#..#.#.] (0,1,2,4,5) (1,2,3,4) (0,1,3,5,6) (1,2,4,5,6) (3) {39,68,49,49,49,50,30}
[#.###.] (3,4,5) (2,4,5) (2,4) (0,2) (1,2) (0,3,4) (0,1) (0,3) {147,40,55,135,51,23}
[..##] (0,1) (0,2) (1,2,3) (1,3) (0,1,2) {206,195,38,6}
[#.#.##...#] (1,3,8,9) (3,5,6,7,8) (1,3,5,8,9) (0,2,8,9) (0,3,5,6,8) (1,3,4,5,7,8,9) (0,1,2,6,7,9) (0,2,3,4,5,6,7,9) (1,2,5,9) (0,1,4,5,6,7,8,9) (0,4,5,9) (2,6,7,8,9) {74,58,74,56,30,87,80,64,80,110}
[..#.] (1,2,3) (2,3) (2) (1) (0,2) {15,7,37,4}
[##..##] (1,2,3,4) (2,3,4) (0,2,5) (1,3) (2,3) {12,23,215,210,189,12}
[.####..#.#] (1,2,3,6) (0,2,3,4,5,6,8,9) (5,7,9) (1,2,3,5,6,7,8) (3,4,7) (0,1,2,3,4,5,7,8,9) (1,9) (1,3,6,8) (1,2,3,4,5,6,8,9) (0,6,7,8,9) (1,3,4,5,6,7) {23,69,48,69,45,68,64,52,57,56}
[..##] (2,3) (1) (0,2) (1,3) (1,2) {16,25,38,16}
[#.#....] (0,1,3,4,5) (1,2,3,5) (3,4,6) (1,2,4,5) (3,5,6) (0,3,5,6) (1,2,4,5,6) (0,1,2,5) {14,60,52,61,52,80,44}
[#..#..##.] (0,1,2,3,4,7) (1,2,3,4,5,6,7,8) (1,4) (2,4,5,6,7) (0,1,2,3,4,5,7,8) (0,2,3,5,6,7) (0,3) (2,3) (0,4,5,7) (3,5,6) {57,52,69,89,72,64,35,67,27}
[#.#.##] (3) (4,5) (1,2) (0,3) (4) (0,1,3,5) {15,12,10,176,20,8}
[....##] (3,4) (0,1,2,5) (0,3,4) (0,2) (0,1,2,3) (4,5) (1,2,5) {27,32,40,23,16,25}
[..#.###.##] (2,4,5,7,8) (0,6,9) (0,1,3,5,6,8,9) (0,2,4,5,6,7,8,9) (2,3,6,7,8) (0,1,2,3,4,5,6,7,8) (0,4,5,6,7,9) (2,3,4,5,7,8,9) (0,1,8,9) {78,34,37,32,54,67,69,57,62,76}
[#..##] (2,3) (1,4) (0,3,4) {5,13,16,21,18}
[####] (0,1,2,3) (0,2,3) {29,15,29,29}
[...#....##] (2,3,4,9) (3,5,9) (0,1,2,3,4) (2,3,5,6,7,8,9) (7,8) (3,4,9) (0,1,3,5,6) (0,1,2,6,9) (4,8) (8) (0,1,4,6) (1,2,3,4,8) (0,1,2,4,5,6,7) {74,74,68,60,69,42,68,31,27,51}
[##.###..##] (2,4,8) (5,6,7,8) (2,6,8) (0,4,6,7,8,9) (3,5,7) (0,2,3,4,5,6,8) (1,6) (1,2,3,4) (2,3,4) {9,20,52,44,39,24,38,15,32,0}
[.##...] (0,3,5) (1,2) (0,2) (0,4,5) (0,4) (0) (5) (1,2,3,5) {37,28,28,18,18,33}
[..#...#] (0,1,3,5) (0,2,5,6) (0,1,3) (4,5,6) (0,1,3,4,5,6) (2,6) (0,1,2,4,5) (0,4,5) {81,50,37,30,60,81,39}
[...######.] (0,3,4,5,6,7,8) (1,4,5,6) (1,2,3,6,7,8,9) (0,1,5,7,9) (9) (2,6) (4,5,8,9) (1,2,3,5,6,7,8,9) (0,1,2,4,5,6,7) (0,3,5,7) (0,2,3,5,6,8,9) (0,1,4) {69,48,28,33,49,67,44,46,31,55}
[###...##..] (2,6) (0,2,3,4,5,6,7,8,9) (0,1,2,5,6) (0,1,2,3,4,7,8,9) (0,1,4,5,6,9) (3,5) (0,2,9) (0,1,2,4,6,7) (6,9) (0,1,8,9) (0,1,2,3,4,5,8) {287,74,298,75,76,77,83,57,55,243}
[#....##.#] (1,3,5,8) (0,5,7) (0,2,7,8) (0,1,2,3,4,5,6,7) (5,7) (5,6,8) (1,7,8) (0,2,3,4,5,7,8) (0,3,4,5) (0,2,5,6) (0,6,7,8) {97,42,58,58,42,113,72,92,88}
[.#.##.#.#.] (2,6) (0,2,3,4,5,8,9) (0,1,3,5,6,7,8,9) (0,1,2,3,4,5,7,9) (2,9) (0,3,6,7,8) (1,2,3,5,7,8,9) (1,4) (0,1,3,4,5,6,7,8) (5,7,9) {61,61,46,71,58,59,52,61,62,42}
[###.###.] (0,3,5,6) (0,3,5,7) (1) (1,3,4,6) (0,1,4) (0,2,3,5,6,7) (3,4,7) (2,3,4,5,6) {177,24,153,190,33,178,180,152}
[#######.] (1,2,4,7) (1,2,3,5,6,7) (0,1,2,5,7) (2,3,6) (0,1,2,3,4,5,6) (0,1,2,5,6) {36,54,65,40,13,53,44,38}
[.#.#] (0,1,2) (1,3) {102,122,102,20}
[.####.] (3,4) (1,2) (0,3,4) (1,4,5) {2,33,13,109,129,20}
[...##..##] (0,1,2,3,5,6,7) (0,1,4,6) (0,1,5,8) (3,7,8) (1,2,3,4,5,6,7) (0,3,7,8) (0,1,2,4,6,7,8) (1,2,4,5,6,7,8) {52,189,182,51,167,168,187,198,165}
[.##..#..] (0,1) (1,2,3,6) (2,3,4,6,7) (1,2,6,7) (0,1,2,4,5,7) (0,4,7) (2,5,6,7) (2,3) {21,39,56,45,19,7,30,23}
[#.###] (1,2) (0,2,3,4) (0,1,2,3) (0,2,3) {166,30,177,166,141}
[#.##] (2,3) (0,1) (1,2,3) (0,2) {18,34,19,18}
[#.###.##.] (0,2,3,4,5,8) (1,2) (4,6) (0,3,4,6,7,8) (2,4,8) (0,3,5,7,8) (0,3,4,5,6,7,8) (0,6,7) (1,5,8) (0,1,2,4,5,8) (5,6) {45,16,203,26,216,51,33,29,229}
[.##.....##] (0,2,3,4,5,6,8,9) (0,1,2,5,6,7,8) (0,1,7) (6,7) (0,1,2,3,4,5,7,8,9) (3,4,8,9) (8,9) (0,1,2,3,4,5,7,8) (0,1,2,3,5,6,7) (2,4,9) (5,6,9) (0,1,2,5,6,7,9) {64,45,69,71,65,67,54,46,72,81}
[.#..] (0,2) (1,3) (0,1) (1) (0) (1,2) {26,182,5,14}
[#.##] (0,1) (0,1,2) (3) (0,2,3) (1,3) {36,44,22,52}
[##....] (1,4,5) (0,1,3,5) (1,2,4) (0,2,4) {16,33,9,15,19,25}
[#.##.##.#] (0,6) (3,8) (2,6,7) (0,1,2,4,6,7) (0,1,4,5,6,8) (0,1,2,3,4,7,8) (0,3,5,6,7) (0,3,6,8) (0,1,2,4,5,6,7) (0,6,7) (0,1,4,6,7) {68,52,47,45,52,18,67,61,50}
[##...] (0,3,4) (0,1) (2,3) (0,1,2,4) (0) {30,10,27,23,14}
[##.....#] (0,2,3,4,5) (1,2,6) (3,4,6,7) (0,1,7) (3,6,7) (0,1,2,3,4,5,7) (1,2,3,5) {132,43,133,170,134,132,39,64}
[##.#] (0,1,3) (0,1,2) {160,160,12,148}
[.#######] (0,1,3,6) (1,2,3,4,5,6,7) (0,1,3,5) (2,4,5) (0,1,2,4,6,7) (0,2,3,5,6,7) (0,1,2,3,4,6,7) (0,6,7) (1,6) (0,1,4,6) {92,83,64,61,62,37,111,75}
[#...] (0,1,3) (3) (1) (0,1,2) (0) (2) {22,21,5,25}
[.##.##] (2,3) (0,2,3,4) (0,1,3,5) (0,1,2,4) {28,8,34,40,21,7}
[##.#.#.#] (2,3,4,5,6,7) (0) (0,1,2,3,7) (0,1,4,7) (3,4,6,7) (1,4) (2,4,5,6,7) (2,6,7) {28,31,58,41,84,36,75,91}
[.#....] (2,4,5) (0,3) (0,1,2,4) (0,1) (0,2) (0,1,2,3,4) {239,31,31,216,23,6}
[#...###] (3,4,6) (1,2,4) (4,5,6) (0,2,3,5) (0,2,3,5,6) (0,4,5) (1,2,3,4,5) (1,2,3,4,6) {26,16,39,44,47,50,35}
[....##..] (0,3,4,5) (0,1,4,7) (2,6) (0,2,3,4,5,6,7) (1,2,3,4,7) (0,3,4,5,6,7) {22,21,37,31,37,16,22,27}
[##.##] (3,4) (2,3,4) (0,1,2,3) (0,1,3,4) (0,3) (0,2,4) (0,2) {65,17,46,56,52}
[.....#..#.] (0,1,2,4,6,7,8) (1,3,4,7) (2,4,9) (0,2,4,5,8,9) (0,4,5,7) (0,3,7,8,9) (0,1,2,3,6,8,9) (1,4,5,7,8) (1) (0,1,2,3,4,6,7,9) (6) {44,58,40,46,72,29,16,65,54,54}
[#.#.] (1,2) (0,3) (0,2) (0) (0,1,2) (2) {40,24,43,4}
[###...#..#] (2,5) (1,5,6,7) (1,2,4,6,8) (2,7,8) (1,6) (0,2,3,4,5,6,8,9) (1,7,8) (4,6,7,9) (1,3,4,7,8,9) (0,1,2,3,6,7,9) (0,6) (0,3,4,6,7,9) (1,3,5,6,7,8,9) {51,78,53,62,53,28,91,71,49,62}
[.#...#.] (0,1,4,5) (5) (0,1,2,3,6) (1,2,3,4,6) (0,6) (0,1,4) {177,180,29,29,168,17,43}
[...###.] (0,1) (3,4,5,6) (0,1,3,4,5,6) (1) (5,6) (2,4) (0,2,4) (0,1,3,4,5) (2,3,5) {40,38,33,68,71,76,47}
[#.###] (0,3) (0,2,3,4) (0,1,2,3,4) {35,9,20,35,20}
[#.#.#...#] (0,1,2,4,5,6,7) (5,6) (1,3,4,6) (0,1,2,5,6) (2,3,6,7,8) (0,1,2,3,4,5) (0,1,6,8) (0,2,4,6,7,8) (0,2,7) {68,57,78,37,47,42,91,59,34}
[###...#.##] (0,1,2,3,6,7,8,9) (4,6) (2,4,5,6,7,8,9) (0,1,4,5,6,7,8,9) (0,1,2,8,9) (0,2,4,5,6,7,8,9) (3,8) (1,5) (0,1,2,3,5,7,8,9) (1,7) (1,2,3,4,6,7,9) {203,209,52,45,202,212,222,222,238,220}
[..##...##.] (1,2,3,4,5,6,8,9) (2,3,7,8) (2,5,7) (1,2,3,4,5,6,7,9) (0,1,8,9) (0,1,2,4,8,9) (1,4,8) (0,2,6,8,9) (1,5,9) {26,59,48,21,40,40,20,30,29,57}
[.#.#..#...] (1,2,3,4,6,7,8,9) (0,2,4,6,9) (4,6,9) (0,1,2,5,6,7,8,9) (0,2,3,6,8) (0,7) (2,5,6,7) (0,1,5,6,7,8,9) (2,3,5,7,9) (1,2,6) (0,1,2,4,5,6,7,8) (4,6) {78,39,88,28,43,53,107,63,56,56}
[..#.#.] (2,4) (2,3,5) (1,4,5) (0,3,4,5) (0,1,3,5) (0,1,2,4) {35,33,41,34,55,47}
[...#...###] (1,3,6,8) (0,2,3,5,7,9) (0,1,6,7,8,9) (1,2,3,6,8,9) (0,1,3,7,9) (3,7,8,9) (0,2,3,4,7,8,9) (1,4,6,8) (1,6,9) {43,71,34,75,24,16,66,59,80,79}
[##.##] (0,1,2) (0,1,3,4) (1,4) {22,38,14,8,24}
[..#..#.] (0,1,2,3,4) (0,1,3,4,5) (1,4,5,6) (1,4) (0,1,2,5,6) {30,44,11,29,43,32,13}
[.#.#] (0,1,2,3) (1,3) (2,3) {17,28,21,32}
[#.#.] (0,2) (1,2,3) {4,10,14,10}
[..##.#] (0,3) (0,1,2,4) (2,3,5) (1,2,4,5) {12,4,14,22,4,14}
[##...#....] (1,3,4,6,7,8) (6,9) (0,1,2,3,4,6,9) (2,4) (0,1,2,3,6,7,8) (0,1,2,3,4,5,6,8) (0,3,4,6,8,9) (0,1,2,3,4,5,7) (5,6,7) (1,3,4,5,6,8,9) (0,3,6) {54,37,35,58,41,25,73,35,36,34}
[.#######] (1,3,6,7) (1,4,5) (0,3,4,6,7) (0,6,7) (1,3) (2,3,5,7) (2,4) {30,39,16,51,42,13,41,44}
[##....##.#] (6,8) (1,3,4,5,6,7) (1,2,3,4,5,6,7,8) (1,2,4,5,7,9) (0,1,2,5,6,7,9) (0,2,3,4,5,6,8,9) (0,1,5,6,7,8) (1,2,3,4) (2,9) (0,1,3,4,5,6) (0,2,5,6,7) (0,1,4,6,7,8,9) (1,2,3,8,9) {86,110,111,69,82,117,119,93,75,74}
[.#......#.] (1,7,8) (1,2,3,4,6,8) (1,2,3,4,5,7,8) (1,5,9) (2,3,4,5,6,7,8,9) (1,8,9) (0,1,2,3,4,5,6,9) (3,5,6,7) (0,3,5,6,9) (1,2,3,6,9) {31,61,64,81,53,60,74,25,42,66}
[#..#...] (1,3,4,5,6) (0,3,4,6) (2,6) (2,4) (1,4,6) (1,2) (2,3,4,5) {14,21,37,38,57,24,50}
[#####..] (0,1,2,3,4) (3,5) (4,6) (0,6) (2) (0,1,4,5) {26,23,38,20,144,7,124}
[#.#...##] (1,2,4,6) (0,1,2,4,5,6,7) (0,2,3,6) (1,4,6,7) (0,3,4,6,7) (1,5) (3,6) {41,58,39,46,59,31,87,43}
[##.#...#.] (0,6) (0,1,3,7) (1,5) (1,2,3,5) (0,1,2,5,6,8) (0,1,2,3,5,7) (0,1,2,4,6) {220,226,27,210,5,25,17,203,8}
[.#.##] (1,3,4) (0,3) (0,2) (0) (1,3) (0,1) (0,1,3) {49,32,20,37,10}
[#####...] (0,1,2,3,4,6,7) (0,1,2,7) (2,3,4) (4,5,7) (0,1,2,3,5,6) (0,1,4,5,7) {46,46,56,50,43,29,30,29}
[.###...#] (1,2,4,7) (0,2,4,6,7) (2,3,6) (5,6) (1,2,3,4,5,6) (3,6) (4,7) {10,17,41,33,34,16,55,30}
[.#.###...] (5,6,7) (1,4,7) (1,3,7,8) (0,2,5,6) (4,5) (0,1,2,4,7,8) (0,1,2,3,4,5,7) (1,2,4,5,7) {39,72,49,33,65,48,12,83,31}
[..#.#] (0,2,3) (0,1,2) (1,2) (0,3,4) {40,28,45,21,4}
[.#.#...] (1,2,3,5,6) (0,1,2,6) (0,2,3,5) (2,3) (0,1,2,3,5) (2,3,4,6) (0,1,2,4,5) (0,1,3,4,5,6) (1,3,4,6) {193,220,227,96,192,196,81}
[.#...] (0,1,2,3) (2,4) (1,2,4) {3,18,23,3,20}
[#.#...###] (0,6) (1,4,8) (0,4,5,6) (1,2,4,6,7) (5,6) (0,1,5,6,7,8) (2,3,4,5,6,7,8) (0,2,7,8) (0) (3) (1,5) {61,60,35,30,48,71,80,53,57}
[#.##.##.] (7) (0,3,4,5,6,7) (0,3,4) (2,5) (1,3) (0,3,6,7) (0,1,4,5,6) (1,2,3,6,7) (2,3) {44,30,32,61,34,31,52,41}
[####..####] (2,4,5,7,8) (0,4,5,6,8) (1,4,5,6,7,8,9) (0,1,4,5,6,7,8,9) (1,3,4,5,7,9) (0,1,2,3,4,5,9) (3,7) (0,1,2,3,6,9) {37,48,37,39,55,55,42,58,45,48}
[..#.##...] (4,5) (0,2,7) (0,2,3,5,6,7,8) (0,1,4,7) (2,3,7,8) (0,1,2,3,4,6) (0,1,2,3,5,6,7,8) (1,3,6,7) (3,5) {41,34,53,59,17,38,40,75,38}
[..##..] (1,5) (0,5) (2,4,5) (0,2,4,5) (1,2,3) (0) {27,19,166,1,165,184}
[##..] (0,3) (0,2,3) (0,1,2) (1,3) {24,32,23,26}
[##.##] (3,4) (0,4) (0,2,3) (1,3) {29,1,15,24,22}
[#....#.##] (0,1,3,6,8) (0,6,8) (1,5,7) (0,1,2,3,4,5,6,8) (1,2,3,4) (5,7) (0,2,3,4,5,6) (1,3,5,6) {46,42,27,36,27,53,51,26,44}
[##...#.#] (1,2,6,7) (0,1,3,4,5,7) (0,2,3,4,6,7) (1,2,3) (1,5,6,7) (3,7) (1,2,3,4) (0,1,4,5,6,7) {37,53,47,55,54,25,51,66}
[....#.#.#] (2,3,5,8) (0,1,2,5,7) (0,5,7,8) (1,7) (0,2,3,5,6) (0,3,6,7) (0,1,4,6,7) (1,2,3,4,6,7,8) {24,31,32,32,11,36,18,46,38}
[.####.] (2,4,5) (0,1,2,4) (1,3,5) (0,4) (1) (1,4,5) (1,2) (2,3,5) {7,142,137,25,30,48}
[#.#####] (3,6) (0,2,3) (0,1,3,4,5,6) (0,1,2,3,4,6) (0,4) {227,17,191,220,36,17,29}
[###..#] (1,4) (0,3) (0,1,4) (1,2,3,5) (1) (3,4,5) (0,1,4,5) (1,2,4,5) {38,79,31,53,72,56}
[#.#.#] (0,1,3,4) (0,1,2) (0,4) (3,4) (0,2,3,4) (0,3,4) (0,2,4) {49,22,18,18,42}
[...#..] (3) (0,4) (5) (0,1,4) (2,5) (1,4,5) (0,2,4) (3,4,5) {29,29,106,31,59,153}
[#.#.###.] (0,2,6) (0,1,5,7) (3,6,7) (6,7) (0,1,2,4,5,6) (0,1,3,6,7) (5) (5,6,7) (3,4) {38,29,12,49,20,25,62,63}
[.##.#.] (0,1,3,5) (0,1,3,4,5) (0,1,2,4,5) (0,1,2,3) (3,4) (4) (1,5) (0,3,4) {183,185,150,191,49,41}
[#...###.] (0,1,2,3,4) (0,1,2,3,4,6) (0) (2,5) (3,4,5,6,7) (0,1) (0,1,3,4,5,6,7) (0,1,4,5,6,7) (1,4,6) (1,2,3,4,6,7) {46,55,22,31,55,44,51,31}
[.###..#.#] (0,2,3,4,7,8) (2,3,6) (0,2,5,6,7,8) (1,2,4,7,8) (1,5) (0,3,5) (1,8) {24,33,36,31,17,23,19,23,40}
[..#.##..] (0,1,3,5,6) (4,6) (0,2,6) (2,5,7) (1,2,4,7) (1,2,3,4,5,7) {23,216,215,209,203,217,26,208}
[.#.#..] (2,3,4) (3,4) (0,5) (1,3) (0,2) {10,0,18,24,24,4}
[###.#.####] (0,5,8,9) (1,5,6,7,8) (1,6) (5,7) (1,2,4,6,8) (0,2,3,4,7) (2,3,4,5,7) (0,2,3,4,7,8,9) (0,1,2,3,4,6,7,8) {28,23,20,13,20,46,23,42,45,25}
[..##..] (0,5) (1,2,3,4,5) (3,4,5) (1,2,4,5) (1,3,4,5) (0,1,4,5) (0,1,2,3,4) {35,46,35,29,52,61}
[.....##] (0,1,4,5,6) (0,1,2,5,6) (5,6) (0,1,3,4,5) (0,1,2,3,6) (0,1,5) (1,2,3,5,6) (4,6) (2,3) {73,93,76,58,36,83,98}
[..#####..] (0,1,2,5,7,8) (0,4,6,7,8) (1,3,4,5,6) (2,5,7) (0,3,5,6,7) (1,5,8) (1,3) {37,220,10,226,217,220,229,42,26}
[####.#] (0,1,2,4,5) (2,3) (0,1,5) (0,4) {198,198,195,9,186,198}
[..#..#.] (3,4) (0,2) (0,3,5,6) (0,2,3) (0,1,2,3,4,6) (1,2,4,6) (0,2,5) {44,17,47,39,35,4,18}
[.###..##.] (0,1,2,3,5) (0,7) (0,1,2,3,5,6,8) (0,1,4,6) (1,5,8) (3,4,6,8) (1,2,3,5,6,7,8) (1,2,5) (0,2,3,5,6,8) (5,7) (0,1,2,3,4,6,8) {90,92,78,180,125,103,177,50,178}
[.#.##.] (2,3,4) (0,3,4) (0,1,2,3) (0,1,2,4,5) (2,3) {24,13,36,46,25,1}
[####...#.#] (0,1,7,8) (5,9) (2,7,8) (4,6,7,8) (0,1,4,6,9) (0,1,2,3,5,6,7,9) (3,6) (5,8) (0,1,2,3,6,8,9) (0,1,2) (0,1,2,3,5,7,8,9) {33,33,45,32,5,30,27,37,48,38}
[#....] (0,1,2) (1,2,3) (0,1,4) (0,2,4) {28,39,37,16,12}
[##..#] (1,3,4) (0,1) (1) (0,4) (1,2) (3,4) {17,29,9,25,41}
[.##.##.##] (1,3,6) (0,1,2,3,4,5,6) (1,3,4,8) (1,6) (0,1,2,5,7) (0,1,2,7,8) (0,1,2,5,6,7,8) (0,4,8) (1,8) {45,59,25,25,45,22,29,20,57}
[.###..] (0,1,2,3) (0,4) (1,2) (0,5) (0) (1,2,3,4) (1,2,3,5) (1,2,3) {48,42,42,27,36,18}
[......##] (0,1,2,3,4,6,7) (2,7) (0,4,5,6,7) (2,3,4,5,6,7) (1,2,3,6,7) (3,4,5,7) (1,5,7) (1,3,4,5,6,7) {19,28,32,45,42,36,42,65}
[...#.##..#] (2,4,5,7,9) (0,2,3,5,6,8) (7,9) (2,6,8,9) (0,1,3,5,6,7,9) (0,2,7,8) (0,1,3) (4,6) (3,6,7) (0,2,3,5,6,7,9) (1,2,6,8,9) {84,36,69,71,167,45,230,67,48,53}
[##.###.##] (0,3,4,5,7,8) (0,3,4,5) (3,7) (1,3,5) (0,2,5,6,8) (1,4,7,8) (0,1,4,7,8) (2,6,7,8) {52,31,24,37,41,48,24,36,47}
[##.#] (1,2) (0,1,3) (0,2,3) {205,19,186,205}
[#....] (0,3) (0,1,4) (0,3,4) (1,2) (0,2,3) (4) (1,3) {27,21,13,39,13}
[##..#.#..] (4,5,6) (0,3,4,5,6,7,8) (1,3,4,5,6,7,8) (0,1,2,3,5,6,7) (1,2,6,8) (0,3,4,5,6,8) (2,4,5,6,7) (0,1,2,4,5,7) (1,2,3,4,6,7) (1,6,8) {184,214,195,205,69,219,244,211,62}
[.###....] (2,3,4,5,6) (1,3,4) (0,1,6) (0,5,7) (1,2,4,5,6,7) (1,2,4,5,6) (3,4,5,6) {27,50,34,25,51,54,63,18}
[..##..] (1) (0,2,3,4) (0,1,2,3,4) (1,2) (2,3,5) (0,3,4,5) {45,29,52,60,45,25}
[.#...] (0,1,3) (0,1,4) (1,2) (2,4) (3,4) (0,1,3,4) {141,155,15,14,148}
[##..] (3) (0,1) (0,2) (0,1,3) (1,3) (0,3) {58,32,17,46}
[##.###.] (0,4,5) (0,1,4,5,6) (0,2,5,6) (0,1,2,3) (1,2,3,4,6) (0,2,3) {45,29,39,25,16,25,28}
[#####] (1,2,4) (0,1,3) (0,1) (0,4) (1,2,3) (4) {41,62,31,36,27}
[#.##] (1,2,3) (0,1,2) (1,3) (0,3) (2) {22,22,27,34}
[..#.#] (1,3,4) (0,2,3,4) (0,2) (0,1,4) (2,4) {30,21,25,32,39}
[#..#.] (1,4) (0,3) (1,2,4) {6,25,19,6,25}
[.#..] (0,2,3) (2,3) (1,2) (0,3) {11,6,12,11}
[##..#...] (0,1,4) (3,6) (0,1,2,5) (0,2,4,6,7) (1,2,3,4,5,7) (3,6,7) (2,3,5,6,7) (2,5,7) (4) (1,3,4,7) {31,32,156,40,37,138,39,160}
[##...] (1,2,3) (0) (3) (2) (2,4) (0,3) (0,1,3) {14,22,42,38,11}
[#.#....] (0,2) (0,1,6) (2,3,4,5,6) (0,2,4,6) (4) (0,2,3,6) (0,1,2,4,6) (1,4,5,6) (1,2) {56,44,58,12,55,17,60}
[###.##.] (0,1,3,5,6) (0,2,4,5,6) (0,1,2,4,5,6) (1,3) (2,4) (0,1,2,3,4,6) (0,1,2,4,5) {33,24,43,17,43,26,26}
[..#..#..#] (1,2,3,4,5,8) (0,2,3,5,6,7) (0,1,3,4,5,6,7,8) (0,1,5,6,8) (2,4,6,7) (1,2,3,8) (0,1,3,5,6,7) (0,2,4,5,6,7) (5,6,8) (1,2,5) {54,61,54,49,14,72,60,40,38}

View File

@@ -0,0 +1,3 @@
[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}
[...#.] (0,2,3,4) (2,3) (0,4) (0,1,2) (1,2,3,4) {7,5,12,7,2}
[.###.#] (0,1,2,3,4) (0,3,4) (0,1,2,4,5) (1,2) {10,11,11,5,10,5}

View File

@@ -0,0 +1,304 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
ptr i8 mmap(ptr i8, u64, i32, i32, i32, i64) {
`sfsesdscsbsa`
syscall6(i64(9), `la` as i64, `lb` as i64, `lc` as i64, `ld` as i64, `le` as i64, `lf`)
as ptr i8
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 21+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
void printbin(i32) {
if (dup 0 ==) { trash '0' putc } else {
array i8[33] 32+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
dup 1 & 48+ as i8 `lbr` store
1 shr
`lb`-1+`sb`
} trash
print(`lb1+`)
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
ptr i8 memset(ptr i8, i32, u64) {
`sn` as i8 `sc`
u64(0) `si`
while (`liln` < ) {
`1+dlc` store
inc(i)
}
}
i32 bfs_brute(i32, ptr i32, i32) {
set nbuttons set buttons set lights
# should be fine
array i32[1024] set queue 1 set nqueue 0 set squeue
array i32[1024] set steps
queue[0] get lights store
steps[0] 0 store
`0so`
u1(1) set cont
while (get cont) {
queue[get squeue 1023&] load set lights
steps[get squeue 1023&] load set s
#printnum(get nqueue) '+' putc printnum(get squeue) ':' putc printnum(`ls`) ',' putc
#printbin(get lights) ':' putc
`0si`
while (`li` get nbuttons < get cont &) {
buttons[`li`] load get lights ^ set push
if (get push 0 ==) {
println("done")
u1(0) set cont
`ls1+so`
} else {
# push new lights onto queue
queue[get nqueue get squeue+ 1023&] get push store
steps[get nqueue get squeue+ 1023&] `ls1+` store
#printbin(get push) ',' putc
inc(nqueue)
}
inc(i)
}
#i8(10) putc
# next
inc(squeue)
dec(nqueue)
}
get o
}
i32 bin_brute(i32, ptr i32, i32) {
set nbuttons set buttons set lights
`1si`
`10000sm`
while (`li` 1 get nbuttons shl <) {
#`li` printnum i8(10) putc
`lisj`
`0sO`
`0so`
get lights
while (`lj` 0 != ) {
if (`lj` 1 & as u1) {
buttons[`lO`] load ^
inc(o)
}
inc(O)
`lj2/sj`
}
if (0 ==) {
if (`lm` `lo` > ) {
`losm`
}
}
inc(i)
}
`lm`
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
`0so`
`0si`
array i32[16] set buttons
# read
while (`li` get size < ) {
inc(i) # past [
`0ss`
0
while (buffer[`li`] load ']' !=) {
2*
if (buffer[`li`] load '#' ==) {
1+
}
inc(i)
inc(s)
} set lights
inc(i) # past ']'
inc(i) # past space
`0sj`
while (buffer[`li`] load '{' !=) {
inc(i) # past '('
buttons[`lj`] 0
while(buffer[`li1-`] load ')' !=) {
# should be fine
1 `ls` buffer[`li`] load '0' - as i32 - 1- shl |
inc(i)
inc(i)
#1 atoi(buffer[`li`]) shl | # shift left button and or into
#while (buffer[`li`] load dup '9' < rev '0' > &) {inc(i)} # go past
#inc(i) # past ',' or ')'
} store
inc(j) # next button
inc(i) # past ' '
} `lj` set nbutton
println("row")
printbin(get lights) i8(10) putc
`0sj`
while (`lj` get nbutton <) {
printbin(buttons[`lj`] load) ',' putc
inc(j)
} i8(10) putc
printnum(
bin_brute(get lights, get buttons, get nbutton)
`dlo+so`) i8(10) putc
# next line
while (buffer[`li`] load i8(10) !=) { inc(i) }
inc(i)
}
println("answer:")
printnum(`lo`)
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1,362 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
ptr i8 mmap(ptr i8, u64, i32, i32, i32, i64) {
`sfsesdscsbsa`
syscall6(i64(9), `la` as i64, `lb` as i64, `lc` as i64, `ld` as i64, `le` as i64, `lf`)
as ptr i8
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 21+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
void printbin(i32) {
if (dup 0 ==) { trash '0' putc } else {
array i8[33] 32+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
dup 1 & 48+ as i8 `lbr` store
1 shr
`lb`-1+`sb`
} trash
print(`lb1+`)
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
ptr i8 memset(ptr i8, i32, u64) {
`sn` as i8 `sc`
u64(0) `si`
while (`liln` < ) {
`1+dlc` store
inc(i)
}
}
ptr i8 memcpy(ptr i8, ptr i8, u64) {
`snsssd`
u64(0) `si`
while (`liln` <) { d[`li`] s[`li`] load store inc(i)}
`ld`
}
i32 dfs_brute(ptr i32, i32, ptr i32, i32) {
set njolt set jolt set nbutt set butt
`0si`
u1(1) set valid
u1(1) set good
while (`li` get njolt < get valid &) {
if (jolt[`li`] load 0 !=) {
u1(0) set good
}
if (jolt[`li`] load 0 <){
u1(0) set valid
}
inc(i)
}
if (get good) { 0 } else if (get valid u1(0) ==) { 10000 } else {
`1000000 sm`
array i32[16] set buff
`0si`
while (`li` get nbutt <) {
`0so`
butt[`li`] load set j
#memcpy(get buff as ptr i8, get jolt as ptr i8, 4 16* as u64) trash
while (`lo` get njolt <) {
buff[`lo`] jolt[`lo`] load
if (`lj` 1 & as u1) { 1- }
store
inc(o)
`lj2/sj`
}
dfs_brute(get butt, get nbutt, get buff, get njolt) `1+st`
if (`lmlt` >) {
`ltsm`
}
inc(i)
}
`lm`
}
}
void push(ptr i32, ptr i32, i32, i32) {
set butt set njolt set source set dest
`0so`
while (`lo` get njolt <) {
dest[`lo`] source[`lo`] load
if (get butt 1 & as u1) { 1- }
store
inc(o)
get butt 1 shr set butt
}
}
u1 allzero(ptr i32, i32) {
`snsp0si`
u1(1)
while (`liln` < dup &) {
p[`li`] load 0 == &
inc(i)
}
}
u1 allpositive(ptr i32, i32) {
`snsp0si`
u1(1)
while (`liln` < dup &) {
p[`li`] load 0 >= &
inc(i)
}
}
i32 bfs_brute(ptr i32, i32, ptr i32, i32) {
set njolt set jolt set nbutt set butt
array i32[65536] set queue
1 set nqueue 0 set squeue
array i32[4096] set steps
steps[0] 0 store
memcpy(queue[0] as ptr i8, get jolt as ptr i8, 4 16* as u64) trash
`100000so`
u1(1) set cont
while (get cont) {
printnum(get nqueue) '+' putc printnum(get squeue) ':' putc printnum(steps[get squeue] load) i8(10) putc
queue[get squeue 65535&] set jolt
`0si`
while (`li` get nbutt < get cont &) {
queue[get nqueue get squeue + 16* 65535&] set next
push(get next, get jolt, get njolt, butt[`li`] load)
if (allzero(get next, get njolt)) {
u1(0) set cont
steps[get squeue 4095&] load 1+ `so`
}
if (allpositive(get jolt, get njolt)) {
steps[get nqueue get squeue + 4095 &] steps[get squeue 4095 &] load 1+ store
inc(i)
inc(nqueue)
}
}
inc(squeue)
}
`lo`
}
void _start() {
open("input.t", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
array i32[16] set jolt
`0so`
`0si`
array i32[16] set buttons
# read
while (`li` get size < ) {
while (buffer[`li`] load ']' !=) {inc(i)}
inc(i) # past ']'
inc(i) # past space
`0sj`
while (buffer[`li`] load '{' !=) {
inc(i) # past '('
buttons[`lj`] 0
while(buffer[`li1-`] load ')' !=) {
# should be fine
1 buffer[`li`] load '0' - as i32 shl |
inc(i)
inc(i)
#1 atoi(buffer[`li`]) shl | # shift left button and or into
#while (buffer[`li`] load dup '9' < rev '0' > &) {inc(i)} # go past
#inc(i) # past ',' or ')'
} store
inc(j) # next button
inc(i) # past ' '
} `lj` set nbutton
`0ss`
while (buffer[`li`] load '}' !=) {
inc(i)
jolt[`ls`] atoi(buffer[`li`]) store
inc(s)
while (buffer[`li`] load ',' != buffer[`li`] load '}' != &) {inc(i)}
}
inc(i)
println("row")
`0sj`
while (`lj` get nbutton <) {
printbin(buttons[`lj`] load) ',' putc
inc(j)
} i8(10) putc
`0sj`
while (`lj` get s <) {
printnum(jolt[`lj`] load) ',' putc
inc(j)
} i8(10) putc
printnum(
bfs_brute(get buttons, get nbutton, get jolt, get s)
`dlo+so`) i8(10) putc
inc(i)
}
println("answer:")
printnum(`lo`)
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1 @@
18623-26004,226779-293422,65855-88510,868-1423,248115026-248337139,903911-926580,97-121,67636417-67796062,24-47,6968-10197,193-242,3769-5052,5140337-5233474,2894097247-2894150301,979582-1016336,502-646,9132195-9191022,266-378,58-91,736828-868857,622792-694076,6767592127-6767717303,2920-3656,8811329-8931031,107384-147042,941220-969217,3-17,360063-562672,7979763615-7979843972,1890-2660,23170346-23308802

View File

@@ -112,8 +112,8 @@ u64 pow(u64, u64) {
u64 range(u64, u64, i32) { u64 range(u64, u64, i32) {
set len set end set start set len set end set start
println("==") #println("==")
get start printnum64 ' ' putc get end printnum64 i8(10) putc #get start printnum64 ' ' putc get end printnum64 i8(10) putc
if (get len 1 & 1 ==) { if (get len 1 & 1 ==) {
u64(0) return u64(0) return
@@ -124,13 +124,13 @@ u64 range(u64, u64, i32) {
get start get divisor + u64(1) - get divisor / set first get start get divisor + u64(1) - get divisor / set first
get end get divisor / set second get end get divisor / set second
i8(10) putc #i8(10) putc
get divisor printnum64 i8(10) putc #get divisor printnum64 i8(10) putc
get first printnum64 ' ' putc get second printnum64 i8(10) putc #get first printnum64 ' ' putc get second printnum64 i8(10) putc
u64(1) get second + get first - get second get first +* u64(2) / get divisor * u64(1) get second + get first - get second get first +* u64(2) / get divisor *
dup printnum64 i8(10) putc #dup printnum64 i8(10) putc
} }
void _start() { void _start() {
@@ -145,7 +145,7 @@ void _start() {
0 set i 0 set i
while (get i get size <) { while (get i get size <) {
println("--------------") #println("--------------")
0 set startlen 0 set endlen 0 set startlen 0 set endlen
atol(get buffer get i+) set start atol(get buffer get i+) set start
@@ -163,8 +163,8 @@ void _start() {
} }
`li1+si` `li1+si`
get startlen printnum ' ' putc get start printnum64 i8(10) putc #get startlen printnum ' ' putc get start printnum64 i8(10) putc
get endlen printnum ' ' putc get end printnum64 i8(10) putc #get endlen printnum ' ' putc get end printnum64 i8(10) putc
if (get endlen get startlen !=) { if (get endlen get startlen !=) {
range(get start, pow(u64(10), get startlen as u64) u64(1)-, get startlen) range(get start, pow(u64(10), get startlen as u64) u64(1)-, get startlen)
@@ -175,7 +175,7 @@ void _start() {
} }
get out + set out get out + set out
i8(10) putc #i8(10) putc
} }

View File

@@ -0,0 +1,200 @@
4346343235149456543445233353534244533333333343433259333326337334334333438332533343452433223352443324
2323233732423333335633333322134234324554233323746324333322454233432477323332532436412434167322334333
4438535634336316544333233334654336327872333345433342236331325333833273333243433524422235474324281254
7635564525754333455743514353744749554546454155741335443245664443536573554975764554345255721643344333
3436251343515542422628472421274223732245632229446723233332854754226524146224634422436324322222239424
3322722363637333537238763823533333332334432332224235543347553223326123333233327335363435336732333231
3322233132312242242612331523323342532632132524224233242444212224524342223462434131252242244133124523
3231232323233333443262431633413333234361441363323223235331222221362133323333142233123234642237252331
4213455225532326452352232115333243331124232231234223413225253232344223322222133234229822265136481222
4485474625664354263625634945926824657865634355433465323764534563443564235454646365444523646744455223
4526644373355432443342344365336343734562236227325776359313347342273433331495732635221244433433222783
6641423834344336342333143332833253324623332643333244514334341435466333535534723834233556512433524654
2232832326333452535333531422323414526334353233235224423222332112522542853433272222223223231424232132
2323232132423242322232223231323333313212322123121422433223122223322423242241332213132221222222224432
1122212123222122221222222332212221212232522122222211262222221222222112231223221543422222122222223121
2353333322241442343333522243544332223323122433334434426352434235342325335336333253232233432132323343
1122232112224322222223136231323212522232132222122233333232222222222232213322222222122221323222313232
2313213422432122224233322356322323431233325223221243162322312132322331222342223222332323332222312233
8242626364226227533711283555742562468534624525246447249921454444227564225566652366252212562643267256
2325226231333225222222232128223332322242231722122223222312221313122253312221222226221526355424245122
3435443762849656643666538674295966858695544964596534254344416588745767242676441646356935457978464898
3433234123313223322333233239324437832312223532133323213322322423331143232151423123333392282332335223
9839649678942674726644656925773795848939835644775368462546847556648257623488547664572482244448227469
7233434152521333232242375134451433432125274224134235522222722432334235532437533735752312233233323313
2122111122313233432232222232122232323332242223224221222221152323222222322222222122421333313232223222
2234622222212232224229222225222861222222222122222232122231211221122422222212222225222222322221222221
3222222422313263232223323434433263533223234334424173233133214227422332311222432213323222321123333322
2325322342223323333212331323133233234323333144333234113323362324321333522232233333432323222213253331
4225547536446335353542363643453544433582423463434444664221444645216615255443554243548242333434234232
4343344445443444344432344443444433246949645443244343539744974885443433844454343444344436433544363443
7282377345865955374554854149655725568545749456853355957458522624652443373552454745595252343429471325
3344222111273352352321212322261843542223373234242424221343222322124343231355246222454223262632522125
9293425563224138655452395446836646323222836882412229262294371325521224234112272342442433422322522393
4724345344444843473444444334443345424444343335344415432253533318444434374533454724344334431353514334
3443224253633253337323342242242348333133632536236335266453432338343223422334336338183366413327355232
1334736722392631523335413217365433822224557652252236324327124423322256532135233433722523288113322225
4533224811484227724336432241227446213282222283857664531622932223279622242367252696432125676252293755
6151435235362252336543653235252222212643232223132232245223363321244325612425235642261232332225252264
2342342372224422245444331343264133227333223343412233311233332267343323243343444331232732394443333432
2224822322221723143394434232324362713322243325232323222334232262253232535279274323562222521223732233
3243432334334322332243333332333223312333213324332213423363423324333434323416321342334443432333342433
2214124421311221213224242522322235411232122414223214216132244242222222122122222324252412432247422423
4224222244211121221224223142242224222242222242242223222422214232342215212223312223332433122423233432
2343332333343443343334375433333333312332463232213324232343233353622333373134345322333313332373349338
3447747864224364454439356132744222243447344441647756423441643545231494464373263335444643342572324463
1222314232212221221226233142212122321222122212212234432322221412123451115232222523142232323222222324
2231574174353753342332553233345213532373223923232353333353323233123243253252351353452242522113353233
6253423446237284832314361853934332622522432432275226523823277242872283422232138285214522323621327322
2223342532123233231323434442431742442312133342314223233232323253223232252322324543232112223133522326
3223322611223332333376533332638325325244433333222332364433323433531243332633435344332333772342444421
4242222343424324122221232222322335332224212122211182213122342442312212242322224522214342241223324133
4667556425356654626155366643567741622652416235663634365666665347763361648652455246255746147766912626
2431232242423132442645421344431528542222242113422523222641433115222632332243832223423254523622323232
6456322344313444333765434462356542564661241566445473443463344465544445425632435745343364343235342227
3555512442455213122412112245334412151151141243453342125542124213413142531213311313353142251512526789
3122444214622432232423262124322223422224135222222213222342322122424214153132442222554124233222234324
4377879776474667959755538197767444976676433464447765745846673956646684689397249372464444657736627862
2122222222223212111233223342232242222222433421156132224112342122222222514222252323225123566217512211
2133223223213333222232222124233211134223121723224222222222222332212232183122123212232222222112223213
3237682535343336635448473362363333373533238375733343333133334353476777333333742734453373636778833346
4532211122312243122332412843222122624223142263221374222142221241412271332132222333241342424321244313
2122235222257232242432223323221241323322462432212211622122333235233322313333333222321733521223243221
5422545443373424759444445355743534567564554444555136345456442425334344553753434535351555544423473445
3323113222125211524212222222122228622121225222122222212136122222314424222222253222242124322121222223
4145446445322236431525647253563325344448424545134452363533453644533744245415435254733512444145554145
3236432425343343333122433214362221322233344243244422323332923353432312124233433243233322385122532322
4232222225212223241124422352142512222332222321222522424222222642223214321212122321121623232212211442
2232222224222224413212423231433222112134323211241222112234222223221222112233232333211225212241332222
4333334623433533342135313244633343343443343313422343334333732342233353333373333334333334313323364234
1583342121375122352273222238322261234952236958534136147577327677263465843223328261942342317826824487
4245458132222627232232223122222212132342212323222278223824221222912412211241424235232422222222122421
4223123997971848342334724528364924263952239639243348742997589497286672222972783282854267294146774428
3324243443334223455325393433442433358443437275434335244335869342343433443233434335345343342343174343
2222221224216212425522927212342285211422423222282223282234222544445222221219262622422345313243421542
1343423537533322324532333632334643346541353233233253233253331323322225534433377242333323333443337333
2222242242211222122341541631224338313522335526232325233242135253233232541332232555115523226235224342
3122222217222324232624222222223321225332224232534232222263332124133223323372423232232232323532222335
4225424551444213224212142242222223144412221835322244212172424234252542222342221324214122243122232214
2222222122622526224323121232232327213442227213222232422733333322932521223242222252233233223222223233
2752213543665536363224772215216442226252421265322549434241522621585662222262342473622256232123357623
4742561446626522949634342232556825726438446112337734834126622526554223425312263227632342592641223621
6522722622332342417352334137242765314222222257225225543265322122722213226112322221362521162432432232
1232216433344223464234225263323443424639332248235443336434314242542342223253143324322323375542633442
2332222433423235112226133322221222322323335333322223432243233522221231243222122432234423142223333222
8346623364238313222533433253237321531122336338333384533312533224613321652242228553343226737233523363
3523212335323223346333243332731433343332343323313332323333323336324334322336343233142323143833463133
2533344453133545435522544334444484422432333833345213344423224344533649463445235323464213334444432535
2232222223212132222222422332222122222322222131221222222122422232331332222222612242322222122122341332
5435544235532353153433532323535626334353235362423312555315642363436543435476133334532665634634446555
2422846121282422271121331834181442532512187422234222112524321323531832312413562231232432423124224224
2242253132433722234242422323353423344422233333333233343232434342421333322222313543233322364253233321
3231212222231221332322116223234622214323225632543212222172524222216212212332242322222222215422222222
1332219213222228222122212211222121243212252231231322325212232212222121732422113222111252533211222223
2551223313212334612422253322624332261243225633621252651337252763227225223637764726732223325633233627
7565748484669687566955854485687447658654655567585956557585995964375756578785334555645566656486684788
3434446315332335533543333224441312354421334224433233434343434442233744612534435433533334134442443433
1215324233232232132225222213232412344232122124265432323222233232442222242114223133212436223323226321
3445333533345344534353644243435353242633656428344233583366345325544642543633443334455433223344434314
2221232132646833311484233323138343222232512222222432221272312232624352232233322261311133223813312422
3323434422323325432123333433132143433431733655737346533481334641344234255583575545344332461293234433
2233334227222322464524314353543333344232233342243333223224223343424322123232222321333633433334452242
4664565462545537443546234434352558545432564745534254435554331455953576472455554545348245774537754555
7737556654745365738662565794535544555556575656555555515955555565655565555575985456455456363646777556
2642753245137613432732134846875533662994438156236866252642382342534965364422637645473872443121443142
3223222312221242232321234344233712332221333321212221742111523232222122242213421314426722334223351422
1323211222222313422122121222123223211222123222122222112221212252222423224225222314353225553422222122
4332473232433326162172243633223223332224332244422425343242723222223522232242213142221325368441222222
8428454485743447379867345566293763545485353486593853675546747547875463955565456858836653552356675554
5463729624975247282233516424233646936239237142644699246625112854262522553735715844632334524122444521
3687766937534925235343136864454987855187349936738664835334353353385278546635975944743654653892855295
2233121323353132322214333433424233213434323232333232322483324323231322333232333423423222122543234222
5333563334435334546622433245234434323243137242245543442555285753434633155533462467313343365644753726
1435634532357443333333453333534442434533444133363566443432453442331246644633344445234453424423592336
5633256431464346334435333644336356335353344445365334743335333633474153333553233341334333335334654313
8445764652526564857256566655656366389656466413566835544843558567553256635564326965555667456453643676
2253222322232242225222132232322223322223225332222312412212222221212222233123321433222232242223121223
3333242343431333322334323344322431331333332333223233323332322524253333333333133333334334244432423423
3243452469464264144613444434434346642624434434695444433744423254447444224312333558442445354824462441
2239332154328432694683922222143324374314213622373512242432233355221512321222223353265153171361613222
6545546657346456255732775857474537765784465657474645744675517744343335754675576375444745377467477267
6575749497968787677786573563977667784666977887667677448651777559775897777778788655799677876567767888
8164686221344472152262448736342544334745661247474336732331282665563264452236862178234726623336273426
2342237325222223221322242623133323224334322142221225624346224168332331232341434256437434431321345622
6737463234333136533645757765732724354267353543633266355564463556323333765313461743277436573242475675
3333312222443232226522221412232696121322422131223223262422122213221332122226222536222243342312154214
3442345351252132242222326134123135342324425433132333225236333232232235333523611254223116323322325335
3834444981675454674844882948455447344738962684447946489296445998545486456345844384764435456635349744
3214324332332622322333321843422333422341322253342312223323232229143411313331545222134143533231133232
3222222222412221222222132222222331222122222212212123232212222122122332211222232222213111222223222323
5423624452366545233244474447744467574124426862442426644244522376446226345155356633442726673246714444
1662312384832223122923245622222223262962232227287352275252461111212432417722114222323826213264213422
3437334334437544344314442432423543435332442332434744343343445543343344334444343454331344246312444253
3545443534545464145443147544446344545433354534543543544534445555554247455545645545435254433335466656
3123313322652224444234432722233281125352434352223385222445322323255325225621321332233234345221224124
4226346149461534342553432755433246224463435332643444242552432352446244122334442224222422333234223426
8775668475557548386363683537358693553866459697758887343773765383848665588358857677636523888366777235
6213313236243233332323232324332322333232333632222312232332343632222231553322222541322422131335233333
4453353544364526544443424563436434474465444344635855544335958444645148459444344345464355744342345656
4743623386383134984833391896668312634374669755437353463947534256132475522224436732792433333454378333
6237742868675441246466452744544564443669443487584644635435764845477367464334364534655466734545643343
4162346234513621243155416613266334244435433634463465154263566453226412522646224544213432653545545789
5513225145544634793445377524525733625671536583922534554524276669342356536351435461322473424823323964
3234332243232326244623531212233234333321133232224234332221542242623255232234313115234312244366243432
2652223424254422415243552122622542421252954324322422424454221223438253242512222123333222272234262522
5224242264625224223232322222225322246412422322232226342422427422122221322242331421324221127223424344
3422233311222123622222224254222124313424922539642372232346223522942228624322224222312222223323265428
3463364143325237554363835323732473442347617532322563542374226233613427236227563263234122242667773243
3322223222254241226233522123221231346322313422542232212222242222122644533423222542225522214252222331
3232222224122221312211232222232222122221112221222221232222222322212142231222212222222222212122223212
4642423342322534262123323334252234643352323313325253215333523314142252214672233244223652432552343366
2252222322222122122212162322223222221222221212213122222222222122412321232222221622222162232248222312
4133333433323333332332343333333343233333333333396535233433233243446236324334343133322333343333333331
7646559666633747836769669667454625965276648676366554623267734574454634666335674564864776377457575853
1665533424626442216234563637363524233366636774654666326366454553643625836176543363333664467656982467
4452328622821524155333513332865221532432442533552363132655342433332562585454835313544228453415552255
3353543235532525335552215434533544435242544443251435353455553554244354533435533444452534585422355334
7663337332376646445233625652335745466255345731653443556316652455663253371536433943325555633326443533
4353443334644456633844675354583343429455535443444223457655433831438143373466713337349355945532553545
2221222222222223222222222342321233322212711221222212214224222232222222221222221422231212221214223222
4442862767513542535482123545524426462873542452555417515332745136374344628125313268495232526424927584
7276636348762573584477363432763446331615345683234422673464352855443243784271345667365366231448674587
7253922538238262444373564256248114222291642959945257321552431492252421441425535452385246117294265335
2223264122333331412353533222331322446225333222122236122242332226232321112213532242322232233222121213
1231221431413132332144321333322433141424131132343112221214214124234234112324142411113431143133156789
5255849544675744362666176553545572824528464659616463725488237352165466363351678343464252523252527465
5123323645635136244574357422144634727513432366322544257171311354515371311521336664243146254557255189
5533333853332313333333333333353343334333322333333243335333343333343212333233133253334373383333339323
2224242232221232336335322243214321171234353314223332222332234231243333332411322133332421131342123223
2244453632134133332321322273314131342233334323324444313143232423252335332353214322345541542329232525
3226354242231241335433422252252543125223124231241525225724213223242253754141345344343221412256212245
6232362816623332433465312335352353652123353232336253332462262333353335124563333633332335343322313564
6324523573236374624463454256733736277563737651278273526427372776666735143756227266239135463342536263
4161222182542321361232126223323295152124137223424983221233165622668492211312225333312625696225822312
7445346556624444421734323733469542464326424764643934353934436545733543424354442445544476526275334674
7466615176268554148782713446488565251134547865727331862283233752424644787678575482155781775668378539
3442223233335633352435329643541333324645236323333331353223244243142638443366334325436333253335331534
5362471576394774668557278682864526751346816453728348531946494395725673754922684553662163677558473545
7655989956344687357359499746266235781288737796545426447457269965637665939943267568224239392499766293
3232232333331323233332132233124322723223122333332332733343313322221334221223222233212235223362222231
3312334233122242323222322622332331231223243161535224343224434323133234433442263323524342322315422225
2344343424335335333372321133333332335323335342361233452512434343343353331862353354581633441338332433
3713363614325442314744622444153425532242285534373625512553222514523222545525265256424426546522346423
2232232242242632232242323223342332332227231221223224232223124123332333352332352224223233244333213232
2258545542545444454154422443349444327744523242425347455538434342532442235446471644244333231955475434
2323342233222225542222122421422252523321234422413144251131134261311422122223313153223122331442212354
2524234581534663331312433233221644362446432333343243634341224323823351242325122343224366333333454212
2242223251224131313356226332333433223333431225433132272222313446252122333442426482152231246411122232
3323233365333533361554332343145453324336232335633333334343363345123433243254424345325343253254235554
2263534142333284563562235323674324922731427323842134111548321642662442474548647245937328584537416362
3233416335422612223324222242225232823242333262522242223222222412434142212221831233231132121314223132
4221322232225352221113212224535231221433534325121752225242223454223232332112532261221342222311321122
2262363251149323633694933533353763369513633324333332926233133323323231433338332222234333435232133333
1231231234733314382318233222273268332243313331322232353333134322223332335726674223332433121223331863
4334234333323243243332534231232422222223641313434331321333233533342414314334542333243433333223223334
3333413433323122232323213323333323343334323423335224333322223322331353335213323332333333322322353333
3333356363142336373532132733235133662322112386315333368325332523323326225243533333752352343335362376
4621136344326146524661362233462336225596254541664139466849257424267258265532642442514624444342215627
5543236334532433455433443232473423344173432455533342332453331437344253443126424342764243564534235434
4323322222222125322221223332222232223223123222123322231222322223232222322211332423212212221222221122
3251323264248243431512228644434414222422442237357523322242624445452123363142158422452526443254313472

View File

@@ -0,0 +1,187 @@
415615768268371-416146851443768
191441934518457-197157487694725
283039808754572-287535623375734
112431539028123-113253150554096
459000186532687-459000186532687
355460558424727-357186873512401
176050787010595-176376661075302
205907361020423-210053551716902
171948784253876-172249538568913
416146851443768-416366973136841
494664842356557-498938802826258
531317371493763-531572274448825
287535623375735-287535623375735
445351700155545-451417143233758
428522662493415-430092814437936
525219000236682-525420506277202
4514613808282-6876225718377
426636817857490-427821734706006
498938802826259-500642536046775
416146851443768-416554458072074
441234246884209-441234246884209
423529738394776-424894326746801
112695579468250-113025005038338
322908721299457-330761811674666
153784463318453-158583249889231
417649117931435-417892805017077
111450840453798-112264446526036
304790151426917-304790151426917
40479108715501-41716132680135
529487466473303-529813098424489
39409252480917-39409252480917
240472324076104-240472324076104
275809301142610-280535548219710
525219000236682-525667338666494
177299959466504-177710060726324
161238592960013-168877902394349
514175089212359-518353956308952
119303260127076-119681463906475
175076857738638-175320179557299
533153559551782-539070733742023
44941662798905-46316126012040
429643301837850-431040928058994
530119741965952-530625948798408
44156315074854-45327762469673
225097232246005-227643450151513
421362005905278-421875491907854
124473380749853-129478235510959
83325855650473-86301927125864
228288879012543-230890475254573
359949275990403-361737252827579
427628274486259-428849647098379
182552303297392-189779897282507
41531324363037-42740451886724
358997416902511-360413145986590
544867956595126-551403823916994
246290329676433-249789969997045
174623491832057-175320179557299
425549691817345-426908275524567
422325482752386-423945096989080
453168512121827-459000186532686
292394131235521-299490647352145
176957916310506-177710060726324
466376217490394-468837786646318
554096236659234-554096236659234
93308785783969-99889371907684
119957892467354-120298423841226
385639356979811-391168939113343
61056686052409-61056686052409
353063351957422-354787557386607
119303260127076-119435108787057
419598036740253-420419737428864
462771186738855-471131182468684
72389723207854-74131961245639
317762876701596-319430625445430
114385450957460-115031663452960
223428073390965-225448530632444
377473079203322-379730376235894
313712319887997-317762876701595
12917808676670-16942320826975
43347489842162-44438036924163
154974067390161-158583249889231
116463199245981-116668380988510
119681463906475-119957892467354
114047230333429-114166005119686
114047230333429-114166005119686
524589153577448-524834784440447
527458512153067-527577102559875
32507572552739-39409252480917
405212467164362-409248761056539
354269175630971-356254670555776
486882052675822-491079880289648
50971547937007-59539706830117
420419737428864-420667110357446
421005210472551-421491718103292
61056686052410-65911721890352
304790151426918-309797918073113
47846939082450-48998323615960
45999800318085-47347617049792
174623491832057-174843660721450
382791492119538-388636524544931
175320179557299-175787649112784
544867956595125-544867956595125
372641324569598-377473079203320
421362005905278-421491718103292
251974796877959-256972824654449
417892805017077-418592322935958
367698185423713-371355348377511
116949222950859-117688181738524
161238592960013-167122161790591
23799090193613-28954486628478
184887351194217-187190465789699
554096236659234-560573752405736
74131961245641-78010586827986
405212467164362-405212467164362
256972824654449-256972824654449
325591063756488-327276146322891
275809301142610-275809301142610
176050787010595-176571874282822
173837782793230-174117950947581
395717915132729-400756266793440
46655433496664-48318361330390
525219000236682-525420506277202
433495413379218-441234246884209
48703913468089-50189759576539
474213584156866-481243979571568
263323683404161-270087496638810
221896888599664-223812562457568
335755675567806-341271643549427
528907320298429-529727484664247
417649117931435-417892805017077
504166794754615-511364889378453
21368510003328-25699736029961
215256166823245-215256166823245
415122760907861-415615768268371
529813098424489-530429389252290
539070733742025-541301106962391
226545101307920-229316368396047
292394131235521-295385785163637
113025005038338-113632949997314
445351700155545-451417143233758
242212273388146-246290329676431
508072487610395-511364889378453
93308785783969-95306757403600
1183329419271-8060935578618
347708201228065-347708201228065
174117950947581-174227156820818
203271279069604-205907361020422
483820332620875-489157313828269
145003238361997-146838877810518
523184886149829-523271889924340
357502828911083-359238402432563
194774122995579-200159149225495
345051918344095-347708201228065
104168933547362-106491119049179
111678017547959-112431539028123
145003238361997-146838877810518
42240611982566-43773218548761
356626458124290-358195383598067
104168933547362-104168933547362
179404884434293-180122715150323
50971547937007-59539706830117
418918183715758-419598036740253
113529849906606-114166005119686
129478235510960-129478235510960
335755675567806-341271643549427
114166005119686-114385450957460
528225789423393-528633026757079
364500145079918-371355348377511
132901865237987-140302150467741
414119138724096-414584075109225
528225789423393-528907320298429
86301927125865-89931631585287
135518794766964-140302150467741
113632949997314-114047230333429
421005210472551-421491718103292
430685667575684-432096042818423
420172189734963-420419737428864
112695579468250-113253150554096
215256166823246-218323369254813
171232592017102-171487589727253
116255828760783-116463199245981
424620845073712-425854252818395
514175089212359-519912511428490
352204580482739-353884921574376
231752950727931-240472324076103

View File

@@ -0,0 +1,5 @@
617 828 937 2344 145 37 83 845 37 7 882 928 48 929 79 69 119 36 95 7 12 2 778 7 9 1897 361 1 988 84 86 978 5 737 3 973 3 518 31 3 57 92 61 9488 491 6 86 238 53 841 79 664 22 9 84 8 368 982 5 9 93 653 52 93 66 5 81 688 25 886 67 8 462 9 1 473 3753 391 929 236 9 98 9 6139 5 9 2 67 6 9 2739 1189 43 14 49 26 5 2661 73 588 291 296 84 52 382 5891 95 9 9 477 1 3 174 595 69 88 16 56 29 6 6 482 8817 582 116 68 489 5 366 19 23 3441 256 24 193 5671 59 34 8 675 4 27 287 61 77 2 225 56 97 2121 95 28 3 914 9 3995 874 317 13 858 64 6261 44 285 68 9 4149 2 155 96 2 84 46 21 8134 712 795 5 19 3 8 4691 95 157 944 26 8 375 116 65 8 536 4 768 94 359 8 475 1854 2 7316 7 7 919 12 29 5195 7 95 87 87 21 5279 7 63 953 77 6 898 24 51 41 8 975 69 611 5 131 773 9 343 91 4 436 79 49 24 4545 776 89 415 86 6 55 16 751 29 2585 37 966 321 91 6534 839 88 16 91 73 756 93 65 217 74 1469 254 74 6736 17 349 86 31 75 34 947 93 41 7759 654 87 15 39 22 55 7282 33 87 9 437 8918 65 27 344 9527 948 54 1 42 93 427 82 242 936 67 38 1 81 97 4 4519 42 959 81 92 42 56 1295 8 7 43 2 6742 81 2 3 776 99 7 8 89 6 512 542 18 73 924 493 51 66 665 35 3444 253 47 955 4 7826 329 1 92 7189 2 22 5 333 77 892 92 29 26 8 5 32 24 98 78 1 361 528 28 27 94 9612 5 281 32 2 693 867 85 43 5 77 7 22 61 6 138 81 684 76 22 886 49 39 22 4 938 45 9 6 2876 2 72 85 928 84 55 88 89 511 5 638 329 35 21 35 24 7 86 96 9 891 6 2 15 5 1773 39 41 96 4 4666 832 53 53 13 954 83 679 18 3964 74 149 65 8 428 61 783 9 9 53 69 12 3 29 472 88 936 117 7698 21 597 982 8 37 86 4 61 67 7367 737 4182 84 64 61 77 58 284 4892 84 581 38 695 26 3 93 4 189 116 91 854 5 92 95 41 18 888 3 13 746 8 21 9534 4172 468 223 47 968 33 875 969 62 23 645 517 87 154 5241 14 4 328 415 552 11 594 71 7 27 972 25 33 81 14 639 8296 8695 234 83 43 46 13 34 48 387 985 266 525 999 294 74 773 6 249 855 557 613 86 568 64 3 78 9388 87 7 86 66 924 12 12 74 76 6 7 19 6256 88 3 35 694 28 9439 48 827 66 13 8729 62 2145 86 6 87 1 49 6724 56 5 171 2 512 23 73 59 35 5 272 228 39 52 39 2529 26 51 18 315 152 35 7193 835 5 423 5193 56 582 796 697 548 4 29 48 282 1 34 79 99 11 15 75 641 343 224 213 725 1 87 73 65 5 44 9959 43 5543 299 7413 525 764 6899 976 21 85 1 6 853 833 62 75 91 8 4 15 51 51 1 462 435 7615 35 622 34 111 1 435 766 375 7 6 842 48 4279 1 6286 1859 4 44 28 361 62 45 62 6 812 115 7 491 4 6892 4297 159 59 865 53 99 6 73 55 99 47 648 69 193 5 19 698 67 535 4 95 72 46 14 5441 8717 84 17 864 84 41 52 49 17 1 46 2 5 129 5 775 33 31 347 7 47 54 5 86 75 32 158 93 73 7 79 53 974 219 5 36 8537 199 52 8393 765 47 3465 12 264 13 214 39 389 4267 74 72 3 594 6 53 334 62 4528 99 39 774 93 147 32 439 36 549 7285 69 498 51 545 82 87 77 79 58 23 1 741 374 1 7 832 51 23 35 4524 5682 9131 3455 18 13 35 9582 924 75 3 366 728 18 64 171 679 2 23 29 5 2648 255 36 2 6314 7 5 3 6377 72 5 14 72 4448 542 1124 51 238 343 5521 194 368 74 482 26 586 94 71 42 2825 959 6 8 13 94 38 53 68 855 4299 3 73 277 78 79 1 7 726 699 17 35 76 648 891 913 259 41 7 21 8 17 86 861 34 533 1 3 5 11 486 8 5 672 44 2 27 82 5 52 872 7 71 529 399 73 24 96 1 33 77 7125 87 59 2465 349 4151 158 288 93 69 5 9 73 26 16 392 77 117 88 5259 373 141 72 2 61 2193 87 764 84 1879 435 97 96 162 715 33 491 1 382 145 56 31 37 49 976 6 36 5 852 656 74 47 93 87 8794 51 27 7211 9918 3 63 94 3 57 758 3 954 49 57 32 895
478 337 998 3442 618 226 22 45 656 66 47 653 36 72 821 27 957 8263 63 13 515 1 358 8 476 1485 662 293 775 65 88 541 61 851 52 487 72 775 98 17 156 427 91 2892 682 89 483 239 14 491 51 579 76 2 59 4 311 996 19 96 84 428 551 785 81 48 123 158 35 556 96 69 324 3 5 961 3222 492 436 948 156 73 44 6856 84 54 89 91 91 21 3297 3353 43 76 54 16 4 6197 38 734 959 947 2 678 145 5191 13 2 1 622 73 72 617 881 77 386 38 76 65 14 87 37 8719 432 435 54 122 47 985 28 81 135 8 15 828 3272 314 585 6 933 7 16 469 62 61 93 891 66 315 1666 44 4897 37 875 1 7689 328 271 57 714 71 1786 79 565 91 6 5462 11 635 25 8 44 15 79 4251 17 228 3 77 46 35 2978 82 999 2364 55 7 366 116 44 4 8848 3 11 76 333 52 589 465 82 4397 97 61 322 64 29 441 57 65 87 553 697 4616 84 88 71 521 56 274 689 91 17 54 17 63 219 7 234 21 52 3267 116 221 399 28 1 34 6832 796 39 249 2419 37 37 3556 381 35 9377 45 299 857 642 8919 47 45 113 74 53 381 28 6 724 22 8713 751 15 8837 61 371 7621 493 47 38 766 51 3 6128 355 37 86 88 84 351 59 51 88 22 929 116 615 64 123 5624 576 84 38 993 71 833 64 399 838 86 73 19 15 6 561 1183 12 573 23 421 89 48 7811 93 44 44 7497 93 481 18 3 829 79 47 841 77 3 523 834 62 16 4558 2894 18 94 157 95 1972 889 7953 643 77 7639 154 5 92 6595 24 352 3 998 58 531 36 45 864 83 28 6 38 96 33 6 624 89 86 45 95 1137 89 153 792 3 16 9 86 87 3 555 49 781 79 25 546 74 668 31 36 726 49 25 98 17 884 36 14 5 8169 8 81 72 245 15 95 65 11 992 8 488 7191 51 67 668 85 85 83 49 131 256 899 6 57 746 678 12 99 52 2 1911 588 59 39 39 698 323 847 78 5735 61 836 48 589 255 89 328 18 521 88 11 489 6 51 916 57 136 733 8894 98 975 252 8 87 74 48 85 44 5318 792 7675 34 24 259 55 42 899 4365 8 882 36 94 162 627 91 9 861 926 77 975 11 97 458 24 58 859 99 496 891 4 565 1315 84 967 134 55 753 87 778 188 64 65 319 896 74 143 7723 13 3 877 258 2 271 376 55 2 77 494 1237 13 942 91 892 4141 4636 397 27 79 33 23 33 33 194 278 247 877 35 491 61 661 3 415 857 882 499 69 925 196 76 927 6519 62 38 22 11 369 63 82 67 27 13 87 37 122 84 518 432 221 58 1151 97 244 99 39 6781 45 2915 73 61 29 85 18 9268 655 437 822 5 963 586 92 679 992 8 238 84 52 64 44 2982 13 57 59 1 564 92 4994 529 1 318 4924 76 567 136 792 386 4 51 71 631 214 438 325 24 32 24 24 255 472 579 956 234 84 57 413 77 6 15 5439 38 959 535 3839 559 788 2161 879 44 541 41 1 286 859 84 67 3647 58 2 24 48 57 968 283 642 5763 95 352 27 933 69 724 277 778 5 7 456 23 662 6 3637 2354 59 35 67 833 556 27 29 27 589 718 24 548 5 7781 124 769 85 635 58 68 72 21 2449 694 36 859 95 434 6 71 811 999 59 7 31 71 71 46 1354 3924 72 56 327 26 82 53 36 46 48 14 4 8 75 34 877 41 276 582 8 83 84 72 3 86 46 787 18 62 25 96 65 7935 224 62 35 8171 178 41 4835 166 31 8631 77 389 73 388 76 965 1294 41 76 91 619 56 73 23 94 5169 82 68 963 71 321 78 427 66 147 9524 64 113 65 799 97 21 35 24 37 98 26 525 388 95 1 8282 41 62 66 7263 2711 9599 3359 36 54 82 7184 94 56 68 2139 943 22 93 688 898 3 22 72 37 6644 265 75 35 592 765 137 375 3685 9 43 68 87 7663 927 2425 12 766 621 1788 719 93 624 756 86 533 37 162 4753 1232 216 41 69 41 994 45 89 436 195 9199 77 57 31 42 89 4384 99 861 143 55 63 756 622 137 939 712 95 15 14 743 26 62 795 6689 7783 18 83 51 18 343 23 95 48 989 4 8 73 873 48 494 23 89 623 527 26 46 956 4 74 49 4242 47 37 4797 419 4869 183 118 461 46 7 2 67 53 28 633 55 718 917 7533 5585 622 738 1 2 7248 74 831 88 6387 645 98 55 915 9255 41 115 879 944 231 19 36 15 88 35 61 97 8 153 974 91 41 26 42 7924 16 65 7192 1995 637 28 92 91 37 719 1 435 44 45 28 951
48 61 331 426 23 8168 997 19 737 93 15 712 51 8 165 94 538 7915 57 88 991 44 46 3 258 66 772 252 291 73 43 745 25 69 75 614 68 557 83 79 284 361 16 4367 89 12 951 665 35 698 44 594 15 18 56 2 948 276 464 8884 82 87 631 434 995 932 986 6556 554 792 557 86 271 1 29 68 3728 57 729 584 874 263 83 233 121 97 83 49 57 83 135 861 14 67 941 91 64 8497 69 484 818 7 4 685 63 7929 78 9 478 943 95 486 199 888 51 1734 69 561 81 56 61 79 8788 842 286 36 143 13 92 82 17 815 3 56 914 381 716 845 71 246 13 78 57 98 13 78 29 144 1762 12 49 5811 84 615 75 39 899 55 57 83 21 6539 1 37 27 14 858 87 691 884 7 77 28 74 8382 1 5 92 733 67 822 158 43 665 3356 41 568 3739 93 69 36 7755 46 52 89 653 311 96 862 267 4826 85 646 321 7 73 526 32 26 72 624 325 7211 19 599 34 1496 2492 32 123 69 9 75 47 26 937 5 718 35 82 7863 639 543 73 55 1 51 6251 523 941 44 6768 16 21 5413 556 936 8956 74 553 26 152 6329 3 4 2198 22 47 31 9 7 67 63 98 644 32 791 9966 9742 7683 762 64 39 683 37 8 3417 757 34 12 24 47 6185 94 77 74 23 948 382 632 62 772 815 982 11 829 524 62 797 38 976 759 4 692 32 7 4 558 6611 21 931 48 388 46 45 9331 945 748 548 2954 62 879 19 25 793 93 65 596 42 54 924 616 66 14 2216 1759 55 9 6429 11 5471 268 5724 945 51 8494 824 32 76 935 816 826 3 437 42 474 5 92 835 54 67 3 69 118 25 6 534 68 97 27 33 1175 19 195 369 97 24 4 23 7 1 123 956 181 3 291 234 63 632 381 13 38 315 25 27 29 737 97 7843 95 7172 21 78 343 451 17 52 99 4711 947 71 263 6976 67 66 924 82 21 72 23 781 1573 331 784 6 685 43 69 32 15 12 9125 3936 12 77 96 954 7949 9823 86 8953 65 8786 495 898 21 96 871 73 815 65 47 519 4 21 953 6 54 684 9117 77 441 198 598 2 2 79 93 47 2485 882 2676 81 28 642 4 279 4865 7946 7 73 39 19 3328 1427 92 87 274 694 88 76 543 31 521 361 56 722 84 394 698 64 989 3593 59 487 783 44 9962 53 218 654 16 81 358 255 3 668 475 87 6 892 748 1 868 72 73 13 47 574 2895 96 322 29 658 972 616 37 12 15 53 95 439 68 383 383 561 843 69 645 36 467 3 9831 265 948 276 48 612 435 19 483 87 28 87 62 67 994 34 73 45 33 52 96 46 63 991 612 2754 818 54 3848 44 56 76 58 2743 3 223 67 839 636 468 26 441 4664 652 497 61 81 999 94 2531 687 73 72 57 85 1 358 4621 93 96 71 4 271 34 6444 296 2 94 8436 27 599 852 273 9 46 8 36 26 983 781 867 3 731 42 238 214 427 12 377 265 57 83 651 457 84 8 53 54 7 272 8431 89 587 2998 328 36 193 258 41 81 29 92 76 9288 155 37 58 21 15 494 133 989 5294 55 316 85 359 43 613 276 946 779 1 738 85 86 586 3282 88 125 9 62 993 454 447 11 151 1 868 355 873 88 728 369 592 782 5546 95 45 25 5 5785 398 2 831 82 267 85 93 62 5312 94 968 36 58 3 849 9132 866 86 14 59 4 52 6 49 668 595 63 61 5 84 46 779 15 852 19 14 795 59 84 8 97 84 528 98 8 927 3 12 2298 637 481 32 7134 59 57 172 971 6879 5423 45 255 5 418 99 458 6615 82 91 378 425 27 46 13 19 2979 64 47 616 42 636 2 4 37 939 2 8 465 5 336 3 43 33 8 84 643 428 125 762 263 7 5868 91 38 12 5658 7987 2941 4848 54 99 35 9738 89 24 195 8183 17 29 48 927 757 338 5 94 35 8682 127 46 64 95 224 1423 3119 52 9 82 6 95 845 91 9167 68 726 251 8947 496 59 4441 319 14 876 94 764 5839 723 623 418 85 68 956 99 461 191 252 9598 16 57 33 9 47 1863 653 688 755 161 18 432 786 854 817 681 73 161 89 732 437 46 374 5566 7596 38 7562 117 66 999 87 65 8 345 62 7 8 359 957 254 96 78 793 447 62 22 983 393 87 34 556 73 8 9121 56 759 856 837 419 27 74 34 58 57 47 182 75 75 764 1648 7991 324 8124 65 4 6613 69 54 23 2574 581 28 467 543 4456 38 479 692 4258 66 751 94 54 26 66 8967 6 22 285 936 912 467 9 17 699 75 59 683 889 827 17 458 64 25 231 93 674 34 72 429 722
44 55 14 12 6 6495 171 65 765 11 8 795 68 4 657 14 618 6148 626 91 525 93 27 76 313 79 76 193 7 94 93 459 17 93 22 67 74 77 82 23 819 929 54 5872 14 83 152 18 54 557 618 369 6 734 67 45 84 142 727 3555 8 48 193 513 117 446 287 1852 828 215 389 24 451 52 69 9 749 54 515 61 5374 494 17 623 942 13 51 89 87 79 166 3 31 42 824 96 42 8413 79 97 73 9 2 713 1 4293 5 92 325 476 11 7199 369 444 3 7771 78 193 81 16 42 84 328 864 875 32 3 38 13 86 614 35 6 515 24 47 281 987 58 638 86 33 31 3 84 41 2 953 7434 84 7 2254 32 741 832 51 8 9 23 61 91 276 2 1 4 88 1 69 98 268 77 45 55 63 8 6 4 77 896 16 9677 56 5 793 6595 26 514 2392 58 2 62 7368 21 3 67 611 465 7 63 581 21 15 725 33 1 1 36 93 34 417 758 518 14 15 2658 61 5877 5442 9 541 94 2 84 58 73 359 29 629 9 83 8386 718 764 76 27 5 1 97 571 286 64 3743 64 3 9492 168 357 248 32 627 87 414 9 4 7 7471 33 3 47 8 5 79 42 44 956 47 68 6771 8756 2689 464 68 8 572 6 8 3462 73 6 2 18 1 2925 5 7 22 39 616 415 938 47 936 117 869 88 963 323 4 61 41 93 678 7 431 444 5 2 328 6414 54 919 69 148 4 43 2 636 821 281 6983 5 522 447 94 8 18 27 213 35 19 332 13 18 63 1975 6283 16 9 6239 4 9137 149 9351 8 77 98 121 16 41 688 712 664 31 9 41 75 4 98 262 72 61 3 13 161 63 62 77 52 69 66 6 14 416 114 866 377 5 8 83 2 73 767 675 766 6 184 461 16 437 132 8 4 453 81 32 28 72 37 8881 55 9579 85 6 343 57 45 37 1 9313 873 48 7 4186 22 5 272 74 73 7 13 327 5341 632 593 2 868 7 9 41 87 33 336 1634 383 54 4 6 7486 9766 91 26 19 5463 573 794 3 84 84 83 685 2 6 193 75 4 11 3 5 792 53 59 81 1 667 8 9 69 773 9 9761 87 82 3 11 466 6 522 8497 64 8 9 862 19 9548 9516 23 59 577 5 24 3 174 38 858 928 69 511 94 253 87 29 827 569 92 542 531 9 9923 136 13 4 35 67 61 151 3 366 66 3 38 846 99 2 826 17 85 54 68 712 5283 93 475 9 181 517 47 58 45 58 5 31 177 19 736 61 469 295 7 816 6 429 94 6836 885 18 753 53 72 486 51 254 19 41 676 13 14 213 14 61 38 56 12 73 67 43 247 615 7558 11 6 24 81 37 79 43 22 2 358 41 281 183 913 9 159 7823 725 61 87 6 237 99 1638 483 49 85 2 81 5 335 6 688 47 9 5 293 81 88 884 66 4 192 32 455 4 996 9 38 2 95 74 774 219 925 8 695 1 515 282 7 44 8 337 843 2 929 772 75 3 3 21 7 362 971 56 244 9 22 39 484 9549 52 88 89 34 91 8897 686 39 22 11 81 291 2 852 779 4 796 11 212 56 5 99 9 857 26 61 49 44 478 4714 96 732 9 88 536 145 629 88 215 4 79 493 2 53 98 235 7 461 7965 84 15 93 1 3627 392 6 46 37 469 19 65 8 9163 55 975 3 56 8 372 157 28 57 3 4 2 46 9 7 186 568 94 231 37 9 57 425 92 949 86 77 459 92 33 1 33 33 7 44 8 593 3 74 3816 89 246 56 11 92 42 39 154 3336 91 44 361 8 1 64 2 3 84 49 788 85 959 6 5 48 5568 37 2 8 92 96 4 3 5 21 4 9 13 7 1 6 75 8 9 51 241 576 616 82 815 46 6379 32 53 4 1175 19 1369 3198 664 34 57 7361 4 25 785 8537 1 7 8 8 85 693 7 95 19 1833 838 6 224 6 939 3436 6361 24 4 17 1 37 23 9 2483 46 156 776 15 348 17 5522 37 94 71 68 475 5974 4 346 992 76 57 569 81 658 979 463 999 32 65 9 1 62 7816 933 628 977 326 728 373 978 23 41 6 93 617 28 654 869 86 29 9724 6531 77 2452 359 11 616 63 93 5 356 23 9 9 641 844 779 129 3 225 855 75 19 789 838 11 5 91 52 6 568 1 59 3386 42 769 12 98 158 73 44 46 19 38 3 325 29 6472 766 8211 88 8 64 23 73 8 828 393 99 431 12 3941 1 47 388 4269 38 468 17 4 16 9 2515 7 62 172 188 844 124 2 7 88 56 23 37 13 991 99 917 48 65 493 42 22 75 54 224 56
* + * + + + * * * * + + * + + * + + * + + + + * + + * * + + * * * + * + * * * * + * * + * * * * + * * + * + * + + * * + + + * + * + + + * * * * + + * * + * * * + + * + * + + * + * + + * + * + + + * * + * + + * + + * + * + + * + * + * * * * + + + * + * * * + + * + + * + + + + * + * + + + + * + * + + * + + * * + * + + + * + + * * + + * + + * + * + + * + + * + + + * * + + * + * + * + + * + * + * + * + + * * + + + * * * + * + + + * + + + + + * * * * * + + * * + * * * + + + + + * * + + * + * + + + * + + + * + + * + * * * * * + + * + + + + * * + * + + + * * + + * + + * + * + + * + + + + * + + * * * * * + * + + * * + * * * + * + + * * * + + * * + * * * + * * * * * * + + * + + + + + + + + + + + * + + + + * * + * * * * * + + * * * * * + * * + + * * * + * * * * * + * * + * + + * * * + * * * + * + + + + * + * * * * + + * * + * * * + + + + * + + * * + + + + + * + + * * * * + + + + * + + + * * * + * * * * + * + * * + + * * * * + * + + + + * + * + + * + + + + * * * + + * + + * + * + * * * + + * + * * + + + * * * + * * + + * * * * + + + + + + * * * + * + * + + + * * + + * + + * + * + * + + * + * + * + + * + * + * + * + + * + + * + + + * * + + * + + * + + * + + * + * + + + + * * + * + + * * + * * * + + * + + + * + + + * + * + + + * + * + + * + * * + * * * + * + * * * * + + + * * + * * * * + + * + + + * * + * + + + * * * + + + * * * * * + * * + + * + + + + + * * + + * + + + + + * * * + + + * + * + * * + + + + + * * + * + * * * * + * + + + * * * + * + + + * * + + * * * + * + + * + * * + * * + * + + + + * * + * * * + + * * * + + + + * + + * + * + * * + + + + + + * * + + + * + * * + + * * + + * * + + * * + * + + + * + * + + + * + + + + * * * + + + * + * + + * + * * * * + + * * + + + + + * * + * + + + * + * + * * + + + * * * + + + + + * * + + + + + * * * * + + * + * + * * + * * * * + + + + + * + + * + * + * + * * * * + * * * + * * * * * * * + + + + + + + + + + * + + * * * * * + * * * + + * + + + + * * * + * + + * + * * + + + * + * * + + + + * * + + * * + * + + + * * * + + * + + + * + +

View File

@@ -0,0 +1,176 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 22+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
u64(0) `so`
array ptr i8[10] set pointers
pointers[0] get buffer store
1 set pointerlen
`0si`
while (buffer[get i] load '*' != buffer[get i] load '+' != &) {
if (buffer[`li`] load i8(10) ==) {
pointers[get pointerlen] buffer[get i] 1+ store
inc(pointerlen)
}
inc(i)
}
dec(pointerlen)
pointers[get pointerlen] load set ops
`0si`
while (ops[`li`] load `dsc` i8(10) !=) {
if (`lc` '*' == ) {
`0sj`
u64(1)
while (`lj` get pointerlen < ) {
pointers[`lj`] load `sp`
while (`lp` load ' ' ==) {inc(p)}
`lp` atol dup printnum64 i8(10) putc
while (`lp` load ' ' !=) {inc(p)}
*
pointers[`lj`] `lp` store
inc(j)
}
`lo+so`
} else if (`lc` '+' ==) {
`0sj`
u64(0)
while (`lj` get pointerlen < ) {
pointers[`lj`] load `sp`
while (`lp` load ' ' ==) {inc(p)}
`lp` atol dup printnum64 i8(10) putc
while (`lp` load ' ' !=) {inc(p)}
+
pointers[`lj`] `lp` store
inc(j)
}
`lo+so`
}
inc(i)
}
println("answer:")
`lo` printnum64 i8(10) putc
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1,210 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 22+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
u64(0) `so`
array ptr i8[10] set pointers
pointers[0] get buffer store
1 set pointerlen
`0si`
while (buffer[get i] load '*' != buffer[get i] load '+' != &) {
if (buffer[`li`] load i8(10) ==) {
pointers[get pointerlen] buffer[get i] 1+ store
inc(pointerlen)
}
inc(i)
}
dec(pointerlen)
pointers[get pointerlen] load set ops
`0si`
`0sj`
while (ops[`li`] load `dsc` i8(10) !=) {
if (`lc` '*' == ) {
println("*:")
u1(1) `sf`
u64(1)
while (`lf`) {
`0sk`
u64(0)
while (`lk` get pointerlen < ) {
if (pointers[`lk`] load `lj`+ load `dsC` ' ' !=) {
u64(10) * `lC` '0'- as u64 +
}
`lC` putc ' ' putc
inc(k)
}
inc(j)
dup printnum64 i8(10) putc
if (dup u64(0) !=) {
*
} else {
`t`u1(0)`sf`
}
}
`lo+so`
} else if (`lc` '+' == ) {
println("+:")
u1(1) `sf`
u64(0)
while (`lf`) {
`0sk`
u64(0)
while (`lk` get pointerlen < ) {
if (pointers[`lk`] load `lj`+ load `dsC` '0' >) {
u64(10) * `lC` '0'- as u64 +
}
`lC` putc ' ' putc
inc(k)
}
inc(j)
dup printnum64 i8(10) putc
if (dup u64(0) !=) {
+
} else {
`t`u1(0)`sf`
}
}
`lo+so`
}
inc(i)
}
println("answer:")
`lo` printnum64 i8(10) putc
exit(0)
}
void main() {
_start
}

142
src/plasl/2025/day7/input Normal file
View File

@@ -0,0 +1,142 @@
......................................................................S......................................................................
.............................................................................................................................................
......................................................................^......................................................................
.............................................................................................................................................
.....................................................................^.^.....................................................................
.............................................................................................................................................
....................................................................^.^.^....................................................................
.............................................................................................................................................
...................................................................^.....^...................................................................
.............................................................................................................................................
..................................................................^.^.^.^.^..................................................................
.............................................................................................................................................
.................................................................^.^...^...^.................................................................
.............................................................................................................................................
................................................................^.^.^.^.^.^.^................................................................
.............................................................................................................................................
...............................................................^.^.^.....^.^.^...............................................................
.............................................................................................................................................
..............................................................^.^.^.^...^.^.^.^..............................................................
.............................................................................................................................................
.............................................................^.^.^.^.......^.^.^.............................................................
.............................................................................................................................................
............................................................^.^.^...^.^...^.^.^.^............................................................
.............................................................................................................................................
...........................................................^.^.^...^.^...^.^.^.^.^...........................................................
.............................................................................................................................................
..........................................................^...^.....^.^.^.^.^.^...^..........................................................
.............................................................................................................................................
.........................................................^.^.......^.^...^.^.^...^.^.........................................................
.............................................................................................................................................
........................................................^.^.^.^.^...^.....^.^.....^.^........................................................
.............................................................................................................................................
.......................................................^.^.^.^.^.^...^.^.....^.^...^.^.......................................................
.............................................................................................................................................
......................................................^.^.^...^...^...^...^.^.^.^.^.^.^......................................................
.............................................................................................................................................
.....................................................^.^...^...^...^.^.^.^.^.^...^.^...^.....................................................
.............................................................................................................................................
....................................................^.^.^.....^.^.........^...^.^.^.....^....................................................
.............................................................................................................................................
...................................................^...^.^.^.....^.^.^...^...^.....^.^.^.^...................................................
.............................................................................................................................................
..................................................^.^.^.^.^.^.^...^.^.^...^...^.......^...^..................................................
.............................................................................................................................................
.................................................^...^.....^.^.^.^.....^.^...^.....^.^.^...^.................................................
.............................................................................................................................................
................................................^...^.....^.^.^.^.^.^.^.^.^.^.............^.^................................................
.............................................................................................................................................
...............................................^.^.^.....^.^.....^.^.^.^.^.....^.....^...^.^.^...............................................
.............................................................................................................................................
..............................................^...^.^.^.^.^.^.^.^.^.^.^.^.^.....^...^.^.^.^...^..............................................
.............................................................................................................................................
.............................................^.^.^...^.^.^...^...^.^.^.....^...^.....^.^.^...^.^.............................................
.............................................................................................................................................
............................................^.^.......^.^.^.^.....^.......^.^.^...^.^.........^.^............................................
.............................................................................................................................................
...........................................^...^...^...^...^.^.........^.^...^.^.....^.....^.^.^.^...........................................
.............................................................................................................................................
..........................................^...^.^...^.^.^.^.^...^.^.^.^.^.^.....^...^...^.^.^.^.^.^..........................................
.............................................................................................................................................
.........................................^.^...^.^...^.^.....^.^.......^.^.....^.^.^.^.^.^...^.^.^.^.........................................
.............................................................................................................................................
........................................^.^...^.^...^.^.......^.......^.^.^.^.^.^.^.......^.^.^...^.^........................................
.............................................................................................................................................
.......................................^.^.^...^.^...^.^...^.^...^.....^.^.^...^.......^...^.^.^.^.^.^.......................................
.............................................................................................................................................
......................................^.....^.^.....^.....^...^...^.^.^...^.^.^.^.....^.^.^...^.^.^...^......................................
.............................................................................................................................................
.....................................^.^.....^.^.^...^.....^.^.^.^...^.^.......^.^...^.^.^...^.^.^.^.^.^.....................................
.............................................................................................................................................
....................................^.^.^.^...^.......^.^...^...^.....^...^...^.^...^.^.^.......^.^.^...^....................................
.............................................................................................................................................
...................................^.^.....^.....^.^.^.^.^.^...^.^.^.^.^.^.....^.^...^.^...^.^.^...^.....^...................................
.............................................................................................................................................
..................................^...^...^.^.^...^.^.^.....^.^.^.....^.^.^.^.^.^.^.^.......^.^...^.^.^.^.^..................................
.............................................................................................................................................
.................................^.^...^.^.^.^.^...^.^...^.^.^.^.......^.^.^.^.^...^...^.^.^.^.^.^.^.......^.................................
.............................................................................................................................................
................................^...^.^.^...^.^.^.^.^...^.^.^...^...^.^...^.^.......^.^.^.^.^.....^.^.^.^.^.^................................
.............................................................................................................................................
...............................^.^.^.^.^...^.^.^.....^.^...^...^.^...^.^.^.^.^...^.^.^.^.^...^.^.^.^.^.^.^.^.^...............................
.............................................................................................................................................
..............................^.^.^.....^...^.^.^.^...^...^.^.^.^.^.^.^...^.^.^.......^...^.^.^.^.^.^...^.^.^.^..............................
.............................................................................................................................................
.............................^.....^.^...^.^.^.^...^.^.^.^...^...^...^.^.^.^.....^.^.......^...^.^...^.^.^.^...^.............................
.............................................................................................................................................
............................^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^.......^.^.^...^.^...^.....^............................
.............................................................................................................................................
...........................^.^...^...^...^.^.^.^...^.....^...^.^.^.^.^.^.^...^.......^.^.^.^.^...^...^.......^.^.^...........................
.............................................................................................................................................
..........................^.....^...^.^.^.....^.^.^...^...^...^.....^...^...^.^.^.^.^.^.^.^.^.....^...^.^.^.......^..........................
.............................................................................................................................................
.........................^.^.^...^.^.....^.^...^.^.^...^.....^.^.^.^.....^...^...^.^.^...^.^...^.....^.^.^.^.....^.^.........................
.............................................................................................................................................
........................^...^.^.^.^.^.......^.^.^.......^.^.^...^.^.....^.^.^.^.^...^.^.^.......^.^.^.........^.^.^.^........................
.............................................................................................................................................
.......................^.^.^.^.^.....^.^...^.^.^...^.^.^.^...^.^...^...^...^.....^.^.^.^...^.^.^.^...^.......^.^.^.^.^.......................
.............................................................................................................................................
......................^.^.^.^.^.^.....^.^.......^.^.^...^.^.^.^.^.^...^.^.^.^...^.^...^...^.......^.^.^.^...^.^.^.^...^......................
.............................................................................................................................................
.....................^.^.^.^...^.^.^.^.^.^.^...^...^.^.^.....^.^.^...^.^.^.....^.^.^.....^...^.^.^.^.^.^.^.^.^.^...^...^.....................
.............................................................................................................................................
....................^.^...^.^.^.^...^...^.........^.^...^...^...^...^.^...^.^.^...^...^...^...^.^.^.^.^.^.^...^.^.^.....^....................
.............................................................................................................................................
...................^.^.^...^...^...^.^.^...^.^.^...^.....^.^.^.^.....^.^...^...^.^...^...^.^.^.^.^.^...^.^.^.^...^.....^.^...................
.............................................................................................................................................
..................^.^.......^.^.^...^.^.^...^.^.....^.^.^.^.^.^.^.^.....^...^.^.^.........^.............^.......^...^.^.^.^..................
.............................................................................................................................................
.................^.^.........^...^.^.......^.^.^.^.^.^.^.^.^...^.....^.^.^.^.........^.^.^.^.^.....^...^...^.^.^.^.^...^...^.................
.............................................................................................................................................
................^.^.^...^.^.^.....^.^.^...^.^.^.^...^...^.^...^.^.^.^.^.^...^.^...^.^.^.....^...^.^...^...^.^...^.^.^.....^.^................
.............................................................................................................................................
...............^.^.^.^.^.^.^.^.....^...^.^.^.^.^...^.........^.^.^.^...^.^.^.....^...^...^.^.^.^.^.^.^.^.^.^...^...^.^.^.^.^.^...............
.............................................................................................................................................
..............^.^.^...^.^.^.^...^.^...^.^.^.^.^.^.^.^.^.^...^.^...^.....^.^...^.............^.^...^.^.^.^.^...^.^.^.^.....^.^.^..............
.............................................................................................................................................
.............^.^.^.^.....^...^...^.....^.^...^...^.......^...^...^.^...^...^.^.^.^.^.^.^.^.^.....^.^.^.^.^.^.^...^...^.^.^.....^.............
.............................................................................................................................................
............^...^.^.^.^.^...^...^.^.^.....^.^.^.^...^.^...^...^...^...^.^.......^.^.^.....^...^...^.^.^.^.^.^.......^.^.^...^.^.^............
.............................................................................................................................................
...........^.^.^.^.^.^.^.^...^.^...^.^.^.^.^.......^.^.^...^.^.^.^.^.^.^.^...^.^...^.........^.^.^.^.....^...^.^...^.^.^.^.....^.^...........
.............................................................................................................................................
..........^.....^.^.^.....^.....^.....^.^.^.^.^.^.^.^.^.....^.^.^.^.^...^.^.^...^.......^.^...^...^...^.....^...^.^.^.^.^.^.^.^.^.^..........
.............................................................................................................................................
.........^...^...^.^.^.....^.^.^.^.^.^...^...^...^...^.......^.^.^.^.^.^.^...^.^.^.^.^.^.........^...^.^.^...^.^.....^.^.^.^.^.....^.........
.............................................................................................................................................
........^.^.....^.^.^.^...^.^.^.^...^.^.^.^.^.^...^.^.^...^.^.^.^...^...^...^.........^.^.^.^.^.....^.^.^...^.^.^.^.^...^...^.^.^...^........
.............................................................................................................................................
.......^.^.^.^.^.^.^.......^.^.........^.^.^.^.^.^.^.^.^.^.^...^...^.^...^...^...^...^...^.^.....^...^...^...^.^.^.....^...^...^.....^.......
.............................................................................................................................................
......^.^.^...^.^.^.^.^.^.^.......^.^.^.^.^.^.^.^.....^.....^.....^.^.^.^.^.^.^.^...^.^.^.^.^.^...^.^.^.......^.^.....^.^.^.^.....^.^.^......
.............................................................................................................................................
.....^...^.^.^.^.....^...^...^.....^.^.^.^.^.^.^.....^.^.^...^...^.^.^.^.^.^...^...^.^.^.^.....^.^.^.^...^.....^.^...^...^.^...^.^.^.^.^.....
.............................................................................................................................................
....^.^.^...^.^.^.^.^.^...^...^.^.^.^.^...^.^.^.^...^...^.^...^.^.^...^.^.^.^.^.^.....^.^.^.^.^.^.....^...^.^.^.^.^...^.......^...^.....^....
.............................................................................................................................................
...^.^.^.....^.^.^.^.^.....^...^.....^...^.^.^.^.^...^...^.^.^.^.^.^.^...^.^.^...^.^.^.....^.....^...^.^.^.^.^...^.^...^...^.^...^.^.^.^.^...
.............................................................................................................................................
..^.^.......^.^.^.^...^...^.^.....^.^.^.^.^.^...^.^.....^...^.^.....^.^...^.^.^...^...^.^.^.^.....^.^.^...^...^...^.^.^.^...^.^.^...^.^...^..
.............................................................................................................................................
.^.^...^.^.^...^...^...^.^.....^.^.....^.^.^.^...^.....^.^.^.^...^.^.^.^.^.^...^.^.^.....^.^.^.^.^.^.^...^.^.^.^.....^.^.^.^.^.^.^.^.....^.^.
.............................................................................................................................................

View File

@@ -0,0 +1,16 @@
.......S.......
...............
.......^.......
...............
......^.^......
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............

View File

@@ -0,0 +1,148 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 22+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
`0si`
`0sw`
u64(0) set out
array u1[256] set beams
while (`li` 256 < ) {
beams[`li`] u1(0) store
inc(i)
}
`0si`
while (`li` get size < ) {
if (buffer[get i] load 'S' ==) {
beams[`lw`] u1(1) store
inc(w)
} else if (buffer[get i] load '^' ==) {
if (beams[`lw`] load) {
beams[`lw1-`] u1(1) store beams[`lw`] u1(0) store beams[`lw1+`] u1(1) store
inc(out)
}
inc(w)
} else if (buffer[get i] load '.' == ){
inc(w)
} else {
`0sw`
}
inc(i)
}
println("answer:")
get out printnum64 i8(10) putc
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1,166 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 22+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
ptr i8 memset(ptr i8, i32, u64) {
`sn` as i8 `sc`
u64(0) `si`
while (`liln` < ) {
`1+dlc` store
inc(i)
}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
`0si`
`0sw`
array u64[256] set beams
while (`li` 256 < ) {
beams[`li`] u64(0) store
inc(i)
}
`0si`
while (`li` get size < ) {
if (buffer[get i] load 'S' ==) {
beams[`lw`] u64(1) store
inc(w)
} else if (buffer[get i] load '^' ==) {
if (beams[`lw`] load u64(0) >) {
beams[`lw`] `d` load `s1` u64(0) store
beams[`lw1-`] `d` load `l1+` store
beams[`lw1+`] `d` load `l1+` store
}
inc(w)
} else if (buffer[get i] load '.' == ){
inc(w)
} else {
`0sw`
}
inc(i)
}
u64(0) set out
`0si`
while (`li` 256 < ) {
beams[`li`] load
get out + set out
inc(i)
}
println("answer:")
get out printnum64 i8(10) putc
exit(0)
}
void main() {
_start
}

1001
src/plasl/2025/day8/input Normal file

File diff suppressed because it is too large Load Diff

1001
src/plasl/2025/day8/input.s Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
162,817,812
57,618,57
906,360,560
592,479,940
352,342,300
466,668,158
542,29,236
431,825,988
739,650,466
52,470,668
216,146,977
819,987,18
117,168,530
805,96,715
346,949,466
970,615,88
941,993,340
862,61,35
984,92,344
425,690,689

View File

@@ -0,0 +1,337 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
ptr i8 mmap(ptr i8, u64, i32, i32, i32, i64) {
`sfsesdscsbsa`
syscall6(i64(9), `la` as i64, `lb` as i64, `lc` as i64, `ld` as i64, `le` as i64, `lf`)
as ptr i8
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 21+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
ptr i8 memset(ptr i8, i32, u64) {
`sn` as i8 `sc`
u64(0) `si`
while (`liln` < ) {
`1+dlc` store
inc(i)
}
}
void heap_add(u64, i32, i32, ptr u64, ptr i32, ptr i32) {
`sysx` set heap set vy set vx set value
heap[0] load set size
heap[get size] get value store
y[get size] get vy store
x[get size] get vx store
get size as i32 set index
# swap while not heaped
while(get index 0 > heap[get index] load heap[get index 2/] load < &) {
heap[get index] set t1 heap[get index 2/] set t2
get t1 load get t2 load get t1 rev store get t2 rev store
x[get index] `ds.` load x[get index 2/] `ds,` load `l.r` store `l,r` store
y[get index] `ds.` load y[get index 2/] `ds,` load `l.r` store `l,r` store
get index 2/ set index
}
heap[0] dup load u64(1)+ store
}
void heap_pop(ptr u64, ptr i32, ptr i32) {
`sysx` set heap
heap[0] dup load u64(1) - dup as i32 set size store
heap[1] heap[get size 1-] load store # set the heap[0] as last heap element
y[1] y[get size 1-] load store
x[1] x[get size 1-] load store
u1(1) set cont
`1si`
# down heap
while (get cont) {
`li` set nexti
if (`li2*` get size < heap[get nexti] load heap[`li2*`] load > &) {
`li2*` set nexti
}
if (`li2*1+` get size < heap[get nexti] load heap[`li2*1+`] load > &) {
`li2*1+` set nexti
}
if (`li` get nexti !=) {
heap[get i] `ds.` load heap[get nexti] `ds,` load `l.r` store `l,r` store
x[get i] `ds.` load x[get nexti] `ds,` load `l.r` store `l,r` store
y[get i] `ds.` load y[get nexti] `ds,` load `l.r` store `l,r` store
get nexti set i
} else {
u1(0) set cont
}
}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
array i32[1024] set px
array i32[1024] set py
array i32[1024] set pz
u64(0) `so`
`0si0sc`
while (`li` get size 1- < ) {
atoi(buffer[`li`]) px[`lc`] `r` store
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) py[`lc`] `r` store
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) pz[`lc`] `r` store
while (buffer[`li`] load i8(10) !=) {inc(i)} inc(i)
inc(c)
}
pz[0] load py[0] load px[0] load
printnum ',' putc printnum ',' putc printnum i8(10) putc
println("distance calculation...")
mmap(u64(0) as ptr i8, u64(2048) u64(4096) *, 2 1|, 32 2|, 0, i64(0)) as ptr u64 set dist
dist[524800] as ptr i32 set dist_p1
dist_p1[524800] set dist_p2
dist[0] u64(1) store
`0si`
while (`lilc` < ) {
`li1+sj`
while (`ljlc` <) {
#`liljr` printnum ',' putc printnum i8(10) putc
heap_add(
abs(px[`li`] load px[`lj`] load -) as u64 `d*`
abs(py[`li`] load py[`lj`] load -) as u64 `d*` +
abs(pz[`li`] load pz[`lj`] load -) as u64 `d*` +,
get i, get j
get dist, get dist_p1, get dist_p2
)
inc(j)
}
inc(i)
}
println("chain joining...")
array i32[1024] set links
memset(get links as ptr i8, 0, 4 1024* as u64) trash
array i32[1024] set linkcount
memset(get linkcount as ptr i8, 0, 4 1024* as u64) trash
0 set numlinks
`0si`
while (`li` 1000 <) {
#dist[0] load printnum64 ' ' putc
#dist[1] load printnum64 ',' putc
#dist_p1[1] load printnum ',' putc
#dist_p2[1] load printnum i8(10) putc
dist_p1[1] load set p1 dist_p2[1] load set p2
if (links[get p1] load 0 == links[get p2] load 0 == &) {
# create a new link between these unlinked posts
inc(numlinks)
links[get p1] get numlinks store
links[get p2] get numlinks store
linkcount[get numlinks] dup load 2+ store
} else if (links[get p1] load 0 != links[get p2] load 0 == &) {
# link p2 to p1's link
links[get p2] links[get p1] load store
linkcount[links[get p1] load] dup load 1+ store
} else if (links[get p1] load 0 == links[get p2] load 0 != &) {
# link p1 to p2's link
links[get p1] links[get p2] load store
linkcount[links[get p2] load] dup load 1+ store
} else if (links[get p1] load links[get p2] load !=){
# big annoying link
links[get p1] load set into
links[get p2] load set from
linkcount[get into] dup load linkcount[get from] load + store
linkcount[get from] 0 store
`0sj`
while (`ljlc`<) {
if(links[`lj`] load get from ==) {
links[`lj`] get into store
}
inc(j)
}
}
heap_pop(get dist, get dist_p1, get dist_p2)
inc(i)
}
println("finding largest...")
array i32[3] set biggest
memset(get biggest as ptr i8, 0, 4 3* as u64) trash
`0si`
while (`li` get numlinks 1+<) {
`0sj`
linkcount[`li`] load set ccount
while (`lj` 3 < ) {
if (biggest[`lj`] load get ccount <) {
get ccount biggest[`lj`] dup load set ccount rev store
}
inc(j)
}
inc(i)
}
`0si`
1
while (`li` 3 <) {
printnum(biggest[`li`] load) i8(10) putc
biggest[`li`] load *
inc(i)
}
println("answer:")
printnum64(as u64)
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1,375 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
ptr i8 mmap(ptr i8, u64, i32, i32, i32, i64) {
`sfsesdscsbsa`
syscall6(i64(9), `la` as i64, `lb` as i64, `lc` as i64, `ld` as i64, `le` as i64, `lf`)
as ptr i8
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 21+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
ptr i8 memset(ptr i8, i32, u64) {
`sn` as i8 `sc`
u64(0) `si`
while (`liln` < ) {
`1+dlc` store
inc(i)
}
}
void heap_add(u64, i32, i32, ptr u64, ptr i32, ptr i32) {
`sysx` set heap set vy set vx set value
heap[0] load set size
heap[get size] get value store
y[get size] get vy store
x[get size] get vx store
get size as i32 set index
#printnum(get index) '.' putc printnum(get index 2/) i8(10) putc
# swap while not heaped
while(
get index 2/ set parent
get index 1 > heap[get index] load heap[get parent] load < &
) {
#printnum(get index) ',' putc printnum(get parent) i8(10) putc
heap[get index] `ds.` load heap[get parent] `ds,` load `l.r` store `l,r` store
x[get index] `ds.` load x[get parent] `ds,` load `l.r` store `l,r` store
y[get index] `ds.` load y[get parent] `ds,` load `l.r` store `l,r` store
get parent set index
}
heap[0] dup load u64(1)+ store
}
void heap_pop(ptr u64, ptr i32, ptr i32) {
`sysx` set heap
heap[0] dup load u64(1) - dup as i32 set size store
heap[1] heap[get size 1-] load store # set the heap[0] as last heap element
y[1] y[get size 1-] load store
x[1] x[get size 1-] load store
u1(1) set cont
`1si`
# down heap
while (get cont) {
`li` set nexti
if (`li2*` get size < heap[get nexti] load heap[`li2*`] load > &) {
`li2*` set nexti
}
if (`li2*1+` get size < heap[get nexti] load heap[`li2*1+`] load > &) {
`li2*1+` set nexti
}
if (`li` get nexti !=) {
heap[get i] `ds.` load heap[get nexti] `ds,` load `l.r` store `l,r` store
x[get i] `ds.` load x[get nexti] `ds,` load `l.r` store `l,r` store
y[get i] `ds.` load y[get nexti] `ds,` load `l.r` store `l,r` store
get nexti set i
} else {
u1(0) set cont
}
}
}
void check_heap(ptr u64) {
set heap
heap[0] load as i32 set size
`1si`
while (`li` get size <) {
#printnum(`li`) ':'putc
#printnum64(heap[`li`]load) ' ' putc
if (`li2*` get size < heap[`li2*`] load heap[`li`] load <&) {
#printnum64(heap[`li2*`]load) ' ' putc
exit(3)
}
if (`li2*1+` get size < heap[`li2*1+`] load heap[`li`] load <&) {
#printnum64(heap[`li2*1+`]load) ' ' putc
exit(3)
}
inc(i)
}
i8(10) putc
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
array i32[1024] set px
array i32[1024] set py
array i32[1024] set pz
u64(0) `so`
`0si0sc`
while (`li` get size 1- < ) {
atoi(buffer[`li`]) px[`lc`] `r` store
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) py[`lc`] `r` store
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) pz[`lc`] `r` store
while (buffer[`li`] load i8(10) !=) {inc(i)} inc(i)
inc(c)
}
#pz[0] load py[0] load px[0] load
#printnum ',' putc printnum ',' putc printnum i8(10) putc
println("distance calculation...")
mmap(u64(0) as ptr i8, u64(2048) u64(4096) *, 2 1|, 32 2|, 0, i64(0)) as ptr u64 set dist
dist[524800] as ptr i32 set dist_p1
dist_p1[524800] set dist_p2
dist[0] u64(1) store
`0si`
while (`lilc` < ) {
`li1+sj`
while (`ljlc` <) {
#`liljr` printnum ',' putc printnum i8(10) putc
heap_add(
abs(px[`li`] load px[`lj`] load -) as u64 `d*`
abs(py[`li`] load py[`lj`] load -) as u64 `d*` +
abs(pz[`li`] load pz[`lj`] load -) as u64 `d*` +,
get i, get j
get dist, get dist_p1, get dist_p2
)
#check_heap(get dist)
#check_heap(get dist)
inc(j)
}
inc(i)
}
println("chain joining...")
array i32[1024] set links
memset(get links as ptr i8, 0, 4 1024* as u64) trash
array i32[1024] set linkcount
memset(get linkcount as ptr i8, 0, 4 1024* as u64) trash
0 set numlinks
0 set maxl
0 set clink
`0s10s2`
`0si`
while (get maxl `lc` !=) {
dist_p1[1] load `s1`
dist_p2[1] load `s2`
#dist[0] load printnum64 ' ' putc
#dist[1] load printnum64 ',' putc
#dist_p1[1] load printnum ',' putc
#dist_p2[1] load printnum ',' putc
#printnum64(px[`l1`] load as u64 px[`l2`] load as u64 *) ')' putc
#printnum(get maxl)
#i8(10) putc
dist_p1[1] load set p1 dist_p2[1] load set p2
if (links[get p1] load 0 == links[get p2] load 0 == &) {
# create a new link between these unlinked posts
inc(numlinks)
links[get p1] get numlinks store
links[get p2] get numlinks store
linkcount[get numlinks] dup load 2+ store
get numlinks set clink
} else if (links[get p1] load 0 != links[get p2] load 0 == &) {
# link p2 to p1's link
links[get p2] links[get p1] load store
linkcount[links[get p1] load] dup load 1+ store
links[get p1] load set clink
} else if (links[get p1] load 0 == links[get p2] load 0 != &) {
# link p1 to p2's link
links[get p1] links[get p2] load store
linkcount[links[get p2] load] dup load 1+ store
links[get p2] load set clink
} else if (links[get p1] load links[get p2] load !=){
# big annoying link
links[get p1] load set into
links[get p2] load set from
linkcount[get into] dup load linkcount[get from] load + store
linkcount[get from] 0 store
`0sj`
while (`ljlc`<) {
if(links[`lj`] load get from ==) {
links[`lj`] get into store
}
inc(j)
}
get into set clink
}
if (get maxl linkcount[get clink] load <) {
linkcount[get clink] load set maxl
}
heap_pop(get dist, get dist_p1, get dist_p2)
inc(i)
}
`0si`
while (`li` get numlinks 1+ <) {
#printnum(linkcount[`li`] load) i8(10) putc
inc(i)
}
println("answer:")
printnum64(px[`l1`] load as u64 px[`l2`] load as u64 *)
exit(0)
}
void main() {
_start
}

496
src/plasl/2025/day9/input Normal file
View File

@@ -0,0 +1,496 @@
98139,50134
98139,51344
97752,51344
97752,52552
97690,52552
97690,53768
97716,53768
97716,55028
98110,55028
98110,56140
97156,56140
97156,57477
97912,57477
97912,58631
97393,58631
97393,59810
97068,59810
97068,60999
96805,60999
96805,62191
96547,62191
96547,63241
95790,63241
95790,64439
95574,64439
95574,65656
95388,65656
95388,66774
94904,66774
94904,67836
94290,67836
94290,69244
94501,69244
94501,70268
93788,70268
93788,71148
92809,71148
92809,72346
92489,72346
92489,73328
91753,73328
91753,74320
91051,74320
91051,75306
90348,75306
90348,76613
90136,76613
90136,77644
89480,77644
89480,78337
88364,78337
88364,79295
87628,79295
87628,80165
86784,80165
86784,81228
86171,81228
86171,82441
85705,82441
85705,83098
84624,83098
84624,84064
83873,84064
83873,84825
82918,84825
82918,85335
81744,85335
81744,86744
81365,86744
81365,86949
79956,86949
79956,88350
79514,88350
79514,88946
78431,88946
78431,89218
77134,89218
77134,90171
76314,90171
76314,91035
75418,91035
75418,91538
74296,91538
74296,91669
72975,91669
72975,92779
72193,92779
72193,92918
70903,92918
70903,93286
69742,93286
69742,93717
68615,93717
68615,94951
67809,94951
67809,95446
66686,95446
66686,95710
65481,95710
65481,95839
64241,95839
64241,95966
63013,95966
63013,96113
61801,96113
61801,97201
60813,97201
60813,96716
59464,96716
59464,97458
58368,97458
58368,97772
57181,97772
57181,97368
55897,97368
55897,97883
54733,97883
54733,97638
53493,97638
53493,97722
52286,97722
52286,98001
51081,98001
51081,97675
49866,97675
49866,97707
48657,97707
48657,98136
47423,98136
47423,97634
46238,97634
46238,98098
44972,98098
44972,97622
43799,97622
43799,97855
42531,97855
42531,97299
41385,97299
41385,96972
40209,96972
40209,96335
39110,96335
39110,96563
37804,96563
37804,95651
36799,95651
36799,95762
35501,95762
35501,94989
34481,94989
34481,95417
33034,95417
33034,94438
32104,94438
32104,93632
31130,93632
31130,93574
29830,93574
29830,93411
28554,93411
28554,92731
27526,92731
27526,91888
26595,91888
26595,91570
25371,91570
25371,90514
24589,90514
24589,89701
23674,89701
23674,89384
22423,89384
22423,88761
21369,88761
21369,87707
20642,87707
20642,87225
19472,87225
19472,85980
18936,85980
18936,85790
17482,85790
17482,84618
16907,84618
16907,83563
16247,83563
16247,82768
15333,82768
15333,82271
14078,82271
14078,80864
13842,80864
13842,80408
12492,80408
12492,79557
11593,79557
11593,78479
10986,78479
10986,77474
10289,77474
10289,76312
9830,76312
9830,75465
8887,75465
8887,74377
8322,74377
8322,73361
7631,73361
7631,71962
7666,71962
7666,71126
6622,71126
6622,70096
5936,70096
5936,68996
5389,68996
5389,67683
5367,67683
5367,66513
5025,66513
5025,65515
4188,65515
4188,64224
4215,64224
4215,63167
3489,63167
3489,61910
3462,61910
3462,60708
3257,60708
3257,59625
2484,59625
2484,58265
3125,58265
3125,57194
2142,57194
2142,55886
2721,55886
2721,54690
2552,54690
2552,53529
1870,53529
1870,52300
1984,52300
1984,51075
2287,51075
2287,50126
94997,50126
94997,48641
1738,48641
1738,47438
2142,47438
2142,46228
2242,46228
2242,45035
2503,45035
2503,43802
2400,43802
2400,42582
2469,42582
2469,41477
3203,41477
3203,40123
2614,40123
2614,39130
3748,39130
3748,37771
3311,37771
3311,36688
3965,36688
3965,35618
4607,35618
4607,34321
4547,34321
4547,33197
5019,33197
5019,31962
5208,31962
5208,31031
6138,31031
6138,29690
6123,29690
6123,28824
7136,28824
7136,27785
7761,27785
7761,26487
7917,26487
7917,25366
8421,25366
8421,24655
9592,24655
9592,23544
10102,23544
10102,22385
10560,22385
10560,21358
11223,21358
11223,20681
12341,20681
12341,19804
13179,19804
13179,18387
13383,18387
13383,17846
14610,17846
14610,16742
15209,16742
15209,16240
16429,16240
16429,14832
16758,14832
16758,14652
18243,14652
18243,13592
18921,13592
18921,13025
20023,13025
20023,11804
20605,11804
20605,11323
21765,11323
21765,10506
22675,10506
22675,10187
23921,10187
23921,9541
24939,9541
24939,8539
25750,8539
25750,7925
26800,7925
26800,7268
27831,7268
27831,7118
29114,7118
29114,6182
30015,6182
30015,5471
31038,5471
31038,5830
32500,5830
32500,5118
33520,5118
33520,4516
34595,4516
34595,3842
35659,3842
35659,3852
36935,3852
36935,3660
38140,3660
38140,3437
39332,3437
39332,2972
40472,2972
40472,2852
41686,2852
41686,2524
42863,2524
42863,2771
44119,2771
44119,2721
45326,2721
45326,2485
46515,2485
46515,2257
47712,2257
47712,2068
48919,2068
48919,2423
50133,2423
50133,2070
51349,2070
51349,2501
52542,2501
52542,1823
53804,1823
53804,2662
54947,2662
54947,2141
56231,2141
56231,2160
57466,2160
57466,2742
58606,2742
58606,3176
59759,3176
59759,3160
61007,3160
61007,3713
62122,3713
62122,3596
63418,3596
63418,4576
64391,4576
64391,4917
65550,4917
65550,5332
66685,5332
66685,5802
67798,5802
67798,5698
69158,5698
69158,5988
70371,5988
70371,7040
71222,7040
71222,7085
72570,7085
72570,8251
73325,8251
73325,8772
74424,8772
74424,9591
75344,9591
75344,10037
76498,10037
76498,10972
77326,10972
77326,11171
78680,11171
78680,12095
79510,12095
79510,12791
80513,12791
80513,13793
81258,13793
81258,14467
82284,14467
82284,15132
83330,15132
83330,16459
83729,16459
83729,17146
84756,17146
84756,17950
85674,17950
85674,18854
86486,18854
86486,19790
87261,19790
87261,20559
88254,20559
88254,21754
88691,21754
88691,22539
89690,22539
89690,23885
89867,23885
89867,24583
91032,24583
91032,25801
91371,25801
91371,27020
91675,27020
91675,27977
92449,27977
92449,29020
93074,29020
93074,30116
93597,30116
93597,31248
94036,31248
94036,32343
94564,32343
94564,33526
94865,33526
94865,34739
95057,34739
95057,35811
95668,35811
95668,37049
95744,37049
95744,38096
96509,38096
96509,39350
96482,39350
96482,40433
97222,40433
97222,41595
97659,41595
97659,42878
97375,42878
97375,44100
97379,44100
97379,45229
98259,45229
98259,46460
98267,46460
98267,47709
97813,47709
97813,48914
98189,48914
98189,50134

View File

@@ -0,0 +1,13 @@
4,1
6,1
6,3
8,3
8,5
6,5
6,7
4,7
4,5
2,5
2,3
4,3

View File

@@ -0,0 +1,9 @@
7,1
11,1
11,7
9,7
9,5
2,5
2,3
7,3

View File

@@ -0,0 +1,151 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 22+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
array i32[512] set px
array i32[512] set py
u64(0) `so`
`0sc`
`0si`
while (`li1+` get size < ) {
atoi(buffer[`li`]) px[`lc`] `r` store
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) py[`lc`] `r` store
while (buffer[`li`] load i8(10) !=) {inc(i)} inc(i)
inc(c)
}
`0si`
while (`lilc` < ) {
`li1+sj`
while(`ljlc` <){
px[`li`] load set x1 py[`li`] load set y1
px[`lj`] load set x2 py[`lj`] load set y2
if (abs(get x1 get x2 -) `1+` as u64 abs(get y1 get y2 -) `1+` as u64 * `lo` > ) {
abs(get x1 get x2 -) `1+` as u64 abs(get y1 get y2 -) `1+` as u64 * `so`
}
inc(j)
}
inc(i)
}
println("answer:")
printnum64(get o)
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1,170 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 22+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
void _start() {
open("input.q", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
`0so`
`100000` set trx `100000` set try
`100000` set brx `0` set bry
`0` set blx `0` set bly
`0` set tlx `100000` set tly
`0si`
while (`li1+` get size < ) {
atoi(buffer[`li`]) `sx`
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) `sy`
while (buffer[`li`] load i8(10) !=) {inc(i)} inc(i)
`lxlyr` printnum ',' putc printnum i8(10) putc
# if less than topright, then
if (`lxly+` get trx get try + <=) {
`lxly` set try set trx
}
# if y - x > br
if (`lylx-` get bry get brx - >=) {
`lxly` set bry set brx
}
# if more than bottom left
if (`lxly+` get blx get bly+ >=) {
`lxly` set bly set blx
}
# if x - y > tl
if (`lxly-` get tlx get tly - >=) {
`lxly` set tly set tlx
}
}
print("tr: ")
printnum(get trx) putc(',') printnum(get try) putc(i8(10))
print("br: ")
printnum(get brx) putc(',') printnum(get bry) putc(i8(10))
print("bl: ")
printnum(get blx) putc(',') printnum(get bly) putc(i8(10))
print("tl: ")
printnum(get tlx) putc(',') printnum(get tly) putc(i8(10))
get blx get trx - `1+` as u64 get bly get try - `1+` as u64 * `s1`
get tlx get brx - `1+` as u64 get bry get tly - `1+` as u64 * `s2`
if (`l1l2`>) {
`l1`
} else {
`l2`
}
println("answer:")
printnum64
exit(0)
}
void main() {
_start
}

View File

@@ -0,0 +1,344 @@
i64 write(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(1), `la` as i64, `lb` as i64, `lc` as i64)
}
i64 read(i32, ptr i8, u64) {
`scsbsa`
syscall3(i64(0), `la` as i64, `lb` as i64, `lc` as i64)
}
i32 open(ptr i8, i32, i32) {
`scsbsa`
syscall3(i64(2), `la` as i64, `lb` as i64, `lc` as i64)
as i32
}
ptr i8 mmap(ptr i8, u64, i32, i32, i32, i64) {
`sfsesdscsbsa`
syscall6(i64(9), `la` as i64, `lb` as i64, `lc` as i64, `ld` as i64, `le` as i64, `lf`)
as ptr i8
}
void exit(i32) {
as i64 i64(231) rev
syscall1 trash
}
void putc(i8) {
array i8[1] `dstr` store
write(1, `lt`, u64(1)) trash
}
u64 strlen(ptr i8) {
dup while(dup load i8(0) !=) { 1+ } `r-`
}
void print(ptr i8) {
1 rev dup strlen write trash
}
void println(ptr i8) {
print i8(10) putc
}
void printnum(i32) {
if (dup 0 ==) {
putc('0')
} else if (dup 0 <) {
`0r-` '-' putc
}
array i8[11] 10+ dup i8(0) store -1+ `sb`
while (dup 0 !=) {
10 divmod 48+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
void printnum64(u64) {
if (dup u64(0) ==) {
putc('0')
}
array i8[22] 21+ dup i8(0) store -1+ `sb`
while (dup u64(0) !=) {
u64(10) divmod u64(48)+ as i8
`lb` rev store
`lb` -1+ `sb`
} trash
print(`lb`1+)
}
i32 atoi(ptr i8) {
set string
0
while (get string load '0' >= get string load '9' <= &) {
10* get string load '0'- as i32 +
get string 1+ set string
}
}
u64 atol(ptr i8) {
set string
u64(0)
while (get string load '0' >= get string load '9' <= &) {
u64(10)* get string load '0'- as u64 +
get string 1+ set string
}
}
i32 abs(i32) {
if (dup 0 <) {`0r-`}
}
ptr i8 memset(ptr i8, i32, u64) {
`sn` as i8 `sc`
u64(0) `si`
while (`liln` < ) {
`1+dlc` store
inc(i)
}
}
u1 check_line(i32, i32, i32, ptr i32, ptr i32, ptr i32, i32) {
set linecount set linep set lineh set linel
set pos set top set bottom
# swap if needed
if (get top get bottom <) {get top get bottom set top set bottom}
#printnum(get pos) ']' putc
#printnum(get top) ',' putc
#printnum(get bottom) i8(10) putc
`0si`
while (`li` get linecount <) {
#printnum(linep[`li`] load) ':' putc
#printnum(lineh[`li`] load) ',' putc
#printnum(linel[`li`] load)
#if (get top linep[`li`] load >= get bottom linep[`li`] load <= &) { '!' putc }
#if (lineh[`li`] load get pos >= linel[`li`] load get bottom <= &) { '@' putc }
#i8(10) putc
if (get top linep[`li`] load >= get bottom linep[`li`] load <= & # this line is positioned between
lineh[`li`] load get pos >= linel[`li`] load get pos <= & # it intersects
&) {
#println("intersect")
return u1(0)
}
inc(i)
}
u1(1)
}
void floodfill(ptr i8, i32) {
set w set map
`0sy`
while (`lylw` <) {
u1(0) set flag
#'.' putc
`0sx`
while (`lxlw` <) {
#printnum(`lx`) ',' putc printnum(`ly`) if (get flag) {'T'} else {'F'} putc
#i8(10) putc
if (map[`lylw*lx+`] `dsp` load '#' == ) {
get flag u1(1) ^ set flag
}
if (get flag) {
`lp` '#' store
}
inc(x)
}
inc(y)
}
}
void _start() {
open("input", 0, 0) set file
array i8[65535] set buffer
get buffer i8(48) store
read(get file, get buffer, u64(65535)) as i32 set size
#get buffer get size+ i8(10) store
array i32[512] set px
array i32[512] set py
u64(0) `so`
100000 `sw`
# println("mmap")
# yeah whatever go my constants
# mmap(u64(0) as ptr i8, u64(419304) u64(4096) *, 1 2 |, 32 2 |, 0, i64(0)) set map
# if (get map as i64 i64(-1) == ){
# println("mmap failed")
# exit(1)
#}
# memset(get map, 0, u64(10000000000)) trash
# println("wmpwmef")
# stride
# load points
`0sc`
`0si`
while (`li1+` get size < ) {
atoi(buffer[`li`]) px[`lc`] `r` store
while (buffer[`li`] load ',' !=) {inc(i)} inc(i)
atoi(buffer[`li`]) py[`lc`] `r` store
while (buffer[`li`] load i8(10) !=) {inc(i)} inc(i)
inc(c)
}
println("mapping")
array i32[512] set hlineh
array i32[512] set hlinel
array i32[512] set hlinep
0 set hlinec
array i32[512] set vlineh
array i32[512] set vlinel
array i32[512] set vlinep
0 set vlinec
# map out lines
# i'm just assuming clockwise. i think that's valid
`1si`
# TODO: set lastturn properly
'Q' set lastturn
while (`lilc` <=) {
px[`li1-`] load set x1 py[`li1-`] load set y1
if (`lilc` != ) {
px[`li`] load set x2 py[`li`] load set y2
} else {
# last iter
px[0] load set x2 py[0] load set y2
}
if (get x1 get x2 == ) {
# store vline
if (get y1 get y2 < ) {
# down
# corner
if (get lastturn 'l' ==) {inc(y1) hlinel[get hlinec 1-] dup load `1+` store}
'd' set lastturn
get x1 1+ get y1 get y2
} else {
# up
if (get lastturn 'r' ==) {dec(y1) hlineh[get hlinec 1-] dup load `1-` store}
'u' set lastturn
get x1 1- get y2 get y1
}
vlineh[get vlinec] rev store vlinel[get vlinec] rev store
vlinep[get vlinec] rev store
inc(vlinec)
} else if (get y1 get y2 == ) {
# store hline
if (get x1 get x2 < ) {
# right
if (get lastturn 'd' ==) {inc(x1) vlineh[get vlinec 1-] dup load `1-` store}
'r' set lastturn
get y1 1- get x1 get x2
} else {
# left
if (get lastturn 'u' ==) {dec(x1) vlinel[get vlinec 1-] dup load `1+` store}
'l' set lastturn
get y1 1+ get x2 get x1
}
hlineh[get hlinec] rev store hlinel[get hlinec] rev store
hlinep[get hlinec] rev store
inc(hlinec)
}
inc(i)
}
println("checking")
`0si`
while (`lilc` < ) {
`li1+sj`
while(`ljlc` <){
px[`li`] load set x1 py[`li`] load set y1
px[`lj`] load set x2 py[`lj`] load set y2
#i8(10) putc
#printnum(get x1) ',' putc printnum(get y1) i8(10) putc
#printnum(get x2) ',' putc printnum(get y2) i8(10) putc
if (check_line(get x1, get x2, get y1, get vlinel, get vlineh, get vlinep, get vlinec)
check_line(get x1, get x2, get y2, get vlinel, get vlineh, get vlinep, get vlinec) &
check_line(get y1, get y2, get x1, get hlinel, get hlineh, get hlinep, get hlinec) &
check_line(get y1, get y2, get x2, get hlinel, get hlineh, get hlinep, get hlinec) & ) {
#println("okay")
if (abs(get x1 get x2 -) `1+` as u64 abs(get y1 get y2 -) `1+` as u64 * `lo` > ) {
#println("max")
abs(get x1 get x2 -) `1+` as u64 abs(get y1 get y2 -) `1+` as u64 * `so`
#if (`lo` u64(25) == ) {exit(2)}
}
}
inc(j)
}
inc(i)
}
println("answer:")
printnum64(get o)
exit(0)
}
void main() {
_start
}