正文
增加 39 行删除 18 行
1234567839 行未改动484950515253545520 行未改动76777879808182838485868788899091929394959697989983 行未改动18318418518618718818919019111 行未改动20320420520620720820921021128 行未改动24024124224324424524624724824925025125225325425525628 行未改动28528628728828929029129229329415 行未改动310311312313314315316317318319320321322323324325326327328329330```cpp line-numbers#include <bits/stdc++.h>#include <windows.h>#include <conio.h>#define endl '\n'using namespace std;const int N = 150;39 行未改动else if(col == "light_yellow")SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);else if(col == "light_white")SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);elseSetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);}20 行未改动else if(x == 9)setcolor("yellow"), printf(" 树套树 "), setcolor("white");else if(x == 10)setcolor("red"), printf("K-D Tree"), setcolor("white");elsesetcolor("purple"), printf(" 动态树 "), setcolor("white");}void output(){system("cls");printf("合成");output_single(11);printf("\n使用↑↓←→移动\n");printf("你目前的得分是:%d\n", score);printf("合成顺序:");for(int i = 1; i <= 11; i++){output_single(i);if(i != 11) printf("->");}printf("\n");for(int i = 1; i <= siz; i ++){83 行未改动else nw[++ nt] = r[j];for(int j = 1; j <= siz; j++)board[j][i] = 0;for(int j = 1; j <= nt; j++)board[j][i] = nw[j];}}void down(int (&board)[N][N])11 行未改动else nw[++ nt] = r[j];for(int j = 1; j <= siz; j++)board[j][i] = 0;for(int j = 1; j <= nt; j++)board[siz - j + 1][i] = nw[nt - j + 1];}}bool cant_move()28 行未改动for(int j = 1; j <= siz; j ++)if(board_res[i][j] != board[i][j]) return false;for(int i = 1; i <= siz; i ++)for(int j = 1; j <= siz; j ++)board_res[i][j] = board[i][j];return true;}bool win(){for(int i = 1; i <= siz; i ++)for(int j = 1; j <= siz; j ++)if(board[i][j] > 10) return true;return false;}int nowmx = 0;28 行未改动else if(x == 9)MessageBox(NULL, "对于序列问题有着仅次于分块的处理能力,适配面十分广。", "树套树", MB_OK);else if(x == 10)MessageBox(NULL, "K-D Tree 是处理高维空间问题的利器。", "K-D Tree", MB_OK);elseMessageBox(NULL, "在树上,动态树就是无敌的。连边断边,链查链改!", "动态树", MB_OK);}int main(){15 行未改动{for(int i = nowmx + 1; i <= k; i++) display(i);nowmx = k;}char c = 114;while(c != 75 && c != 77 && c != 72 && c != 80) c = _getch();if(c == 75) left(board);else if(c == 77) right(board);else if(c == 72) up(board);else down(board);if(win()){output();MessageBox(NULL, "你胜利了!你合成了动态树!", "胜利", MB_OK);display(11);return 0;}}return 0;}```1234567839 行未改动4849505152535455565720 行未改动7879808182838485868788899091929394959697989910010110210310410510610783 行未改动19119219319419519619719819911 行未改动21121221321421521621721821928 行未改动24824925025125225325425525625725825926026126226326428 行未改动29329429529629729829930030130230330430530630730815 行未改动324325326327328329330331332333334335336337338339340341342343344345346347348349350351```cpp#include <bits/stdc++.h>#include <windows.h>#include <conio.h>#define endl '\n'using namespace std;const int N = 150;39 行未改动else if(col == "light_yellow")SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);else if(col == "light_white")SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);else if(col == "cholly")SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 96);elseSetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);}20 行未改动else if(x == 9)setcolor("yellow"), printf(" 树套树 "), setcolor("white");else if(x == 10)setcolor("red"), printf("K-D Tree"), setcolor("white");else if(x == 11)setcolor("purple"), printf(" 动态树 "), setcolor("white");else if(x == 12)setcolor("grey"), printf(" ETT "), setcolor("white");else if(x == 13)setcolor("blue"), printf(" SATT "), setcolor("white");elsesetcolor("cholly"), printf("珂朵莉树"), setcolor("white");}void output(){system("cls");printf("合成");output_single(14);printf("\n使用↑↓←→移动\n");printf("你目前的得分是:%d\n", score);printf("合成顺序:");for(int i = 1; i <= 14; i++){output_single(i);if(i != 14) printf("->");}printf("\n");for(int i = 1; i <= siz; i ++){83 行未改动else nw[++ nt] = r[j];for(int j = 1; j <= siz; j++)board[j][i] = 0;for(int j = 1; j <= nt; j++)board[j][i] = nw[j];}}void down(int (&board)[N][N])11 行未改动else nw[++ nt] = r[j];for(int j = 1; j <= siz; j++)board[j][i] = 0;for(int j = 1; j <= nt; j++)board[siz - j + 1][i] = nw[nt - j + 1];}}bool cant_move()28 行未改动for(int j = 1; j <= siz; j ++)if(board_res[i][j] != board[i][j]) return false;for(int i = 1; i <= siz; i ++)for(int j = 1; j <= siz; j ++)board_res[i][j] = board[i][j];return true;}bool win(){for(int i = 1; i <= siz; i ++)for(int j = 1; j <= siz; j ++)if(board[i][j] > 13) return true;return false;}int nowmx = 0;28 行未改动else if(x == 9)MessageBox(NULL, "对于序列问题有着仅次于分块的处理能力,适配面十分广。", "树套树", MB_OK);else if(x == 10)MessageBox(NULL, "K-D Tree 是处理高维空间问题的利器。", "K-D Tree", MB_OK);else if(x == 11)MessageBox(NULL, "在树上,动态树就是无敌的。连边断边,链查链改!", "动态树", MB_OK);else if(x == 12)MessageBox(NULL, "一个很全面的数据结构,可惜用 LCT 维护的话会有 2 只 log。", "ETT", MB_OK);else if(x == 13)MessageBox(NULL, "这种数据结构也只会在重工业 Sone1 用得到了……", "SATT", MB_OK);elseMessageBox(NULL, "我永远喜欢珂朵莉!", "珂朵莉树", MB_OK);}int main(){15 行未改动{for(int i = nowmx + 1; i <= k; i++) display(i);nowmx = k;}char c = 114, r = rand() % 4;/*下面这个是自动随机代打的代码*/if(r == 0) c = 75;else if(r == 1) c = 77;else if(r == 2) c = 72;else c = 80;/*下面这个是手动输入的代码*///while(c != 75 && c != 77 && c != 72 && c != 80) c = _getch();if(c == 75) left(board);else if(c == 77) right(board);else if(c == 72) up(board);else down(board);if(win()){output();MessageBox(NULL, "你胜利了!你合成了珂朵莉树!", "胜利", MB_OK);display(14);return 0;}Sleep(10);}return 0;}```