随笔分类 - 【01】 ACM
摘要:感谢上天让我碰到了div 3 #include <bits/stdc++.h> using namespace std; #define LOCAL freopen("in","r",stdin);\ freopen("out","w",stdout); #define DBG2(x,y) cout
阅读全文
摘要:心情不好,被遣散回学校 ,心态不好 ,为什么会累,一直微笑就好了 #include<bits/stdc++.h> using namespace std; int main() { freopen("in","r",stdin);\ freopen("out","w",stdout); int n
阅读全文
摘要:全场暴力 挺毒的 A 数字问题很简单 #include <bits/stdc++.h> using namespace std; int main() { freopen("in","r",stdin);\ freopen("out","w",stdout); int a,b,c,n; cin>>a
阅读全文
摘要:终于结束了紧张而刺激 的大三考试 ,开始打比赛了 ,手真的生了 A #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); #def
阅读全文
摘要:大数理论 入门 Luacs(n,m,p) = C(n%p,m%p)*Lucas(n/p,m/p,p); C(n,m,p) = n!/(n-m)! ^p-2 modp #include<bits/stdc++.h> using namespace std; #define LOACL freopen(
阅读全文
摘要:11. 盛最多水的容器 class Solution { public: int maxArea(vector<int>& height) { vector<int> & v =height; int l =0,r=v.size()-1; int res = 0; while(l<r) { int
阅读全文
摘要:1 .Edmonds-Karp 算法 : 通过反向增光路+bfs 求解最大流 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout);
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); const int sz = (int)1e7 + 5; const dou
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); const int sz = (int)1e6 + 5; #define C
阅读全文
摘要:模板 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); #define REP(i,l,r) for(int i=l;i<=r
阅读全文
摘要:在写一发树状数组,个人理解为hash 一种,就是通过数字的二进制数字表示这个数字 应该计算多少 洛谷板子 水了两发 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen
阅读全文
摘要:每日一算,公共祖先问题 分类 单根,那么 直接 dfs(root) #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); #def
阅读全文
摘要:P1007 独木桥 双优先队列,,乱七八糟 压 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); #define FASTIO
阅读全文
摘要:黑科技:静态查询第K大 首先说一下,我的理解,主席树就是持久化的线段树,因为存在规律,所以没入更新只会更新一条链,lg n 静态查询第K大 ,简单离线,然后hash ,二分 查询 然后建立 这个主席树 说一下,主席树 会有三个东西, 左,右 ,有多少元素 有几点注意: 1.qsc 的 hash 方法
阅读全文
摘要:经过了一阵时间 的学习整理,重新认识了线段树,在线RMQ O(nlgn) 前几天写了堆,就是差不多了,直接将元素全部甩在叶子节点,然后上层对应区间 和树状数组区别: 那个是通过1的位置进行区间划分. 闲言少述 #include<bits/stdc++.h> using namespace std;
阅读全文
摘要:堆:主要用于解决TOPK 问题 我说一下使用上的问题:具体怎么定义,请查看一本神奇的书籍 数据结构 为了方便 ,直接介绍 stl : 堆的问题 首先 根据 数据 范围 进行 的建立 堆 : make_heap(begin ,end, _comp) 从 begin 到 end 建立一个堆 注意stl
阅读全文
摘要:1P1111 修复公路 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); #define FASTIO ios::sync_w
阅读全文
摘要:每日一题:传送门 题目分析: n m 放炮,导致每行列当中 仅仅有 0 1 2 这样的情况 所以 状态转移 dp[i][j][k] > 处理了 i 行 有 j 个1 ,k 个 2 1.添加一行 0 dp[i+1][j][k] += dp[i][j][k] 2.添加一行1 可以新行,可以原先0 dp[
阅读全文
摘要:今天有点事,,明天要考CCF,就不写题解了,祝福我 BUFF 加成,我要AK A幸运数字Ⅰ #include <bits/stdc++.h> using namespace std; typedef long long ll ; typedef double dl ; #define INF ((l
阅读全文
摘要:P1508 Likecloud-吃、吃、吃 一眼看出来就是DP 状态转移: f[i][j] = max(f[i-1][j],f[i-1][j-1],f[i-1][j+1])+v[i][j]; #include<bits/stdc++.h> using namespace std; #define L
阅读全文

浙公网安备 33010602011771号