Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <queue>using namespace std;struct Node {int x, y;Node *up, *down, *left, *right;} node[10010];void removeCol(int col) {Node *p = &node[col];p->right->left = p->left;p->left->right = p->right;Node *p2 = p->down;while (p != p2) {Node *p3 = p2->right;while (p2 != p3) {p3->down->up = p3->up;p3->up->down = p3->down;p3 = p3->right;}p2 = p2->down;}}void recoverCol(int col) {Node *p = &node[col];p->right->left = p;p->left->right = p;