- 博客(6)
- 收藏
- 关注
原创 c语言基础
#include 包含头文件 #define 宏 替换,不进行语法检查,宏名一般大写 #define 宏名 宏体 加括号 #define ABC (5+3) #define ABC(x) ( 5+(x)) #ifdef 宏 #ifdef #else #endif 预定义宏 _FUNCTION_ :函数名 _LINE_ :行号 _FILE_ :文件名 #include <cstdio&g...
2019-12-31 19:53:52 72
原创 leetcode733图像渲染
class Solution{ public: vector<vector<int>> floodFill(vector<vector<int> >& image,int sr,int sc,int newColor){ if(image.empty() || image[0].empty()) return image;...
2019-12-31 13:30:56 137
原创 leetcode279完全平方数
class Solution{ public: int numSquares(int n){ queue<int> q; vector<int> dist(n + 1,INT_MAX); q.push(0); dist[0] = 0; while(q.size()) { int t = q.front(); q....
2019-12-31 12:25:43 106
原创 leetcode腾讯精选,两数相加
给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 您可以假设除了数字 0 之外,这两个数都不会以 0 开头。 示例: 输入:(2 -> 4 -> 3) + (5 -> 6 -> 4) 输出:7 -> 0 -> ...
2019-12-27 19:11:09 73
原创 二维树状数组
#incude <iostream> #include <cstring> using namespace std; const int maxn = 10000; int n,a[maxn][maxn],c[maxn][maxn];//二维树状数组 int lowbit(int i)//区间长度 { return (-i)&i; } void add(in...
2019-12-24 22:29:40 67
原创 树状数组
#include <iostream> #include <cstring> using namespace std; const int maxn = 10000; int n,a[maxn],c[maxn],s[maxn]; int lowbit(int i) //c[i]的区间长度 { return (-i)&i; } void add(int i...
2019-12-24 22:08:33 64
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人