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 ......
Configuration LeetCode Knight Check 2596

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 解题的关键在于如何来求出一本书上面有多少本书,但考虑到我们里面没有像权值一样的东西来让我们用按值分裂来完成这个操作,所以考虑用按排名分裂来实现。 我们按照先后顺序把所 ......
题解 书架 P2596 2596 2006

P2596 [ZJOI2006]书架

$\color{purple}\text{P2596 [ZJOI2006]书架}$ 解题方法 考虑使用 $\text{FHQ}$ 平衡树 ,我们只使用编号,而不使用权值,平衡树上的先序遍历即为书的放置顺序。 $\text{Query}$ :这是最简单的操作,直接查询即可。 $\text{Ask}$: ......
书架 P2596 2596 2006 ZJOI
共4篇  :1/1页 首页上一页1下一页尾页