随笔分类 - 【01】 ACM
摘要:P1091 合唱队形 看一下题解吧,你好i需要正反搜一下lcs ,然后合并 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout);
阅读全文
摘要:传送门 lcs问题 O(n^2) 暴力搜索 就TLE 了 所以直接 二分就好了维护第i 小 的数字 是多少 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("ou
阅读全文
摘要:1 判定: 采用 bfs 搜索染色 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); const int inf = 9876
阅读全文
摘要:博弈论 首先,定义一下 状态Position P 先手必败 N x先手必胜 操作方法: 反向转移 相同状态 不同位置 的一对 相当于无 对于ICG游戏,我们可以将游戏中每一个可能发生的局面表示为一个点。并且若存在局面i和局面j,且j是i的后继局面(即局面i可以转化为局面j),我们用一条有向边,从i出
阅读全文
摘要:所谓扫雷首先一个简单只有一行啊 a[i]=a[i-1]-vis[i-1]-vis[i-2] 通过二元一次方程 正推 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen
阅读全文
摘要:算法一:prime 特别好用的 O(n^2)和dij 差了两行 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); #defin
阅读全文
摘要:传送门 模拟堆 #include <cstdio> #include <iostream> using namespace std; int heap[100005], size = 0; //第一个元素的下标为1. void push(int x){ int i = ++size; while(i
阅读全文
摘要:算法一 :迪杰斯特拉 算法详情:贪心 维护一个 dis 数组 进行 松弛操作 适用: 单源最短路 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w
阅读全文
摘要:传送门 bfs 大法 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","w",stdout); typedef long long ll; #defi
阅读全文
摘要:hiho1 1044 状态压缩·一 hiho2 1048 状态压缩·二 这两个状态压缩,很好玩的啊 #include<bits/stdc++.h> using namespace std; #define LOACL freopen("in","r",stdin);\ freopen("out","
阅读全文
摘要:A Left-handers, Right-handers and Ambidexters B Intercepted Message C Zebras D A Leapfrog in the Array #include <bits/stdc++.h> using namespace std; t
阅读全文
摘要:传送门 bfs 搜索,几乎板子一样 但是有一点需要注意就是输出格式
阅读全文
摘要:二分操作: upper_bound lower_bound binary_search 在已有序列中查找 指定数据 binary search upper_bound 查找一个 >n 的最小地址 重载的是<n的最小地址 lower_bound 查找一个 >=n 的最小地址 重载的是<=n的最小地址
阅读全文
摘要:传送门 非减子序列 普通lcs Dp TLE ,换成upper_bound 竟然过了,神奇
阅读全文
摘要:传送门 暴力DP dp[i][j][k] 从j 到 k 发f(x) 的大小,
阅读全文
摘要:传送门 听不好操作的 ,刚开始b没用DP,就TLE了,dp[i][j] 第 i 个字符串 处理了 j 次操作
阅读全文
摘要:传送门 字符串开挂,从左到右开始搜
阅读全文
摘要:传送门 模拟,写的比较土,别吐槽
阅读全文
摘要:传送门 分治就好了,哈哈大于小于0的数据分开算
阅读全文

浙公网安备 33010602011771号