5424. 数组中两元素的最大乘积 理解错误,无脑暴力了一发居然过了 class Solution { public: int maxProduct(vector<int>& nums) { int res=0; for(int i=0;i<nums.size()-1;++i) { for(int ...
分类:
其他好文 时间:
2020-05-31 17:59:14
阅读次数:
49
#include<bits/stdc++.h> using namespace std; struct BigInteger { static const int BASE=10000; static const int WIDTH=4; vector<long long>s; BigInteger ...
分类:
其他好文 时间:
2020-05-31 15:45:43
阅读次数:
54
bert-as-service: Mapping a variable-length sentence to a fixed-length vector using BERT model 默认情况下bert-as-service只提供固定长度的特征向量,如果想要直接获取分类预测结果呢? bert提供 ...
分类:
其他好文 时间:
2020-05-31 01:10:40
阅读次数:
158
二叉搜索树 定义 二叉查找树(英语:Binary Search Tree),也称为二叉搜索树、有序二叉树(ordered binary tree)或排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树: 若任意节点的左子树不空,则左子树上所有节点的值均小于它的根节 ...
分类:
其他好文 时间:
2020-05-31 00:56:13
阅读次数:
52
#include<vector> // 包含头文件vector ... using namespace std; // vector包含在std中,因此必须包含std::vector vector <int> vi; // create a zero-size array of int int n; ...
分类:
编程语言 时间:
2020-05-30 23:25:48
阅读次数:
106
在面试的时候突然遇到一个问题,面试官给出一个字符串数组,我该怎么去保存这个字符串数组呢,保存好以后又怎么把这个字符串数组利用起来, 我一开始想到的是用vector<string>存储, vector<string> vecstr={"i","work","at","byte","bytedance" ...
分类:
编程语言 时间:
2020-05-30 20:02:54
阅读次数:
100
使用散链表的字符串连接法。 class Solution { public: vector<string> fizzBuzz(int n) { vector<string> ans; //Hash map to store all fizzbuzz mappings. map<int, string ...
分类:
其他好文 时间:
2020-05-30 12:43:38
阅读次数:
59
进阶解法1:排序双指针 class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { sort(nums1.begin(), nums1.end()); sort(nums2.begi ...
分类:
编程语言 时间:
2020-05-30 01:20:17
阅读次数:
70
除了每个容器有自己的迭代器之外,标准库在头文件iterator中还定义了额外几种迭代器 这些迭代器包括:插入迭代器(insert iterator):这些迭代器被绑定到一个容器上,可用来向容器插入元素流迭代器(stream iterator):这些迭代器被绑定到输入或输出流上,可用来遍历所有关联的I ...
分类:
编程语言 时间:
2020-05-30 01:19:43
阅读次数:
180
1 bool verifyPostorder(vector<int>& postorder){ 2 if(postorder.empty()) return true; 3 bool res = helper(postorder,0,postorder.sizee()-1); 4 return re ...
分类:
其他好文 时间:
2020-05-30 00:58:47
阅读次数:
77