Part of the content comes from the Internet.If there is any infringement, please let me know and I 'll delete it in time. This code is creat with the help of the codes from internet. If you wanna tell a girl something, you understand^_^. 1 #include…
Flash Media Live Encoder命令行推流Flash Media Live Encoder NotesFlash Media Live Encoder 除了直接以 GUI 方式操作之外还能透过 Command Line 呼叫 FMLECmd 方式控制以下则是简单的笔记 大部分 FMLECmd 操作都是需要一个 fmle_uid 参数的fmle_uid 用来表示一个 encoding session fmle_uid 格式定义假如是 rtmp streamingfmle_uid =…
A. (a, b)-Tower 当指数大于模数的时候用欧拉定理递归计算,否则直接暴力计算. #include<cstdio> #include<algorithm> #include<cmath> #include<string> #include<iostream> using namespace std; typedef long long LL; int pw(int x,int y,int mod){ int ret=1; for(int…
A. Area of Effect 首先最优解中必有一个点在圆的边界上. 若半径就是$R$,则枚举一个点,然后把剩下的事件极角扫描即可,时间复杂度$O(m(n+m)\log(n+m))$. 否则圆必然撞到了两个圆,枚举一个点以及两个圆,二分出最大的半径,然后统计内部点数即可,时间复杂度$O(n^2m(n+m))$. #include<cstdio> #include<cmath> #include<algorithm> using namespace std; type…
A. Artifacts 建立语法分析树,首先根据上下界判断是否有解,然后将所有数按下界填充,线段树判断是否存在和超过$K$的子区间. B. Brackets and Dots 最优解中一定包含一对中间都是点的$()$,set维护所有这种pair即可. #include<cstdio> #include<set> #include<cstring> #include<algorithm> using namespace std; typedef pair&l…
A. Ancient Diplomacy 建图,同色点间边权为$0$,异色点间边权为$1$,则等价于找一个点使得到它最短路最长的点的最短路最小,Floyd即可. 时间复杂度$O(n^3)$. #include<cstdio> #include<algorithm> using namespace std; const int N=110,inf=100000000; int n,m,i,j,k,x,y,a[N],g[N][N]; int main(){ while(~scanf(&…
A. Automat $m$超过$1600$是没用的. 从后往前考虑,设$f[i][j][k]$表示考虑$[i,n]$这些物品,一共花费$j$元钱,买了$k$个物品的最大收益. 时间复杂度$O(n^5)$. #include<cstdio> const int N=45,M=1605; int n,m,lim,A,B,i,j,k,x,y,z,o,a[N],b[N],f[2][M][N],ans; inline void up(int&a,int b){a<b?(a=b):0;}…
A. Pieces of Parentheses 将括号串排序,先处理会使左括号数增加的串,这里面先处理减少的值少的串:再处理会使左括号数减少的串,这里面先处理差值较大的串.确定顺序之后就可以DP了. 时间复杂度$O(n^3)$. #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=310,inf=1000000; int n,i,j,m,all,…
B. Train Seats Reservation You are given a list of train stations, say from the station 1 to the station 100. The passengers can order several tickets from one station to another before the train leaves the station one. We will issue one train from t…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6241 题意:给你一棵有 n 个结点的树,每个结点初始颜色都为白色,有 A 个条件:结点 x_i 的黑色结点数目不少于 y_i 个,同时有 B 个条件,除了结点 x_j 及其子树外至少有 y_j 个结点,求把最少要染成黑色结点的数目使得满足 A + B 个条件. 题解:参考自:https://blog.csdn.net/u013534123/article/details/78523559 #incl…
下图列出了Python支持的正则表达式元字符和语法: 字符点:匹配任意一个字符 import re st = 'python' result = re.findall('p.t',st) print(result) 字符^:匹配以什么开头 import re st = 'python' result = re.findall('^py',st) print(result) 字符$:匹配以什么结尾 import re st = 'python' result = re.findall('n$',s…