2022年3月22日

摘要: A:水题。 链接:https://www.acwing.com/problem/content/4379/ 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <map> 5 using names 阅读全文
posted @ 2022-03-22 20:06 greenofyu 阅读(19) 评论(0) 推荐(0) 编辑

2022年2月26日

摘要: A:签到题,直接模拟即可 题目地址:https://www.acwing.com/problem/content/4308/ 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <set> 5 6 阅读全文
posted @ 2022-02-26 22:21 greenofyu 阅读(34) 评论(0) 推荐(0) 编辑

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 阅读(25) 评论(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 阅读(47) 评论(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 阅读(18) 评论(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 阅读(37) 评论(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 阅读(50) 评论(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 阅读(45) 评论(0) 推荐(0) 编辑

2021年6月3日

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