2596
[LeetCode] 2596. Check Knight Tour Configuration
There is a knight on an n x n chessboard. In a valid configuration, the knight starts at the top-left cell of the board and visits every cell on the b ......
2596. 检查骑士巡视方案 (存储多维数据,tuple和array的速度差距)
本题是简单的模拟,但是对于多维数据的表示(x, y)本题更想探究一下array和tuple之间的区别。 array版本 class Solution { public: bool checkValidGrid(vector<vector<int>>& grid) { if(grid[0][0]) r ......
P2596 [ZJOI2006]书架 题解
题目传送门:[link](https://www.luogu.com.cn/problem/P2596)。 ## FHQ-Treap 解题的关键在于如何来求出一本书上面有多少本书,但考虑到我们里面没有像权值一样的东西来让我们用按值分裂来完成这个操作,所以考虑用按排名分裂来实现。 我们按照先后顺序把所 ......