Sum 系列题解 Two Sum题解 题目来源:https://leetcode.com/problems/two-sum/description/ Description Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one sol…
N-Queens 系列题解 题目来源: N-Queens N-Queens II N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each so…
Search in Rotated Sorted Array 系列题解 题目来源: Search in Rotated Sorted Array Search in Rotated Sorted Array II 第一版 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0…
Combination Sum 系列题解 题目来源:https://leetcode.com/problems/combination-sum/description/ Description Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to…
2768: Zju1290 Word-Search Wonder Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 4 Solved: 2[Submit][Status][Web Board] Description The Pyrates Restaurant was starting to fill up as Valentine McKee walked in. She scanned the crowd for her sister, bro…
无指针Splay超详细讲解 区间树这玩意真TM玄学. 学这东西你必须要拥有的 1.通过[模板]文艺平衡树(Splay),[模板]普通平衡树,GSS3 - Can you answer these queries III 2.学会Splay,学会求最大子段和并知道怎么维护信息和下传标记,及会有区间修的最大子段和 3.多年的编程技巧,以及一颗写数据结构的良好心态 4.攒够两个月的肝,这很重要! 如果你不会上面东西的解决方法 1.看以下博客Splay入门解析,文艺平衡树Splay题解,GSS系列题解-…
思路: 一道BFS题,和以前的BFS有点不同,这里的vis数组需要记录每次走时的状态,所以开了3维,只对该状态下的vis修改. 注意坑点:S的位置是可以走的 代码: #include<queue> #include<cstdio> #define ll long long using namespace std; const int N = 100+5; char mp[N][N]; bool vis[4][N][N]; int X1,Y1,X2,Y2,x,y,n,m,t,to[4…
A - Problem A Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submitcid=1095#status--A" class="uibtn" style="color:rgb(85,85,85); text-decoration:none; background-color:rgb(255,255,255); vertical-align:…