From fe59bfd0410144784debd6de56eec8877dca6e4b Mon Sep 17 00:00:00 2001 From: kirreen Date: Thu, 12 Dec 2024 15:41:01 +0100 Subject: [PATCH] solved 12a --- .gitignore | 2 + 11/' | 92 -------- 11/a.out | Bin 19576 -> 20064 bytes 11/main.c | 2 +- 11/mainB.c | 117 ++++++++++ 12/input | 140 +++++++++++ 12/inputDemo | 10 + 12/inputDemo2 | 5 + 12/main.c | 176 ++++++++++++++ 12/test | 593 +++++++++++++++++++++++++++++++++++++++++++++++ 12/test2 | 385 ++++++++++++++++++++++++++++++ 5/a.out | Bin 20480 -> 16112 bytes 5/mainB.c | 156 +++++++++++++ 5/mainBShuffle.c | 156 +++++++++++++ 14 files changed, 1741 insertions(+), 93 deletions(-) create mode 100644 .gitignore delete mode 100644 11/' create mode 100644 11/mainB.c create mode 100644 12/input create mode 100644 12/inputDemo create mode 100644 12/inputDemo2 create mode 100644 12/main.c create mode 100644 12/test create mode 100644 12/test2 create mode 100644 5/mainB.c create mode 100644 5/mainBShuffle.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..318dd74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.out +*~ diff --git a/11/' b/11/' deleted file mode 100644 index 0f9d26a..0000000 --- a/11/' +++ /dev/null @@ -1,92 +0,0 @@ -#include -#include -#include -#include - -struct list { - int num; - struct list *next; -}; - -bool even_digits(int x) -{ - int i = 0; - while (x /= 10) - i++; - return i % 2; -} - -void split_stone(struct list *stones) { - int digits = 0; - int x = stones->num; - while (x /= 10) - digits++; - - int a = stones->num; - int b = 0; - for (int i = 0; i < digits; i++) { - b = b * 10 + a % 10; - a /= 10; - } - - struct list *tmp = stones->next; - stones->next = malloc(sizeof(struct list)); - stones->num = a; - stones->next->num = b; - stones->next->next = tmp; -} - -int main () -{ - // figure out data dimensions - FILE *input = fopen("./inputDemo", "r"); - unsigned int tmp; - unsigned int array[10]; - for (int i = 0; i < 10; i++) - array[i] = -1; - for (int i = 0; fscanf(input, "%d", &tmp) == 1; i++) { - array[i] = tmp; - } - fclose(input); - - // put stones into list - struct list *stones = malloc(sizeof(struct list)); - stones->num = array[0]; - stones->next = NULL; - struct list *current = stones; - for (int i = 1; array[i] != -1; i++) { - while (current->next != NULL) - current = current->next; - current->next = malloc(sizeof(struct list)); - current->next->next = NULL; - current->next->num = array[i]; - } - - // loop through list - for (int i = 0; i < 6; i++) { - current = stones; - while (current) { - // 0 => make 1 - if (current->num == 0) - current->num = 1; - // even number of digits => split, fix list shit - else if (even_digits(current->num)) - split_stone(current); - // (point first split onto second split, second split onto old ptr) - // else => mult 2024 - else - current->num *= 2024; - - current = current->next; - } - } - current = stones; - int sum = 0; - printf("Stones: "); - while (current) { - printf("%d ", current->num); - sum++; - current = current->next; - } - printf("%d\n", sum); -} diff --git a/11/a.out b/11/a.out index c18907fd0fc9f7998da8ec21a5710268e8ab1025..73be5a22d2a0a046587bd555bfeb976b164b198e 100755 GIT binary patch delta 5477 zcmZWt3vg6L7VUmBJ>Pt0GLvK`37H9yh^YBNNJ4-Np9gOMHOr?A3ML^WWS0CSGY~9r za09GUBUK5#x}f~FN?k2cvA|ulSc#$rN@Rg$0bRB#rLi^`OHpBo-`RWny$Lbfsn@sf zz2|=VcE9e-8{SR(_tI`x%3&K3&8HGlEB8!(fv;8U{JLW78T49O463HZz*A_xc{5en z&D>85%v&Xu+sz-Rw^9ndDtDXm3@MwxDD^vC6W^~0Ts}MbsZDJUohe=R&dSYl`!yOdS~(=a=wZY++bODA5xM{un$| zjIbv{-UL)D6mbRui3CvVHCejg^<=ZgAMJS>N~R+_G(MCOFca|913b2KGgWF*2{~wo z0bg!#xT|mkP4Njr;s}L5ZgB8JhJ?gZm8u5UM8{t-q`SfONV_sho524KT1fPE^Ql84 z5XuvcHPpykjOo1Dn2=jIN@r1FqAwdIw;t&+T1~rb-Q!}p&lC{Sgh^c68iSU*3wd;W zt)1_*Wmny=CnT0SluyWw#{6W@HsMU!IWqt_WhYyWqsVyR8g57t9UAFw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rfYwQTL<#FwD*XZoTIv5=hz~}P)oA$fbGcWG zGXA}{0;3eJ*R_iX`(d1>Ee(JzV_6n(P3T%(qWy`XfEHiIAp!1aqvC)`r>((uu-*y zkIcozH$Oe~PtYD-r9^2vA5=mvy(l_ez-evBsxKgX&6d?JqBHoe+K@}%WjZbAgCN}) zP($f-gwsX-lYu1xN)=vJ7qaLJJ&SLvD|YGS3C~i^%zQB7=OcBw6mqSrq>uB`rIpsB zn)VFi-Am_Ln&zqCAx`fB@X}mMVTmf4$?39UO9O6fXzjcTxcBip71|H^F5n*0&kP?# TE-X~!W$;vNaaF6_di47r(WCUg diff --git a/11/main.c b/11/main.c index dce1f15..afc4287 100644 --- a/11/main.c +++ b/11/main.c @@ -69,7 +69,7 @@ int main () } // loop through list - for (int i = 0; i < 75; i++) { + for (int i = 0; i < 25; i++) { current = stones; bool last = false; while (current) { diff --git a/11/mainB.c b/11/mainB.c new file mode 100644 index 0000000..d4d7c9d --- /dev/null +++ b/11/mainB.c @@ -0,0 +1,117 @@ +#include +#include +#include +#include + +struct list { + unsigned long int num; + unsigned long int solution; + int i; + struct list *next; +}; +struct pair { + unsigned long int a; + unsigned long int b; +}; + +struct list *solutions; +struct list *current; + +bool even_digits(unsigned long int x) +{ + int i = 0; + while (x /= 10) + i++; + return i % 2; +} +// power! x to the y! +int pow(int x, int y) +{ + int ans = 1; + for (int i = 0; i < y; i++) ans *= x; + return ans; +} +void split_stone(unsigned long int stone, struct pair *pair) { + int digits = 1; + unsigned long int x = stone; + while (x /= 10) + digits++; + + unsigned long int a = stone; + int b = 0; + for (int i = 0; i < digits / 2; i++) { + b += (a % 10) * pow(10, i); + a /= 10; + } + + pair->a = a; + pair->b = b; +} + +unsigned long int solve_stone(unsigned long int stone, int i) +{ + i--; + if (i == 0) + return 1; + // check / add to solved list + current = solutions; + while (current->next && !(current->num == stone && current->i == i)) { + current = current->next; + } + if (current->num == stone && current->i == i) { + printf("ay found repetition\n"); + return current->solution; + } + + int sum = 0; + // if not solved, split / multiply / set to 1 and send to solve + // 0 => make 1 + if (stone == 0) + sum = solve_stone(1, i); + // even number of digits => split, fix list shit + else if (even_digits(stone)) { + struct pair *pair = malloc(sizeof(struct pair)); + split_stone(stone, pair); + sum += solve_stone(pair->a, i); + sum += solve_stone(pair->b, i); + free(pair); + } + // (point first split onto second split, second split onto old ptr) + // else => mult 2024 + else + sum = solve_stone(stone * 2024, i); + + while (current->next && current->num != -1) {} + current->next = malloc(sizeof(struct list)); + current = current->next; + current->num = stone; + current->i = i; + current->solution = sum; + + return sum; +} + +int main () +{ + // figure out data dimensions + FILE *input = fopen("./input", "r"); + unsigned int tmp; + unsigned int array[10]; + for (int i = 0; i < 10; i++) + array[i] = -1; + for (int i = 0; fscanf(input, "%d", &tmp) == 1; i++) { + array[i] = tmp; + } + fclose(input); + + solutions = malloc(sizeof(struct list)); + solutions->num = -1; + solutions->next = NULL; + + unsigned long int sum = 0; + for (int i = 0; array[i] != -1; i++) { + sum += solve_stone(array[i], 6); + } + + printf("total: %d\n", sum); +} diff --git a/12/input b/12/input new file mode 100644 index 0000000..7b75ca1 --- /dev/null +++ b/12/input @@ -0,0 +1,140 @@ +LLLLLLLLFFFFFFFFFFFFFFIIIIIIIIVVVZZZZZZEEEEEEEEEEEENNKAAKKRRRRRRRRPPPPPPPUIIIIIIIIIIIILLLLLLLLLLLLLUUUUUUUUOOOOOOOOOOOOOOOOSSSSSSDDDDDDDDDDD +LLLLLLLLLLLFFFFFFFFFFFFIIIIIVVVVVVZZEEEEEEEEEEEEEEENKKKKKKKRRRRRRPPPPPPPPIIIIIIIIIIIIZLLLLLLLLLLLLUUUUUUUUUUOOOOOOOOOOOOOOOUSSSSSSSDDDDDDDDD +LLLLLLFLLFFFFFFFFFFFFIIIIIIIIIVVVZZZZEEEEEEEEEEEEEENKKKKKKKRRRRRRPPPPPPPPPPPPIIIIIILZZLLLLLLLLLLLLUUUUUUUUUUOOOOOOOOOOOOOOOSSSSSSSLRRDDDDDDD +LLLLL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FFFFFFFEEEEEUEEEEEEEEEEEEEEUUUUUUUUU +NNRRRGGGWWPCCCCCCHCPPPPPPPPPTTTTHHHHHHGGGGGGGGPPPPPPPPPPPPPPDKKKKKKKKKKKKKKKLLLLQQQQQQQQQQQQQQQUUUUUFFFFFFFFFFFFEEEEEEEEEEEEEEEEEEEEUUUUUUUU +RRRRRRGWWWPCCPPPCCPPPPPPPAPPTTHHHHHHHGGGGGGGGGGGPPGGGPPPPPPSKKKKKKKKKKKKKKKWWLBLLQQQQQQQQQQQQQQUUUUUFFFFFFFFFFFFEEEEEEEEEEEEEEEEEEEUUUUUUUUU +RRRRRRPPPPPPPPPPPPPPPPPPPAPKPPFFHHXHHHGGGGGGGGGGPPGGGPPPPPQKKKKKKKKKKKKKKKKKQQQQQQQQQQQQQQQQQQQUUUUUFFFFFFFFFFFEEEEEEEEEEEEEEEEMEEUUUUUUUUUU +RRRRRPPPPPPPPPPPPPPPPPPPPPPPPFFFFHHHHGGGGGGGGGGGGGGGGPPQQQQQKKKNNNNKKKKKKKKQQQQQQQQQQQQQQQQQQQQUUUUFFFFFFFFFIFFEEEEEEEEEEEEEEEEEEEEUUUUUUUUU +RRRRRPPPPPPPPPPPPPPPPPPPPPPFFFFFFHGGGGGGGGGGGGGGGGGGGGPQQQQQQQNNNNNKKKKKKZKCCQQQQQQQQQQQQQQQQQQQUUUUUFFFFFFFFFFEEEEEEEEEEEEEEMEEEUUUUUUUUUUU diff --git a/12/inputDemo b/12/inputDemo new file mode 100644 index 0000000..85b768f --- /dev/null +++ b/12/inputDemo @@ -0,0 +1,10 @@ +RRRRIICCFF +RRRRIICCCF +VVRRRCCFFF +VVRCCCJFFF +VVVVCJJCFE +VVIVCCJJEE +VVIIICJJEE +MIIIIIJJEE +MIIISIJEEE +MMMISSJEEE diff --git a/12/inputDemo2 b/12/inputDemo2 new file mode 100644 index 0000000..50a7304 --- /dev/null +++ b/12/inputDemo2 @@ -0,0 +1,5 @@ +OOOOO +OXOXO +OOOOO +OXOXO +OOOOO diff --git a/12/main.c b/12/main.c new file mode 100644 index 0000000..95ab593 --- /dev/null +++ b/12/main.c @@ -0,0 +1,176 @@ +#include +#include +#include +#include + +struct list { + char type; + struct square *tiles; + unsigned int area; + unsigned int perimeter; + struct list *next; +}; +struct square { + int x; + int y; + struct square *next; +}; + +bool tile_in_list(int x, int y, struct list *plot) +{ + if (!plot) + return 0; + struct square *current = plot->tiles; + while (current) { + if (current->x == x && current->y == y) { + return 1; + } + current = current->next; + } + return 0; +} + +bool plot_exists (int x, int y, struct list *plots) +{ + struct list *current = plots; + while (current) { + if (tile_in_list(x, y, current)) + return 1; + current = current->next; + } + return 0; +} + +void add_tile(int x, int y, struct list *plot) +{ + if (plot->tiles == NULL) { + plot->tiles = malloc(sizeof(struct square)); + plot->tiles->x = x; + plot->tiles->y = y; + plot->tiles->next = NULL; + return; + } + + struct square *tiles = plot->tiles; + while (tiles->next) + tiles = tiles->next; + + tiles->next = malloc(sizeof(struct square)); + tiles->next->x = x; + tiles->next->y = y; + tiles->next->next = NULL; +} + +struct list *check_plot(int x, int y, int width, int height, char **map, struct list *plot, bool daddy) +{ + int dir[4][2] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; + int perimeter = 0; + // daddy simply states if this function was called from the outside, + // since the main loop will never send grids in the same plot + // should actually be solved by handling the list outside this func + + struct list *prevPlot = plot; + while (plot && plot->type != map[x][y]) { + prevPlot = plot; + plot = plot->next; + } + // create list of every tile in this plot + // init list + if (plot == NULL || daddy) { + plot = malloc(sizeof(struct list)); + plot->type = map[x][y]; + plot->area = 0; + plot->perimeter = 0; + plot->tiles = NULL; + plot->next = NULL; + if (prevPlot) + prevPlot->next = plot; + } + // check if current tile is in this list + // if yes, return + if (tile_in_list(x, y, plot)) + return NULL; + // else, add, then check all surrounding tiles with this function + add_tile(x, y, plot); + plot->area++; + + // look in every direction for same type, recurse it + for (int i = 0; i < 4; i++) { + if (x + dir[i][0] >= 0 && + x + dir[i][0] < width && + y + dir[i][1] >= 0 && + y + dir[i][1] < height) { + if (map[x + dir[i][0]][y + dir[i][1]] == map[x][y]) { + check_plot(x + dir[i][0], y + dir[i][1], + width, height, map, plot, false); + } else { + plot->perimeter++; + } + } else + plot->perimeter++; + } + return plot; +} + +int main () +{ + // figure out data dimensions + FILE *input = fopen("./input", "r"); + int width = 0; + int height = 1; + while (fgetc(input) != '\n') width++; + for (char c = fgetc(input); c != EOF; c = fgetc(input)) { + if (c == '\n') + height++; + } + rewind(input); + printf("Dimensions: %d x %d\n", width, height); + + // make 2d array + char **map = malloc(width * sizeof(char*)); + map[0] = malloc(width * height); + for (int i = 1; i < width; i++) { + map[i] = map[0] + i * height; + } + + // put the data in the array + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + map[j][i] = fgetc(input); + } + fgetc(input); + } + fclose(input); + + int scoreSum = 0; + // find plots not in list, check their score + struct list *plots = NULL; + struct list *current = NULL; + char prevType = 0; + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + // nasty if. prev type, skip. first, init head. + // else, if tile is already in plot-list, skip + // else, add a new plot to the list from current tile + if (map[j][i] == prevType) + continue; + if (i == 0 && j == 0) { + plots = check_plot(j,i, width, height, map, plots, true); + current = plots; + } + else if (plot_exists(j, i, plots)) + continue; + else + current = check_plot(j,i, width, height, map, current, true); + } + } + current = plots; + int sum = 0; + while (current) { + printf("plot %c is area %d and perimeter %d\n", current->type, current->area, current->perimeter); + sum += current->area * current->perimeter; + current = current->next; + } + + printf("total score: %d\n", sum); +} diff --git a/12/test b/12/test new file mode 100644 index 0000000..6e31417 --- /dev/null +++ b/12/test @@ -0,0 +1,593 @@ +plot L is area 116 and perimeter 94 +plot F is area 93 and perimeter 70 +plot I is area 54 and perimeter 52 +plot V is area 83 and perimeter 60 +plot Z is area 18 and perimeter 28 +plot E is area 78 and perimeter 62 +plot N is area 4 and perimeter 10 +plot K is area 82 and perimeter 60 +plot A is area 2 and perimeter 6 +plot R is area 37 and perimeter 34 +plot P is area 148 and perimeter 82 +plot U is area 1 and perimeter 4 +plot I is area 45 and perimeter 44 +plot L is area 85 and perimeter 60 +plot U is area 108 and perimeter 64 +plot O is area 106 and perimeter 62 +plot S is area 35 and perimeter 34 +plot D is area 71 and perimeter 52 +plot Z is area 3 and perimeter 8 +plot U is area 1 and perimeter 4 +plot L is area 1 and perimeter 4 +plot R is area 178 and perimeter 112 +plot X is area 1 and perimeter 4 +plot W is area 1 and perimeter 4 +plot H is area 77 and perimeter 64 +plot U is area 60 and perimeter 46 +plot Y is area 1 and perimeter 4 +plot O is area 18 and perimeter 26 +plot K is area 76 and perimeter 64 +plot I is area 1 and perimeter 4 +plot U is area 34 and perimeter 44 +plot S is area 88 and perimeter 82 +plot W is area 2 and perimeter 6 +plot X is area 112 and perimeter 84 +plot M is area 1 and perimeter 4 +plot Z is area 76 and perimeter 78 +plot X is area 1 and perimeter 4 +plot H is area 8 and perimeter 16 +plot S is area 1 and perimeter 4 +plot K is area 67 and perimeter 70 +plot X is area 6 and perimeter 14 +plot I is area 25 and perimeter 40 +plot W is area 105 and perimeter 64 +plot I is area 1 and perimeter 4 +plot M is area 6 and perimeter 10 +plot A is area 2 and perimeter 8 +plot S is area 10 and perimeter 14 +plot N is area 116 and perimeter 84 +plot Q is area 50 and perimeter 46 +plot E is area 14 and perimeter 20 +plot G is area 3 and perimeter 8 +plot D is area 18 and perimeter 22 +plot S is area 19 and perimeter 28 +plot C is area 30 and perimeter 36 +plot Y is area 8 and perimeter 14 +plot U is area 2 and perimeter 6 +plot N is area 1 and perimeter 4 +plot P is area 1 and perimeter 4 +plot D is area 1 and perimeter 4 +plot M is area 8 and perimeter 16 +plot I is area 1 and perimeter 4 +plot Q is area 2 and perimeter 6 +plot E is area 46 and perimeter 58 +plot R is area 1 and perimeter 4 +plot K is area 1 and perimeter 4 +plot N is area 39 and perimeter 52 +plot C is area 14 and perimeter 18 +plot X is area 3 and perimeter 8 +plot A is area 143 and perimeter 150 +plot D is area 28 and perimeter 34 +plot C is area 1 and perimeter 4 +plot S is area 44 and perimeter 38 +plot X is area 73 and perimeter 68 +plot J is area 3 and perimeter 10 +plot U is area 1 and perimeter 4 +plot X is area 1 and perimeter 4 +plot H is area 97 and perimeter 90 +plot N is area 2 and perimeter 6 +plot G is area 81 and perimeter 64 +plot F is area 4 and perimeter 8 +plot H is area 122 and perimeter 74 +plot W is area 58 and perimeter 56 +plot E is area 115 and perimeter 96 +plot R is area 2 and perimeter 6 +plot F is area 2 and perimeter 6 +plot W is area 83 and perimeter 66 +plot G is area 1 and perimeter 4 +plot U is area 138 and perimeter 80 +plot B is area 26 and perimeter 28 +plot T is area 130 and perimeter 88 +plot M is area 1 and perimeter 4 +plot J is area 1 and perimeter 4 +plot I is area 1 and perimeter 4 +plot U is area 75 and perimeter 76 +plot C is area 4 and perimeter 8 +plot P is area 1 and perimeter 4 +plot Y is area 1 and perimeter 4 +plot J is area 1 and perimeter 4 +plot H is area 1 and perimeter 4 +plot E is area 78 and perimeter 78 +plot P is area 1 and perimeter 4 +plot V is area 1 and perimeter 4 +plot K is area 1 and perimeter 4 +plot P is area 77 and perimeter 64 +plot F is area 1 and perimeter 4 +plot S is area 86 and perimeter 72 +plot K is area 120 and perimeter 56 +plot H is area 1 and perimeter 4 +plot O is area 52 and perimeter 50 +plot I is area 18 and perimeter 24 +plot J is area 71 and perimeter 36 +plot M is area 1 and perimeter 4 +plot W is area 1 and perimeter 4 +plot Z is area 3 and perimeter 8 +plot U is area 1 and perimeter 4 +plot N is area 107 and perimeter 80 +plot F is area 1 and perimeter 4 +plot P is area 100 and perimeter 74 +plot V is area 1 and perimeter 4 +plot G is area 26 and perimeter 34 +plot Y is area 53 and perimeter 44 +plot W is area 55 and perimeter 48 +plot J is area 7 and perimeter 12 +plot C is area 2 and perimeter 6 +plot Z is area 2 and perimeter 6 +plot C is area 1 and perimeter 4 +plot M is area 1 and perimeter 4 +plot P is area 1 and perimeter 4 +plot V is area 92 and perimeter 110 +plot P is area 25 and perimeter 30 +plot Q is area 2 and perimeter 6 +plot S is area 17 and perimeter 26 +plot J is area 1 and perimeter 4 +plot T is area 130 and perimeter 88 +plot F is area 5 and perimeter 12 +plot Y is area 25 and perimeter 36 +plot G is area 85 and perimeter 56 +plot Z is area 13 and perimeter 22 +plot G is area 3 and perimeter 8 +plot N is area 3 and perimeter 8 +plot A is area 2 and perimeter 6 +plot N is area 54 and perimeter 48 +plot W is area 70 and perimeter 52 +plot A is area 113 and perimeter 90 +plot O is area 91 and perimeter 66 +plot V is area 2 and perimeter 8 +plot O is area 1 and perimeter 4 +plot B is area 1 and perimeter 4 +plot U is area 104 and perimeter 70 +plot H is area 1 and perimeter 4 +plot A is area 1 and perimeter 4 +plot S is area 6 and perimeter 14 +plot J is area 1 and perimeter 4 +plot D is area 1 and perimeter 4 +plot A is area 3 and perimeter 8 +plot G is area 1 and perimeter 4 +plot X is area 117 and perimeter 62 +plot Q is area 2 and perimeter 6 +plot R is area 1 and perimeter 4 +plot M is area 1 and perimeter 4 +plot B is area 15 and perimeter 24 +plot L is area 58 and perimeter 48 +plot F is area 1 and perimeter 4 +plot R is area 4 and perimeter 8 +plot K is area 121 and perimeter 82 +plot M is area 1 and perimeter 4 +plot L is area 99 and perimeter 58 +plot Z is area 2 and perimeter 6 +plot B is area 6 and perimeter 12 +plot X is area 6 and perimeter 14 +plot P is area 40 and perimeter 34 +plot F is area 1 and perimeter 4 +plot H is area 4 and perimeter 10 +plot V is area 5 and perimeter 10 +plot J is area 1 and perimeter 4 +plot E is area 52 and perimeter 52 +plot T is area 69 and perimeter 60 +plot P is area 173 and perimeter 60 +plot A is area 1 and perimeter 4 +plot R is area 10 and perimeter 18 +plot P is area 5 and perimeter 10 +plot L is area 69 and perimeter 62 +plot Q is area 1 and perimeter 4 +plot U is area 1 and perimeter 4 +plot A is area 1 and perimeter 4 +plot L is area 2 and perimeter 6 +plot U is area 1 and perimeter 4 +plot B is area 2 and perimeter 6 +plot O is area 5 and perimeter 10 +plot F is area 22 and perimeter 34 +plot K is area 26 and perimeter 32 +plot V is area 2 and perimeter 6 +plot M is area 23 and perimeter 24 +plot T is area 1 and perimeter 4 +plot F is area 26 and perimeter 34 +plot Z is area 7 and perimeter 12 +plot D is area 85 and perimeter 60 +plot G is area 2 and perimeter 6 +plot B is area 42 and perimeter 40 +plot E is area 1 and perimeter 4 +plot P is area 136 and perimeter 64 +plot F is area 85 and perimeter 72 +plot I is area 55 and perimeter 46 +plot Q is area 79 and perimeter 72 +plot S is area 1 and perimeter 4 +plot D is area 101 and perimeter 56 +plot Z is area 3 and perimeter 8 +plot K is area 144 and perimeter 110 +plot Z is area 9 and perimeter 18 +plot U is area 116 and perimeter 74 +plot O is area 4 and perimeter 10 +plot I is area 52 and perimeter 46 +plot A is area 252 and perimeter 158 +plot H is area 3 and perimeter 8 +plot M is area 2 and perimeter 6 +plot A is area 24 and perimeter 28 +plot N is area 1 and perimeter 4 +plot M is area 10 and perimeter 18 +plot Y is area 1 and perimeter 4 +plot N is area 1 and perimeter 4 +plot A is area 1 and perimeter 4 +plot D is area 4 and perimeter 10 +plot B is area 105 and perimeter 68 +plot E is area 1 and perimeter 4 +plot T is area 3 and perimeter 8 +plot A is area 15 and perimeter 24 +plot F is area 7 and perimeter 12 +plot C is area 1 and perimeter 4 +plot L is area 79 and perimeter 56 +plot G is area 68 and perimeter 48 +plot V is area 24 and perimeter 24 +plot E is area 1 and perimeter 4 +plot K is area 1 and perimeter 4 +plot S is area 1 and perimeter 4 +plot B is area 27 and perimeter 32 +plot O is area 45 and perimeter 40 +plot C is area 1 and perimeter 4 +plot U is area 107 and perimeter 84 +plot F is area 12 and perimeter 18 +plot E is area 1 and perimeter 4 +plot T is area 2 and perimeter 6 +plot P is area 1 and perimeter 4 +plot F is area 16 and perimeter 20 +plot X is area 1 and perimeter 4 +plot Y is area 55 and perimeter 42 +plot W is area 11 and perimeter 18 +plot D is area 20 and perimeter 26 +plot W is area 60 and perimeter 54 +plot L is area 34 and perimeter 32 +plot A is area 1 and perimeter 4 +plot F is area 1 and perimeter 4 +plot N is area 50 and perimeter 48 +plot B is area 1 and perimeter 4 +plot R is area 2 and perimeter 6 +plot K is area 82 and perimeter 76 +plot V is area 1 and perimeter 4 +plot H is area 6 and perimeter 14 +plot N is area 35 and perimeter 38 +plot J is area 5 and perimeter 10 +plot R is area 19 and perimeter 22 +plot H is area 1 and perimeter 4 +plot C is area 103 and perimeter 94 +plot V is area 2 and perimeter 6 +plot X is area 10 and perimeter 22 +plot Z is area 47 and perimeter 44 +plot J is area 4 and perimeter 10 +plot Z is area 2 and perimeter 6 +plot J is area 32 and perimeter 32 +plot Q is area 52 and perimeter 50 +plot D is area 31 and perimeter 36 +plot X is area 3 and perimeter 8 +plot I is area 21 and perimeter 30 +plot V is area 142 and perimeter 78 +plot L is area 1 and perimeter 4 +plot F is area 4 and perimeter 8 +plot H is area 2 and perimeter 6 +plot Z is area 56 and perimeter 40 +plot U is area 16 and perimeter 24 +plot I is area 1 and perimeter 4 +plot A is area 2 and perimeter 6 +plot M is area 129 and perimeter 74 +plot R is area 6 and perimeter 12 +plot Z is area 3 and perimeter 8 +plot E is area 6 and perimeter 12 +plot K is area 1 and perimeter 4 +plot S is area 27 and perimeter 30 +plot D is area 2 and perimeter 6 +plot E is area 3 and perimeter 8 +plot U is area 97 and perimeter 72 +plot Q is area 7 and perimeter 12 +plot P is area 2 and perimeter 6 +plot Z is area 119 and perimeter 72 +plot Y is area 41 and perimeter 42 +plot C is area 136 and perimeter 76 +plot K is area 71 and perimeter 60 +plot Q is area 3 and perimeter 8 +plot N is area 6 and perimeter 10 +plot D is area 50 and perimeter 48 +plot S is area 1 and perimeter 4 +plot B is area 96 and perimeter 64 +plot G is area 2 and perimeter 6 +plot Q is area 26 and perimeter 32 +plot X is area 1 and perimeter 4 +plot W is area 9 and perimeter 18 +plot L is area 1 and perimeter 4 +plot G is area 61 and perimeter 48 +plot B is area 2 and perimeter 6 +plot E is area 1 and perimeter 4 +plot Z is area 57 and perimeter 56 +plot P is area 118 and perimeter 76 +plot T is area 2 and perimeter 6 +plot A is area 11 and perimeter 24 +plot I is area 16 and perimeter 28 +plot M is area 11 and perimeter 22 +plot A is area 126 and perimeter 70 +plot P is area 124 and perimeter 74 +plot A is area 1 and perimeter 4 +plot T is area 4 and perimeter 10 +plot F is area 79 and perimeter 66 +plot A is area 1 and perimeter 4 +plot W is area 17 and perimeter 26 +plot Y is area 1 and perimeter 4 +plot B is area 1 and perimeter 4 +plot H is area 1 and perimeter 4 +plot U is area 10 and perimeter 18 +plot Y is area 25 and perimeter 36 +plot P is area 49 and perimeter 48 +plot R is area 3 and perimeter 8 +plot T is area 19 and perimeter 24 +plot H is area 33 and perimeter 38 +plot T is area 1 and perimeter 4 +plot H is area 21 and perimeter 32 +plot D is area 88 and perimeter 68 +plot E is area 1 and perimeter 4 +plot X is area 170 and perimeter 100 +plot N is area 6 and perimeter 12 +plot U is area 90 and perimeter 84 +plot S is area 1 and perimeter 4 +plot B is area 142 and perimeter 152 +plot X is area 105 and perimeter 86 +plot S is area 8 and perimeter 14 +plot B is area 62 and perimeter 54 +plot S is area 1 and perimeter 4 +plot I is area 1 and perimeter 4 +plot G is area 6 and perimeter 12 +plot M is area 177 and perimeter 88 +plot J is area 153 and perimeter 86 +plot N is area 1 and perimeter 4 +plot U is area 1 and perimeter 4 +plot X is area 1 and perimeter 4 +plot O is area 18 and perimeter 32 +plot D is area 71 and perimeter 60 +plot R is area 1 and perimeter 4 +plot A is area 1 and perimeter 4 +plot O is area 14 and perimeter 26 +plot G is area 282 and perimeter 132 +plot I is area 1 and perimeter 4 +plot W is area 38 and perimeter 36 +plot R is area 44 and perimeter 56 +plot P is area 1 and perimeter 4 +plot O is area 2 and perimeter 6 +plot H is area 77 and perimeter 64 +plot J is area 94 and perimeter 54 +plot E is area 1 and perimeter 4 +plot Q is area 1 and perimeter 4 +plot U is area 4 and perimeter 10 +plot K is area 108 and perimeter 60 +plot W is area 3 and perimeter 8 +plot K is area 20 and perimeter 28 +plot W is area 31 and perimeter 34 +plot I is area 179 and perimeter 122 +plot G is area 1 and perimeter 4 +plot B is area 1 and perimeter 4 +plot S is area 1 and perimeter 4 +plot J is area 1 and perimeter 4 +plot U is area 1 and perimeter 4 +plot H is area 41 and perimeter 44 +plot J is area 2 and perimeter 6 +plot V is area 1 and perimeter 4 +plot Q is area 127 and perimeter 76 +plot T is area 109 and perimeter 58 +plot A is area 1 and perimeter 4 +plot U is area 12 and perimeter 22 +plot I is area 1 and perimeter 4 +plot Q is area 137 and perimeter 70 +plot G is area 101 and perimeter 80 +plot T is area 1 and perimeter 4 +plot U is area 1 and perimeter 4 +plot I is area 1 and perimeter 4 +plot K is area 12 and perimeter 14 +plot B is area 1 and perimeter 4 +plot P is area 172 and perimeter 144 +plot H is area 2 and perimeter 6 +plot Q is area 1 and perimeter 4 +plot E is area 2 and perimeter 6 +plot V is area 238 and perimeter 116 +plot R is area 4 and perimeter 8 +plot E is area 17 and perimeter 24 +plot J is area 1 and perimeter 4 +plot O is area 29 and perimeter 26 +plot J is area 84 and perimeter 64 +plot Q is area 2 and perimeter 6 +plot H is area 2 and perimeter 6 +plot E is area 16 and perimeter 22 +plot S is area 105 and perimeter 80 +plot O is area 22 and perimeter 28 +plot A is area 5 and perimeter 12 +plot L is area 1 and perimeter 4 +plot V is area 1 and perimeter 4 +plot K is area 128 and perimeter 70 +plot F is area 42 and perimeter 38 +plot Q is area 1 and perimeter 4 +plot T is area 1 and perimeter 4 +plot S is area 2 and perimeter 6 +plot B is area 130 and perimeter 82 +plot L is area 1 and perimeter 4 +plot U is area 107 and perimeter 82 +plot T is area 141 and perimeter 78 +plot D is area 3 and perimeter 8 +plot J is area 2 and perimeter 6 +plot Q is area 43 and perimeter 48 +plot J is area 306 and perimeter 102 +plot Z is area 1 and perimeter 4 +plot U is area 1 and perimeter 4 +plot S is area 59 and perimeter 52 +plot O is area 36 and perimeter 36 +plot R is area 2 and perimeter 8 +plot I is area 9 and perimeter 18 +plot O is area 2 and perimeter 6 +plot W is area 4 and perimeter 8 +plot J is area 3 and perimeter 8 +plot U is area 1 and perimeter 4 +plot M is area 1 and perimeter 4 +plot Y is area 5 and perimeter 12 +plot S is area 111 and perimeter 64 +plot U is area 62 and perimeter 46 +plot O is area 1 and perimeter 4 +plot R is area 1 and perimeter 4 +plot X is area 33 and perimeter 36 +plot D is area 57 and perimeter 46 +plot U is area 1 and perimeter 4 +plot X is area 1 and perimeter 4 +plot H is area 2 and perimeter 6 +plot Q is area 3 and perimeter 8 +plot Y is area 112 and perimeter 72 +plot R is area 3 and perimeter 8 +plot O is area 2 and perimeter 6 +plot N is area 1 and perimeter 4 +plot S is area 1 and perimeter 4 +plot G is area 115 and perimeter 66 +plot P is area 2 and perimeter 6 +plot F is area 12 and perimeter 18 +plot W is area 1 and perimeter 4 +plot Q is area 5 and perimeter 12 +plot T is area 5 and perimeter 12 +plot F is area 16 and perimeter 22 +plot G is area 1 and perimeter 4 +plot K is area 4 and perimeter 8 +plot U is area 15 and perimeter 24 +plot C is area 6 and perimeter 14 +plot L is area 1 and perimeter 4 +plot G is area 1 and perimeter 4 +plot D is area 13 and perimeter 20 +plot A is area 211 and perimeter 142 +plot V is area 41 and perimeter 38 +plot N is area 110 and perimeter 64 +plot P is area 15 and perimeter 24 +plot R is area 102 and perimeter 72 +plot D is area 5 and perimeter 12 +plot O is area 2 and perimeter 6 +plot B is area 56 and perimeter 54 +plot Z is area 17 and perimeter 24 +plot P is area 5 and perimeter 12 +plot Z is area 1 and perimeter 4 +plot C is area 106 and perimeter 110 +plot E is area 1 and perimeter 4 +plot L is area 81 and perimeter 60 +plot M is area 1 and perimeter 4 +plot L is area 3 and perimeter 8 +plot W is area 25 and perimeter 32 +plot Y is area 1 and perimeter 4 +plot P is area 7 and perimeter 16 +plot W is area 1 and perimeter 4 +plot F is area 1 and perimeter 4 +plot U is area 3 and perimeter 8 +plot R is area 1 and perimeter 4 +plot E is area 3 and perimeter 8 +plot P is area 3 and perimeter 8 +plot W is area 1 and perimeter 4 +plot Q is area 76 and perimeter 62 +plot E is area 123 and perimeter 88 +plot R is area 26 and perimeter 28 +plot C is area 1 and perimeter 4 +plot T is area 45 and perimeter 48 +plot W is area 3 and perimeter 8 +plot M is area 5 and perimeter 12 +plot O is area 2 and perimeter 6 +plot T is area 1 and perimeter 4 +plot D is area 75 and perimeter 62 +plot H is area 1 and perimeter 4 +plot I is area 1 and perimeter 4 +plot F is area 1 and perimeter 4 +plot W is area 107 and perimeter 78 +plot M is area 16 and perimeter 30 +plot Q is area 1 and perimeter 4 +plot Y is area 18 and perimeter 28 +plot L is area 232 and perimeter 134 +plot G is area 141 and perimeter 70 +plot W is area 49 and perimeter 58 +plot V is area 1 and perimeter 4 +plot O is area 60 and perimeter 42 +plot X is area 66 and perimeter 54 +plot R is area 12 and perimeter 16 +plot I is area 1 and perimeter 4 +plot F is area 2 and perimeter 8 +plot P is area 1 and perimeter 4 +plot E is area 21 and perimeter 26 +plot M is area 4 and perimeter 12 +plot W is area 1 and perimeter 4 +plot N is area 30 and perimeter 36 +plot V is area 1 and perimeter 4 +plot J is area 11 and perimeter 20 +plot V is area 77 and perimeter 72 +plot O is area 42 and perimeter 52 +plot B is area 1 and perimeter 4 +plot G is area 1 and perimeter 4 +plot C is area 126 and perimeter 100 +plot L is area 13 and perimeter 20 +plot U is area 156 and perimeter 84 +plot W is area 8 and perimeter 18 +plot L is area 1 and perimeter 4 +plot U is area 92 and perimeter 58 +plot P is area 84 and perimeter 72 +plot C is area 1 and perimeter 4 +plot X is area 42 and perimeter 52 +plot P is area 146 and perimeter 84 +plot U is area 1 and perimeter 4 +plot Y is area 40 and perimeter 50 +plot I is area 2 and perimeter 6 +plot A is area 1 and perimeter 4 +plot D is area 1 and perimeter 4 +plot Q is area 1 and perimeter 4 +plot F is area 116 and perimeter 76 +plot U is area 61 and perimeter 54 +plot S is area 7 and perimeter 16 +plot O is area 1 and perimeter 4 +plot I is area 59 and perimeter 50 +plot G is area 116 and perimeter 94 +plot M is area 1 and perimeter 4 +plot Q is area 145 and perimeter 80 +plot M is area 2 and perimeter 6 +plot U is area 126 and perimeter 82 +plot T is area 1 and perimeter 4 +plot N is area 20 and perimeter 22 +plot F is area 4 and perimeter 10 +plot R is area 3 and perimeter 8 +plot E is area 4 and perimeter 10 +plot H is area 57 and perimeter 50 +plot K is area 106 and perimeter 74 +plot Q is area 1 and perimeter 4 +plot S is area 4 and perimeter 10 +plot L is area 2 and perimeter 6 +plot E is area 142 and perimeter 90 +plot W is area 1 and perimeter 4 +plot S is area 2 and perimeter 6 +plot W is area 10 and perimeter 18 +plot M is area 1 and perimeter 4 +plot P is area 106 and perimeter 82 +plot S is area 1 and perimeter 4 +plot R is area 1 and perimeter 4 +plot S is area 2 and perimeter 6 +plot C is area 1 and perimeter 4 +plot R is area 27 and perimeter 26 +plot G is area 10 and perimeter 16 +plot K is area 1 and perimeter 4 +plot G is area 3 and perimeter 8 +plot T is area 8 and perimeter 18 +plot H is area 1 and perimeter 4 +plot D is area 1 and perimeter 4 +plot A is area 2 and perimeter 6 +plot S is area 1 and perimeter 4 +plot W is area 2 and perimeter 6 +plot B is area 1 and perimeter 4 +plot K is area 1 and perimeter 4 +plot F is area 12 and perimeter 18 +plot X is area 1 and perimeter 4 +plot Q is area 13 and perimeter 20 +plot M is area 1 and perimeter 4 +plot N is area 9 and perimeter 14 +plot I is area 1 and perimeter 4 +plot Z is area 1 and perimeter 4 +plot C is area 2 and perimeter 6 +plot M is area 1 and perimeter 4 diff --git a/12/test2 b/12/test2 new file mode 100644 index 0000000..e52b11f --- /dev/null +++ b/12/test2 @@ -0,0 +1,385 @@ + 10 plot A is area 1 and perimeter 4 + 1 plot A is area 11 and perimeter 24 + 1 plot A is area 113 and perimeter 90 + 1 plot A is area 126 and perimeter 70 + 1 plot A is area 143 and perimeter 150 + 1 plot A is area 15 and perimeter 24 + 4 plot A is area 2 and perimeter 6 + 1 plot A is area 2 and perimeter 8 + 1 plot A is area 211 and perimeter 142 + 1 plot A is area 24 and perimeter 28 + 1 plot A is area 252 and perimeter 158 + 1 plot A is area 3 and perimeter 8 + 1 plot A is area 5 and perimeter 12 + 7 plot B is area 1 and perimeter 4 + 1 plot B is area 105 and perimeter 68 + 1 plot B is area 130 and perimeter 82 + 1 plot B is area 142 and perimeter 152 + 1 plot B is area 15 and perimeter 24 + 2 plot B is area 2 and perimeter 6 + 1 plot B is area 26 and perimeter 28 + 1 plot B is area 27 and perimeter 32 + 1 plot B is area 42 and perimeter 40 + 1 plot B is area 56 and perimeter 54 + 1 plot B is area 6 and perimeter 12 + 1 plot B is area 62 and perimeter 54 + 1 plot B is area 96 and perimeter 64 + 7 plot C is area 1 and perimeter 4 + 1 plot C is area 103 and perimeter 94 + 1 plot C is area 106 and perimeter 110 + 1 plot C is area 126 and perimeter 100 + 1 plot C is area 136 and perimeter 76 + 1 plot C is area 14 and perimeter 18 + 2 plot C is area 2 and perimeter 6 + 1 plot C is area 30 and perimeter 36 + 1 plot C is area 4 and perimeter 8 + 1 plot C is area 6 and perimeter 14 + 4 plot D is area 1 and perimeter 4 + 1 plot D is area 101 and perimeter 56 + 1 plot D is area 13 and perimeter 20 + 1 plot D is area 18 and perimeter 22 + 1 plot D is area 2 and perimeter 6 + 1 plot D is area 20 and perimeter 26 + 1 plot D is area 28 and perimeter 34 + 1 plot D is area 3 and perimeter 8 + 1 plot D is area 31 and perimeter 36 + 1 plot D is area 4 and perimeter 10 + 1 plot D is area 5 and perimeter 12 + 1 plot D is area 50 and perimeter 48 + 1 plot D is area 57 and perimeter 46 + 1 plot D is area 71 and perimeter 52 + 1 plot D is area 71 and perimeter 60 + 1 plot D is area 75 and perimeter 62 + 1 plot D is area 85 and perimeter 60 + 1 plot D is area 88 and perimeter 68 + 8 plot E is area 1 and perimeter 4 + 1 plot E is area 115 and perimeter 96 + 1 plot E is area 123 and perimeter 88 + 1 plot E is area 14 and perimeter 20 + 1 plot E is area 142 and perimeter 90 + 1 plot E is area 16 and perimeter 22 + 1 plot E is area 17 and perimeter 24 + 1 plot E is area 2 and perimeter 6 + 1 plot E is area 21 and perimeter 26 + 2 plot E is area 3 and perimeter 8 + 1 plot E is area 4 and perimeter 10 + 1 plot E is area 46 and perimeter 58 + 1 plot E is area 52 and perimeter 52 + 1 plot E is area 6 and perimeter 12 + 1 plot E is area 78 and perimeter 62 + 1 plot E is area 78 and perimeter 78 + 7 plot F is area 1 and perimeter 4 + 1 plot F is area 116 and perimeter 76 + 3 plot F is area 12 and perimeter 18 + 1 plot F is area 16 and perimeter 20 + 1 plot F is area 16 and perimeter 22 + 1 plot F is area 2 and perimeter 6 + 1 plot F is area 2 and perimeter 8 + 1 plot F is area 22 and perimeter 34 + 1 plot F is area 26 and perimeter 34 + 1 plot F is area 4 and perimeter 10 + 2 plot F is area 4 and perimeter 8 + 1 plot F is area 42 and perimeter 38 + 1 plot F is area 5 and perimeter 12 + 1 plot F is area 7 and perimeter 12 + 1 plot F is area 79 and perimeter 66 + 1 plot F is area 85 and perimeter 72 + 1 plot F is area 93 and perimeter 70 + 6 plot G is area 1 and perimeter 4 + 1 plot G is area 10 and perimeter 16 + 1 plot G is area 101 and perimeter 80 + 1 plot G is area 115 and perimeter 66 + 1 plot G is area 116 and perimeter 94 + 1 plot G is area 141 and perimeter 70 + 2 plot G is area 2 and perimeter 6 + 1 plot G is area 26 and perimeter 34 + 1 plot G is area 282 and perimeter 132 + 3 plot G is area 3 and perimeter 8 + 1 plot G is area 6 and perimeter 12 + 1 plot G is area 61 and perimeter 48 + 1 plot G is area 68 and perimeter 48 + 1 plot G is area 81 and perimeter 64 + 1 plot G is area 85 and perimeter 56 + 7 plot H is area 1 and perimeter 4 + 1 plot H is area 122 and perimeter 74 + 4 plot H is area 2 and perimeter 6 + 1 plot H is area 21 and perimeter 32 + 1 plot H is area 3 and perimeter 8 + 1 plot H is area 33 and perimeter 38 + 1 plot H is area 4 and perimeter 10 + 1 plot H is area 41 and perimeter 44 + 1 plot H is area 57 and perimeter 50 + 1 plot H is area 6 and perimeter 14 + 2 plot H is area 77 and perimeter 64 + 1 plot H is area 8 and perimeter 16 + 1 plot H is area 97 and perimeter 90 + 12 plot I is area 1 and perimeter 4 + 1 plot I is area 16 and perimeter 28 + 1 plot I is area 179 and perimeter 122 + 1 plot I is area 18 and perimeter 24 + 1 plot I is area 2 and perimeter 6 + 1 plot I is area 21 and perimeter 30 + 1 plot I is area 25 and perimeter 40 + 1 plot I is area 45 and perimeter 44 + 1 plot I is area 52 and perimeter 46 + 1 plot I is area 54 and perimeter 52 + 1 plot I is area 55 and perimeter 46 + 1 plot I is area 59 and perimeter 50 + 1 plot I is area 9 and perimeter 18 + 7 plot J is area 1 and perimeter 4 + 1 plot J is area 11 and perimeter 20 + 1 plot J is area 153 and perimeter 86 + 2 plot J is area 2 and perimeter 6 + 1 plot J is area 3 and perimeter 10 + 1 plot J is area 3 and perimeter 8 + 1 plot J is area 306 and perimeter 102 + 1 plot J is area 32 and perimeter 32 + 1 plot J is area 4 and perimeter 10 + 1 plot J is area 5 and perimeter 10 + 1 plot J is area 7 and perimeter 12 + 1 plot J is area 71 and perimeter 36 + 1 plot J is area 84 and perimeter 64 + 1 plot J is area 94 and perimeter 54 + 6 plot K is area 1 and perimeter 4 + 1 plot K is area 106 and perimeter 74 + 1 plot K is area 108 and perimeter 60 + 1 plot K is area 12 and perimeter 14 + 1 plot K is area 120 and perimeter 56 + 1 plot K is area 121 and perimeter 82 + 1 plot K is area 128 and perimeter 70 + 1 plot K is area 144 and perimeter 110 + 1 plot K is area 20 and perimeter 28 + 1 plot K is area 26 and perimeter 32 + 1 plot K is area 4 and perimeter 8 + 1 plot K is area 67 and perimeter 70 + 1 plot K is area 71 and perimeter 60 + 1 plot K is area 76 and perimeter 64 + 1 plot K is area 82 and perimeter 60 + 1 plot K is area 82 and perimeter 76 + 7 plot L is area 1 and perimeter 4 + 1 plot L is area 116 and perimeter 94 + 1 plot L is area 13 and perimeter 20 + 2 plot L is area 2 and perimeter 6 + 1 plot L is area 232 and perimeter 134 + 1 plot L is area 3 and perimeter 8 + 1 plot L is area 34 and perimeter 32 + 1 plot L is area 58 and perimeter 48 + 1 plot L is area 69 and perimeter 62 + 1 plot L is area 79 and perimeter 56 + 1 plot L is area 81 and perimeter 60 + 1 plot L is area 85 and perimeter 60 + 1 plot L is area 99 and perimeter 58 + 12 plot M is area 1 and perimeter 4 + 1 plot M is area 10 and perimeter 18 + 1 plot M is area 11 and perimeter 22 + 1 plot M is area 129 and perimeter 74 + 1 plot M is area 16 and perimeter 30 + 1 plot M is area 177 and perimeter 88 + 2 plot M is area 2 and perimeter 6 + 1 plot M is area 23 and perimeter 24 + 1 plot M is area 4 and perimeter 12 + 1 plot M is area 5 and perimeter 12 + 1 plot M is area 6 and perimeter 10 + 1 plot M is area 8 and perimeter 16 + 5 plot N is area 1 and perimeter 4 + 1 plot N is area 107 and perimeter 80 + 1 plot N is area 110 and perimeter 64 + 1 plot N is area 116 and perimeter 84 + 1 plot N is area 2 and perimeter 6 + 1 plot N is area 20 and perimeter 22 + 1 plot N is area 3 and perimeter 8 + 1 plot N is area 30 and perimeter 36 + 1 plot N is area 35 and perimeter 38 + 1 plot N is area 39 and perimeter 52 + 1 plot N is area 4 and perimeter 10 + 1 plot N is area 50 and perimeter 48 + 1 plot N is area 54 and perimeter 48 + 1 plot N is area 6 and perimeter 10 + 1 plot N is area 6 and perimeter 12 + 1 plot N is area 9 and perimeter 14 + 3 plot O is area 1 and perimeter 4 + 1 plot O is area 106 and perimeter 62 + 1 plot O is area 14 and perimeter 26 + 1 plot O is area 18 and perimeter 26 + 1 plot O is area 18 and perimeter 32 + 5 plot O is area 2 and perimeter 6 + 1 plot O is area 22 and perimeter 28 + 1 plot O is area 29 and perimeter 26 + 1 plot O is area 36 and perimeter 36 + 1 plot O is area 4 and perimeter 10 + 1 plot O is area 42 and perimeter 52 + 1 plot O is area 45 and perimeter 40 + 1 plot O is area 5 and perimeter 10 + 1 plot O is area 52 and perimeter 50 + 1 plot O is area 60 and perimeter 42 + 1 plot O is area 91 and perimeter 66 + 7 plot P is area 1 and perimeter 4 + 1 plot P is area 100 and perimeter 74 + 1 plot P is area 106 and perimeter 82 + 1 plot P is area 118 and perimeter 76 + 1 plot P is area 124 and perimeter 74 + 1 plot P is area 136 and perimeter 64 + 1 plot P is area 146 and perimeter 84 + 1 plot P is area 148 and perimeter 82 + 1 plot P is area 15 and perimeter 24 + 1 plot P is area 172 and perimeter 144 + 1 plot P is area 173 and perimeter 60 + 2 plot P is area 2 and perimeter 6 + 1 plot P is area 25 and perimeter 30 + 1 plot P is area 3 and perimeter 8 + 1 plot P is area 40 and perimeter 34 + 1 plot P is area 49 and perimeter 48 + 1 plot P is area 5 and perimeter 10 + 1 plot P is area 5 and perimeter 12 + 1 plot P is area 7 and perimeter 16 + 1 plot P is area 77 and perimeter 64 + 1 plot P is area 84 and perimeter 72 + 7 plot Q is area 1 and perimeter 4 + 1 plot Q is area 127 and perimeter 76 + 1 plot Q is area 13 and perimeter 20 + 1 plot Q is area 137 and perimeter 70 + 1 plot Q is area 145 and perimeter 80 + 4 plot Q is area 2 and perimeter 6 + 1 plot Q is area 26 and perimeter 32 + 2 plot Q is area 3 and perimeter 8 + 1 plot Q is area 43 and perimeter 48 + 1 plot Q is area 5 and perimeter 12 + 1 plot Q is area 50 and perimeter 46 + 1 plot Q is area 52 and perimeter 50 + 1 plot Q is area 7 and perimeter 12 + 1 plot Q is area 76 and perimeter 62 + 1 plot Q is area 79 and perimeter 72 + 6 plot R is area 1 and perimeter 4 + 1 plot R is area 10 and perimeter 18 + 1 plot R is area 102 and perimeter 72 + 1 plot R is area 12 and perimeter 16 + 1 plot R is area 178 and perimeter 112 + 1 plot R is area 19 and perimeter 22 + 2 plot R is area 2 and perimeter 6 + 1 plot R is area 2 and perimeter 8 + 1 plot R is area 26 and perimeter 28 + 1 plot R is area 27 and perimeter 26 + 3 plot R is area 3 and perimeter 8 + 1 plot R is area 37 and perimeter 34 + 2 plot R is area 4 and perimeter 8 + 1 plot R is area 44 and perimeter 56 + 1 plot R is area 6 and perimeter 12 + 10 plot S is area 1 and perimeter 4 + 1 plot S is area 10 and perimeter 14 + 1 plot S is area 105 and perimeter 80 + 1 plot S is area 111 and perimeter 64 + 1 plot S is area 17 and perimeter 26 + 1 plot S is area 19 and perimeter 28 + 3 plot S is area 2 and perimeter 6 + 1 plot S is area 27 and perimeter 30 + 1 plot S is area 35 and perimeter 34 + 1 plot S is area 4 and perimeter 10 + 1 plot S is area 44 and perimeter 38 + 1 plot S is area 59 and perimeter 52 + 1 plot S is area 6 and perimeter 14 + 1 plot S is area 7 and perimeter 16 + 1 plot S is area 8 and perimeter 14 + 1 plot S is area 86 and perimeter 72 + 1 plot S is area 88 and perimeter 82 + 6 plot T is area 1 and perimeter 4 + 1 plot T is area 109 and perimeter 58 + 2 plot T is area 130 and perimeter 88 + 1 plot T is area 141 and perimeter 78 + 1 plot T is area 19 and perimeter 24 + 2 plot T is area 2 and perimeter 6 + 1 plot T is area 3 and perimeter 8 + 1 plot T is area 4 and perimeter 10 + 1 plot T is area 45 and perimeter 48 + 1 plot T is area 5 and perimeter 12 + 1 plot T is area 69 and perimeter 60 + 1 plot T is area 8 and perimeter 18 + 13 plot U is area 1 and perimeter 4 + 1 plot U is area 10 and perimeter 18 + 1 plot U is area 104 and perimeter 70 + 1 plot U is area 107 and perimeter 82 + 1 plot U is area 107 and perimeter 84 + 1 plot U is area 108 and perimeter 64 + 1 plot U is area 116 and perimeter 74 + 1 plot U is area 12 and perimeter 22 + 1 plot U is area 126 and perimeter 82 + 1 plot U is area 138 and perimeter 80 + 1 plot U is area 15 and perimeter 24 + 1 plot U is area 156 and perimeter 84 + 1 plot U is area 16 and perimeter 24 + 1 plot U is area 2 and perimeter 6 + 1 plot U is area 3 and perimeter 8 + 1 plot U is area 34 and perimeter 44 + 1 plot U is area 4 and perimeter 10 + 1 plot U is area 60 and perimeter 46 + 1 plot U is area 61 and perimeter 54 + 1 plot U is area 62 and perimeter 46 + 1 plot U is area 75 and perimeter 76 + 1 plot U is area 90 and perimeter 84 + 1 plot U is area 92 and perimeter 58 + 1 plot U is area 97 and perimeter 72 + 7 plot V is area 1 and perimeter 4 + 1 plot V is area 142 and perimeter 78 + 2 plot V is area 2 and perimeter 6 + 1 plot V is area 2 and perimeter 8 + 1 plot V is area 238 and perimeter 116 + 1 plot V is area 24 and perimeter 24 + 1 plot V is area 41 and perimeter 38 + 1 plot V is area 5 and perimeter 10 + 1 plot V is area 77 and perimeter 72 + 1 plot V is area 83 and perimeter 60 + 1 plot V is area 92 and perimeter 110 + 7 plot W is area 1 and perimeter 4 + 1 plot W is area 10 and perimeter 18 + 1 plot W is area 105 and perimeter 64 + 1 plot W is area 107 and perimeter 78 + 1 plot W is area 11 and perimeter 18 + 1 plot W is area 17 and perimeter 26 + 2 plot W is area 2 and perimeter 6 + 1 plot W is area 25 and perimeter 32 + 2 plot W is area 3 and perimeter 8 + 1 plot W is area 31 and perimeter 34 + 1 plot W is area 38 and perimeter 36 + 1 plot W is area 4 and perimeter 8 + 1 plot W is area 49 and perimeter 58 + 1 plot W is area 55 and perimeter 48 + 1 plot W is area 58 and perimeter 56 + 1 plot W is area 60 and perimeter 54 + 1 plot W is area 70 and perimeter 52 + 1 plot W is area 8 and perimeter 18 + 1 plot W is area 83 and perimeter 66 + 1 plot W is area 9 and perimeter 18 + 8 plot X is area 1 and perimeter 4 + 1 plot X is area 10 and perimeter 22 + 1 plot X is area 105 and perimeter 86 + 1 plot X is area 112 and perimeter 84 + 1 plot X is area 117 and perimeter 62 + 1 plot X is area 170 and perimeter 100 + 2 plot X is area 3 and perimeter 8 + 1 plot X is area 33 and perimeter 36 + 1 plot X is area 42 and perimeter 52 + 2 plot X is area 6 and perimeter 14 + 1 plot X is area 66 and perimeter 54 + 1 plot X is area 73 and perimeter 68 + 5 plot Y is area 1 and perimeter 4 + 1 plot Y is area 112 and perimeter 72 + 1 plot Y is area 18 and perimeter 28 + 2 plot Y is area 25 and perimeter 36 + 1 plot Y is area 40 and perimeter 50 + 1 plot Y is area 41 and perimeter 42 + 1 plot Y is area 5 and perimeter 12 + 1 plot Y is area 53 and perimeter 44 + 1 plot Y is area 55 and perimeter 42 + 1 plot Y is area 8 and perimeter 14 + 3 plot Z is area 1 and perimeter 4 + 1 plot Z is area 119 and perimeter 72 + 1 plot Z is area 13 and perimeter 22 + 1 plot Z is area 17 and perimeter 24 + 1 plot Z is area 18 and perimeter 28 + 3 plot Z is area 2 and perimeter 6 + 4 plot Z is area 3 and perimeter 8 + 1 plot Z is area 47 and perimeter 44 + 1 plot Z is area 56 and perimeter 40 + 1 plot Z is area 57 and perimeter 56 + 1 plot Z is area 7 and perimeter 12 + 1 plot Z is area 76 and perimeter 78 + 1 plot Z is area 9 and perimeter 18 diff --git a/5/a.out b/5/a.out index 64e90b1b119017ceb7d1359f310f7a2440fc25e5..aee010b1553efa2fb780b73854d18b5f17ec4b85 100755 GIT binary patch delta 2424 zcmZWqeN0nV6uwA3n#HYTL<_nJPJKJ~y;ntdn|IGSzw~1%>b3n0dP}?rbm#iLxFaxrJ6F?B4uz`xNWqtCGVxxo$7R_2wOXsRi--6s^-Iy zh|M$$@>C{z67)D1a2=c~Gu#dY zZGxc63`}i}sNTK>YSrW0i9jfcAS$AkepHcaL^&c4ivC@wD#anq2@UwJYSOM?#)gJi zf*ikMn!MPMTG4I0Z7I10Vm zKwdON_34IU#ne3xLh5nBlj|L1(`aRdBNwJM7+ZlqUglLgOsgyg|vH0F|VG{i|~~` zQ~2~DOzLgIu7?n37!al&1imwTAf#TyW55@{DvwLrrQpu{_;%hd4~Cw%;nu;d`%n{~ zqivP_gFKty!CCkseyMO`7JiNYOJgng!0$oGeu0Qd(d{QRTdq!Y4K2CNylBBeGt+%i=W9kwN zZ&C;6qhs_UxuZ?Gk3A910?Fp{k$pB>Q3?8a>#9Pc$QyM4eEXH5sKwg}#TUZ+#Df}1{g(qS|Xg5A*rr@$I zDe@SqiPLb)mJm6F>gj2SOHNQIOkeR$1nNsD32vcutzf`E2=}GjZjN1v2wXC16tW^8XHB|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A>I-v}SF~!lb{G3Gps}qKmnMd!uk+LadwwXE(0;;aIc)@qrf)Mf{{7Ydw)9bBi$D zNm?ek#jtS4V`7lFLtR*`_`5^Ct{`+3W@`BS@wgv>l7_0ou)jMTfY%so;oueyOk?O6 z<_^TVyJ=P74u;xOozU|~X+0;=aI_<)>i+h2tWOjs7Ew|P*~=%Rx8sH9+h2&$`w^VN z^i)ceTHMr8QIMW<$rnbQuA}*-2}r*F9;vS&T}Shan%@eX6gvySrx+=B zN}rw_PzmElD$2il&!pf563Q#Z`KPC&^bSYqtM@hvUMqD~{7OzidbCIHgcPpc3n{o& z>KDf^$&A(;lvAaz-b*PsC${|$f+t8Quc*tMf}a8}Uw=?C6x>dU%PUGxkv@k?zP?(YDOj!q zB`hAlUy}MN|I8%?CHzzE|5}m$Y^kSUt2C!TvH#OW`dw0AL3($SUsV4q+V@bw<3Di@ z5KX=>b>xY)ZdxYG%HF^K^@BZ`f5FGEHdR) zoXU*S%i&Nanu=eo2iv56u{`<8FXhs|6wk4gKF#m>Md>RzUFzq{Q2ilku-LBBQ}XjB z(0^Vk{vtOqm>R|UjT7j9@>Wy+2So}+C|f;&{`;4k`b{daGT>tUO;W$OonKsODh%gN zY!g@d3exK{su$}ItTyGecu?1`63~j8C=`#a b6M$V&j!ZP?SE9Ig8(;q;UQ?puPw4*-eETa{ diff --git a/5/mainB.c b/5/mainB.c new file mode 100644 index 0000000..5f5c58f --- /dev/null +++ b/5/mainB.c @@ -0,0 +1,156 @@ +#include +#include +#include +#include + +#define LINES 1000 + +struct page { + int page; + int *illegalPrec; + int ruleLen; + struct page *next; +}; + +void shuffle(int *array, size_t n) +{ + if (n > 1) + { + size_t i; + for (i = 0; i < n - 1; i++) + { + size_t j = i + rand() / (RAND_MAX / (n - i) + 1); + int t = array[j]; + array[j] = array[i]; + array[i] = t; + } + } +} + +void add_page(struct page *head, int page) +{ + // traverse list until last member + while(head->next) head = head->next; + + // allocate and store ptr + head->next = malloc(sizeof(struct page)); + + // allocate illegalArray + head->next->illegalPrec = calloc(16, sizeof(int)); + head->next->ruleLen = 16; + + // store page number in new item + head->next->page = page; + head->next->next = 0; +} +void add_rule (struct page *page, int illegal) +{ + // make sure you wont go oob + int i = 0; + for (i = 0; i < page->ruleLen && page->illegalPrec[i] != 0; i++); + // if oob, realloc illegalPrec and change ruleLen-size + if (i >= page->ruleLen - 1) { + page->illegalPrec = realloc(page->illegalPrec, + page->ruleLen * 2 * sizeof(int)); + page->ruleLen *= 2; + } + // store illegal page + page->illegalPrec[i] = illegal; +} + +// power! x to the y! +int pow(int x, int y) +{ + int ans = 1; + for (int i = 0; i < y; i++) ans *= x; + return ans; +} +// parse string into array of numbers +int parse_numbers(char *str_row, int *row, int n) +{ + int i = 0; + for (; str_row[i] != '\n'; i++); + for (; i >= 0; i--) { + int pos = 0; + for (; str_row[i] >= '0' && str_row[i] <= '9' && i >= 0; i--) { + row[n] += (str_row[i] - '0') * pow(10, pos); + pos++; + } + n--; + } + + return 1; +} + +bool check_report (int *updates, int len, struct page *rules) +{ + for (int i = len - 1; i >= 0; i--) { + struct page *current = rules; + // for each array member, try to find it in rules + while (current->page != updates[i] && current->next) + current = current->next; + if (current->page != updates[i]) + continue; + // if found, for each lower array member, + // iterate through current->illegalPrec + // if match, illegal report + for (int j = i - 1; j >= 0; j--) { + for (int k = 0; k < current->ruleLen; k++) { + if (updates[j] == current->illegalPrec[k]) + return 0; + } + } + } + return 1; +} + +int main () +{ + FILE *input = fopen("input", "r"); + // create list of pages, each with arrays of pages that must be BEFORE them + struct page *pages = malloc(sizeof(struct page)); + struct page *current = pages; + // find pair. + int left = 0; + int right = 0; + // init head + fscanf(input, "%d|%d", &left, &right); + current->page = left; + current->ruleLen = 16; + current->illegalPrec = calloc(16, sizeof(int)); + add_rule(current, right); + while (fscanf(input, "%d|%d", &left, &right) == 2) { + // check if left exists in list + while (current->next && current->page != left) + current = current->next; + if (current->page == left) { + add_rule(current, right); + } + else { + add_page(pages, left); + add_rule(current->next, right); + } + current = pages; + } + fseek(input, -2, SEEK_CUR); + // take in line. Parse numbers until newline. + char line[100]; + int sum_reports = 0; + while (fgets(line, 100, input)) { + int numbers = 1; + for (int c = 0; line[c]; c++) numbers += (line[c] == ','); + int *updates = (int *)calloc(numbers, sizeof(int)); + parse_numbers(line, updates, numbers); + + while (!check_report(updates, numbers, pages)) { + shuffle(updates, numbers); + if (check_report(updates, numbers, pages)) + sum_reports += updates[numbers / 2]; + } + } + // Remember how many numbers you got this line, we'll iterate backwards! + // for each number in update, iterate through page-rules til you find it + // if found, make sure it isnt preceded by any page in its list? + // probably best to work completely backwards? rules can only ban pages from being before others + printf("sum: %d\n", sum_reports); +} diff --git a/5/mainBShuffle.c b/5/mainBShuffle.c new file mode 100644 index 0000000..5f5c58f --- /dev/null +++ b/5/mainBShuffle.c @@ -0,0 +1,156 @@ +#include +#include +#include +#include + +#define LINES 1000 + +struct page { + int page; + int *illegalPrec; + int ruleLen; + struct page *next; +}; + +void shuffle(int *array, size_t n) +{ + if (n > 1) + { + size_t i; + for (i = 0; i < n - 1; i++) + { + size_t j = i + rand() / (RAND_MAX / (n - i) + 1); + int t = array[j]; + array[j] = array[i]; + array[i] = t; + } + } +} + +void add_page(struct page *head, int page) +{ + // traverse list until last member + while(head->next) head = head->next; + + // allocate and store ptr + head->next = malloc(sizeof(struct page)); + + // allocate illegalArray + head->next->illegalPrec = calloc(16, sizeof(int)); + head->next->ruleLen = 16; + + // store page number in new item + head->next->page = page; + head->next->next = 0; +} +void add_rule (struct page *page, int illegal) +{ + // make sure you wont go oob + int i = 0; + for (i = 0; i < page->ruleLen && page->illegalPrec[i] != 0; i++); + // if oob, realloc illegalPrec and change ruleLen-size + if (i >= page->ruleLen - 1) { + page->illegalPrec = realloc(page->illegalPrec, + page->ruleLen * 2 * sizeof(int)); + page->ruleLen *= 2; + } + // store illegal page + page->illegalPrec[i] = illegal; +} + +// power! x to the y! +int pow(int x, int y) +{ + int ans = 1; + for (int i = 0; i < y; i++) ans *= x; + return ans; +} +// parse string into array of numbers +int parse_numbers(char *str_row, int *row, int n) +{ + int i = 0; + for (; str_row[i] != '\n'; i++); + for (; i >= 0; i--) { + int pos = 0; + for (; str_row[i] >= '0' && str_row[i] <= '9' && i >= 0; i--) { + row[n] += (str_row[i] - '0') * pow(10, pos); + pos++; + } + n--; + } + + return 1; +} + +bool check_report (int *updates, int len, struct page *rules) +{ + for (int i = len - 1; i >= 0; i--) { + struct page *current = rules; + // for each array member, try to find it in rules + while (current->page != updates[i] && current->next) + current = current->next; + if (current->page != updates[i]) + continue; + // if found, for each lower array member, + // iterate through current->illegalPrec + // if match, illegal report + for (int j = i - 1; j >= 0; j--) { + for (int k = 0; k < current->ruleLen; k++) { + if (updates[j] == current->illegalPrec[k]) + return 0; + } + } + } + return 1; +} + +int main () +{ + FILE *input = fopen("input", "r"); + // create list of pages, each with arrays of pages that must be BEFORE them + struct page *pages = malloc(sizeof(struct page)); + struct page *current = pages; + // find pair. + int left = 0; + int right = 0; + // init head + fscanf(input, "%d|%d", &left, &right); + current->page = left; + current->ruleLen = 16; + current->illegalPrec = calloc(16, sizeof(int)); + add_rule(current, right); + while (fscanf(input, "%d|%d", &left, &right) == 2) { + // check if left exists in list + while (current->next && current->page != left) + current = current->next; + if (current->page == left) { + add_rule(current, right); + } + else { + add_page(pages, left); + add_rule(current->next, right); + } + current = pages; + } + fseek(input, -2, SEEK_CUR); + // take in line. Parse numbers until newline. + char line[100]; + int sum_reports = 0; + while (fgets(line, 100, input)) { + int numbers = 1; + for (int c = 0; line[c]; c++) numbers += (line[c] == ','); + int *updates = (int *)calloc(numbers, sizeof(int)); + parse_numbers(line, updates, numbers); + + while (!check_report(updates, numbers, pages)) { + shuffle(updates, numbers); + if (check_report(updates, numbers, pages)) + sum_reports += updates[numbers / 2]; + } + } + // Remember how many numbers you got this line, we'll iterate backwards! + // for each number in update, iterate through page-rules til you find it + // if found, make sure it isnt preceded by any page in its list? + // probably best to work completely backwards? rules can only ban pages from being before others + printf("sum: %d\n", sum_reports); +}