摘要: https://vjudge.net/contest/360957#problem/J #include <bits/stdc++.h> using namespace std; typedef long long ll; struct Matrix{ int m[2][2]; }; Matrix 阅读全文
posted @ 2020-03-10 23:58 SunCY 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 二叉树的遍历,这个题不能用T[4*N]建树,因为最坏的情况树很深,数组会爆的,2^1000 s所以求后续遍历的话,就反着来 根节点—>右子树—>左子树,然后把结果用stack存起来倒叙输出就好了 // preorder sequence inorder sequence postorder sequ 阅读全文
posted @ 2020-03-10 21:42 SunCY 阅读(123) 评论(0) 推荐(0) 编辑
摘要: FBI树,直接套上线段树的模板 #include<bits/stdc++.h> #define endl '\n' #define _for(i,a,b) for(int i=a;i<b;i++) using namespace std; const int N = 1055; typedef lo 阅读全文
posted @ 2020-03-10 20:42 SunCY 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 先达标找规律吧,达标的时候看奇数的个数而不是偶数的个数,就能和看出来了 这个题我算pow(2,n)的时候又出现了向下取整的情况,所以就是说,以后算2的n次方 直接1ll<<n就完了。 https://codeforces.com/gym/101972/problem/J #include<bits/ 阅读全文
posted @ 2020-03-10 15:56 SunCY 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/gym/101972/problem/G 求二维的一片区域中的最大最小值。 #include<bits/stdc++.h> #define endl '\n' #define _for(i,a,b) for(int i=a;i<b;i++) using 阅读全文
posted @ 2020-03-10 15:18 SunCY 阅读(177) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/gym/101972/problem/C https://blog.csdn.net/a1dark/article/details/10679833 #include<bits/stdc++.h> #define endl '\n' #define _f 阅读全文
posted @ 2020-03-10 14:40 SunCY 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> #include<algorithm> #include <queue> #include <functional> #define endl '\n' #define _for(i,a,b) for(int i=a;i<b;i 阅读全文
posted @ 2020-03-10 13:18 SunCY 阅读(103) 评论(0) 推荐(0) 编辑