上一页 1 2 3 4 5 6 7 8 9 ··· 22 下一页

2021年8月20日

摘要: A:水题,预处理一下符合题目要求的数即可。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include<queue> 5 #include<unordered_map> 6 using namespace 阅读全文
posted @ 2021-08-20 21:26 greenofyu 阅读(38) 评论(0) 推荐(0)

2021年7月6日

摘要: A:模拟题。 1 class Solution { 2 public: 3 vector<int> buildArray(vector<int>& nums) { 4 int n=nums.size(); 5 vector<int> ans(n); 6 for(int i=0;i<n;i++){ 7 阅读全文
posted @ 2021-07-06 22:59 greenofyu 阅读(63) 评论(0) 推荐(0)
摘要: A:水题。 https://www.acwing.com/problem/content/3736/ 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 const in 阅读全文
posted @ 2021-07-06 22:51 greenofyu 阅读(32) 评论(0) 推荐(0)

2021年7月5日

摘要: A:水题。 https://www.acwing.com/problem/content/3729/ 1 #include<iostream> 2 using namespace std; 3 const int N=110; 4 int w[N]; 5 int main() 6 { 7 int T 阅读全文
posted @ 2021-07-05 22:06 greenofyu 阅读(49) 评论(0) 推荐(0)

2021年7月1日

摘要: https://www.acwing.com/problem/content/897/ 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 const int N=101 阅读全文
posted @ 2021-07-01 23:49 greenofyu 阅读(66) 评论(0) 推荐(0)

2021年6月26日

摘要: https://www.acwing.com/problem/content/900/ 注意处理边界即可。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 const 阅读全文
posted @ 2021-06-26 10:28 greenofyu 阅读(65) 评论(0) 推荐(0)

2021年6月3日

摘要: 线段树的基本思想是分治。 此处的是简单线段树,即只支持单点修改,区间查询,不涉及懒标记。 树的每一个节点维护一个区间 [ l , r ] 的值,其子节点的区间的并集等于这个区间的值,左儿子维护[l , mid] ,右儿子维护[ mid+1 , r ]。 树的高度为log(n),所以更新操作的时间复杂 阅读全文
posted @ 2021-06-03 19:44 greenofyu 阅读(59) 评论(0) 推荐(0)

2021年6月2日

摘要: A:水题。 https://leetcode-cn.com/problems/check-if-word-equals-summation-of-two-words/ 1 class Solution { 2 public: 3 int tans(string s){ 4 int res=0; 5 阅读全文
posted @ 2021-06-02 19:35 greenofyu 阅读(55) 评论(0) 推荐(0)

2021年6月1日

摘要: A:水题。 给定两个数组,找到从这俩数组中各找一数,使得和不在任何一个数组中。 因为数组中的数都是正整数,最大的俩数相加必然不在这俩数组之中。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using name 阅读全文
posted @ 2021-06-01 13:59 greenofyu 阅读(60) 评论(0) 推荐(0)

2021年5月28日

摘要: 证明参考:https://zhuanlan.zhihu.com/p/297885717(抄的) 树状数组支持的操作:单点修改,区间查询(仅限于支持减法的操作,不支持的例子:max) 树状数组定义:定义C[ i ] 表示的是A [ i - lowbit(i) ] + 1 ~~ A[ i ] 之间的数据 阅读全文
posted @ 2021-05-28 09:23 greenofyu 阅读(82) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 22 下一页