C++面试常见问题(持续更新)
摘要:1.虚函数与纯虚函数: A:虚函数是一种虚拟函数,主要是用来实现多态的一种函数,简单理解就是一个借口多种实现,通过虚函数,实现子类所需要的功能。
阅读全文
代码模板(new)
摘要:1.树状数组:题目:UVA1428 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<string> 5 #include<cstring> 6 #include<numeric> 7 #include<
阅读全文
算法竞赛从入门到进阶 罗书解题报告
摘要:POJ 3468-A Simple Problem with Integers: 题目链接 线段树经典板子题,注意当数据范围大于是1e5的时候,采用线段树求解,才可以AC。 区间更新的时候注意不要忘记加上lazy标记,减少更新的次数!!! 1 #include<iostream> 2 #includ
阅读全文
DP经典题目
摘要:300. 最长上升子序列 1 class Solution 2 { 3 public: 4 int lengthOfLIS(vector<int>& nums) 5 { 6 int n=nums.size(); 7 if(n==0)return 0; 8 if(n==1)return 1; 9 10
阅读全文
需要再刷一遍的题目
摘要:1.求root(N,k) https://www.nowcoder.com/practice/9324a1458c564c4b9c4bfc3867a2aa66?tpId=40&tqId=21347&tPage=1&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan/question-
阅读全文