【HDU 4031 Attack(树状数组)】教程文章相关的互联网学习教程文章

[每日一题] leetcode 403. 青蛙过河【代码】

因为数据太大,但数据量少,因此可以用map先建立映射关系 再用二维set,其中set[i]表示第i个石块所能跳的距离数组 二维vector会超时,set去重就可以了 然后遍历每个石块,并求出其所能到达石块 所能跳的距离 最后判断第n - 1个石块是否有能跳的步数即可class Solution { public:set<int> V[2020];map<int, int> M;bool canCross(vector<int>& stones) {int n = stones.size();int cnt = 0;for(int i = 0; i < n; i++)M[stones[i]] ...

7.自定义403页面

1.配置增加http.exceptionHandling().accessDeniedPage("/error.html");注意:分号结尾,是单独的一行配置 2.添加一个根本没有权限访问的接口 @GetMapping("/noAuth")@PreAuthorize("hasAuthority(aaa)")public String noAuth(){return "没有有角色访问";} 3.创建对应的error.html<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><title>Title</title> </head> <body>对不起,没有权限访问! </body> </html> 4.访...