Dfine
Dfine
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Dfine的博客
全部文章
(共78篇)
题解 | 树转链表
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
2025-07-07
0
24
题解 | 最大连续数列和
class MaxSum { public: int getMaxSum(vector<int> A, int n) { // write code here int maxsum =A[0]; int cursum=A[0]; ...
2025-07-07
0
21
题解 | 无判断max
class Max { public: int getMax(int a, int b) { // write code here int sym = (a-b) >> 31; return a+(a-b) *sym; } ...
2025-07-07
0
26
题解 | 井字棋
class Board { public: bool checkWon(vector<vector<int> > board) { // write code here for(int i=0;i< board.size();i+...
2025-07-07
0
26
题解 | 无缓存交换
class Exchange { public: vector<int> exchangeAB(vector<int> AB) { // write code here AB[0] = AB[0] ^ AB[1]; AB...
2025-07-07
0
19
题解 | 数组中的逆序对
#include <algorithm> #include <vector> class AntiOrder { public: int count(vector<int> A, int n) { // write code here ...
2025-07-07
0
23
题解 | n皇后问题
class Queens { int count=0; void solve(int n, int row, int col, int ld, int rd ){ if(row ==n ){ ++count; retur...
2025-07-06
0
21
题解 | 合法括号序列判断
#include <vector> class Parenthesis { public: bool chkParenthesis(string A, int n) { // write code here vector<char>...
2025-07-05
0
24
题解 | 多少种分类
#include <vector> class Coins { const int mod = 1000000007; public: int countWays(int n) { // write code here vector<...
2025-07-04
0
23
题解 | 魔术索引I
class MagicIndex { public: bool findMagicIndex(vector<int> A, int n) { // write code here int start = 0; int end = n...
2025-07-04
0
22
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页