幂集,就是一个集合的所有子集,包括空集 下面附着代码,具体实现的过程代码下面: 各部分代码如下: 首先是 headF.h(headFile的意思) 1 #pragma once 2 3 #include<cstdio> 4 #include<vector> 5 6 using namespace s ...
分类:
其他好文 时间:
2020-10-13 17:14:00
阅读次数:
20
最短路变形题,加一维状态就好啦 $dist[i][j]$表示到达第$i$号点,到达时间为第$j$天的最短距离 判重数组要和$dist$数组一致 直接跑$dijkstra$即可 const int N=1010; vector<PII> g[N]; struct Node { int dis,u,da ...
分类:
其他好文 时间:
2020-10-10 17:45:26
阅读次数:
19
2019-2020 ICPC Northwestern European Regional Programming Contest (NWERC 2019) I-Inverted Deck #include<bits/stdc++.h> using namespace std; const int ...
分类:
其他好文 时间:
2020-10-07 20:36:52
阅读次数:
20
作者|Andy Reagan 编译|VK 来源|Towards Datas Science 在MATLAB和数值计算的世界,for循环被剪掉,而向量为王。 在我的博士学位期间,Lakoba教授的数值分析课是我参加的最具挑战性的课程之一,在课程之后,我对向量代码有了深刻的理解。 我最喜欢的向量化例子是 ...
分类:
其他好文 时间:
2020-10-06 20:14:19
阅读次数:
30
链接:https://leetcode-cn.com/problems/number-of-islands/ // flood fill class Solution { public: vector<vector<char>> g; int dx[4] = {-1, 0, 1, 0}, dy[4] ...
分类:
其他好文 时间:
2020-10-06 20:13:28
阅读次数:
25
103. 二叉树的锯齿形层次遍历 锯齿形层次遍历,思路与二叉树的层次遍历相同,稍微做点改动,区别在于此处使用的是双端队列,分别从前到后和从后到前地遍历二叉树。代码如下 vector<vector<int>> zigzagLevelOrder(TreeNode* root) { deque<TreeN ...
分类:
其他好文 时间:
2020-10-06 19:57:09
阅读次数:
25
#include<bits/stdc++.h> using namespace std; const int N = 300010; vector<int>p[N]; int ans[N]; int main() { int t; scanf("%d",&t); while(t --) { int ...
分类:
其他好文 时间:
2020-10-05 21:46:03
阅读次数:
23
https://leetcode-cn.com/problems/find-mode-in-binary-search-tree/ class Solution { public: int count = 0, max_count = 0; TreeNode* pre = NULL; vector< ...
分类:
其他好文 时间:
2020-09-24 22:11:03
阅读次数:
80
#include <bits/stdc++.h> using namespace std; //不是递增的话就删掉,然后重新计算一次 int getMaxArea(vector<int> &vec) { stack<int> s; int max_area = 0; int i=0; int tp, ...
分类:
编程语言 时间:
2020-09-24 21:38:31
阅读次数:
46
C++语言衍生于C语言这门古老的语言,其主要特性是面向对象,另外一个广为人知的特点是复杂^_^,没有5年以上开发经历,估计没多少人说熟悉,更没人敢说自己精通。 如果对其复杂的语法知识不甚了解,那么Android的native层代码可就不那么容易理解了。 下面介绍几本C++领域的经典书籍。 1.《ef ...
分类:
编程语言 时间:
2020-09-24 20:59:04
阅读次数:
43