- 博客(365)
- 收藏
- 关注
原创 线段树专训
线段树专训 训练时间:长期 author:wlxsqProblem List BZOJ1798: 维护序列 Problem link URAL1147: Shaping Regions Problem link POJ3277: City Horizon Problem link Vijos1183: Fish && kitty Problem link
2019-01-02 13:59:57 400
原创 20181220第二周周训思路整理
第二周题解 训练时间:2018/12/20-2018/12/27Problem List BZOJ5027:数学题Click me扩展欧几里得算法完成时间:[ ]
2018-12-29 14:59:59 1105
原创 20181221第二周周训题
第二周题单 训练时间:2018/12/21-2018/12/28 author:wlxsqProblem List BZOJ5027:数学题Click me BZOJ1977:次小生成树Click me HDU1536:S-NimClick me BZOJ4919:大根堆 Click me HDU1251:统计难题Click me CF558E:A Simple TaskCli...
2018-12-21 19:35:29 411
原创 20181214第一周周训思路整理
20181213-20181220第一周题解 BZOJ4300:绝世好题 链接很明显,动归题。由于bi只与bi-1有关系,所以dp[i]表示以数字i结尾的最长长度。这样只能够在O(n^2)的时间复杂度内完成。显然这是不符合要求的。那怎么做呢?这里思维难度比较大。状态压缩因为是做位运算,而且是做相邻两个数的位运算。所以用dp[i]表示对应的二进制位上的i出现的最长长度。所以对于...
2018-12-14 20:09:47 328 3
原创 20181214第一周周训
20181213第一周题单题目列表 BZOJ4300: 绝世好题 链接 Bailian1308: Is It A Tree? 链接 HDU2594: Simpsons’ Hidden Talents链接 POJ1511:Invitation Cards 链接 POJ1751:Highways链接 HDU2089:不要62链接...
2018-12-14 20:05:09 247
原创 爬取网页中的链接
获取网页内容1、引入库import urllibimport urllib.request2、获取网页内的所有数据data = urllib.request.urlopen(“http://www.baidu.com").read()3、将数据转换成UTF-8编码data = data.decode(‘UTF-8’)4、查看网页上获取的数据print(data)对网页内容进行筛...
2018-11-24 23:13:34 4372
原创 linux命令整理汇总【整理中。。。】
1、增a、拷贝目录 sudo cp -r 要拷贝的文件名 目标路径b、递归拷贝目录: sudo cp -r 要拷贝的文件名 目标路径c、创建多级目录 sudo mkdir -p /firstLevel/secondLevel/thirdLevel2、删a、删除目录 sudo rmdir 目录名 sudo rm 目录名b、递归删除目录 sudo rm -rf 目录名c、删...
2018-11-22 21:19:59 225
原创 Vue项目环境搭建及git仓库新建
1、 安装node.js链接:https://nodejs.org/en/download/直接傻瓜式安装即可。 安装完成后,在命令行运行node–v和npm –v均可以查看版本号2、 安装vue打开命令行,运行npm install vue即可。 3、 安装vue脚手架运行命令 npm install –g vue-cli Vue–version 查看版本...
2018-05-14 10:41:46 3958
原创 数据库之规范使用
一、【操作规范】1. 如无备注,则表中的第一个id字段一定是主键且为自动增长;2. 如无备注,则数值类型的字段请使用UNSIGNED属性;3. 如无备注,排序字段order_id在程序中默认使用降序排列;4. 如无备注,所有字段都设置NOT NULL,并设置默认值;5. 如无备注,所有的布尔值字段,如is_hot、is_deleted,都必须设置一个默认值,并设为0;6. 所有的数字类型字段,都必...
2018-05-13 13:43:34 286
原创 ubantu服务器配置
更新源 命令:sudo apt-get update搭建LAMP1、安装Apache 命令:sudo apt-get install apache2 测试:浏览器访问http://Ubuntu的IP,出现It Works!网页。 查看状态:service apache2 status(start/stop/restart) Web目录:/var/www 安装目录...
2018-05-13 13:41:38 359
原创 配置虚拟域名简化URL路径
配置虚拟域名简化URL路径 1、让服务器认识你的域名 在服务器文件D:\xampp\apache\conf\extra\httpd-vhosts.conf 添加如下代码 <VirtualHost*:80> DocumentRoot"D:\xa...
2018-05-13 13:38:58 1294
原创 【矩阵快速幂】HDU1575Tr A【模板】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1575题目描述:Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2
2017-12-25 18:00:49 279
原创 【洛谷】P1164 小A点菜【动规】
题目链接:https://www.luogu.org/problemnew/show/P1164题目:题目背景uim神犇拿到了uoi的ra(镭牌)后,立刻拉着基友小A到了一家……餐馆,很低端的那种。uim指着墙上的价目表(太低级了没有菜单),说:“随便点”。题目描述不过uim由于买了一些辅(e)辅(ro)书,口袋里只剩M元(M餐馆
2017-12-17 13:43:23 253
原创 【洛谷】P1060 开心的金明【动规】
链接:题目题目描述金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”。今天一早金明就开始做预算,但是他想买的东西太多了,肯定会超过妈妈限定的N元。于是,他把每件物品规定了一个重要度,分为5等:用整数1~5表示,第5等最重要。他还从
2017-12-17 13:41:06 275
原创 【洛谷】P1067 多项式输出【模拟】
https://www.luogu.org/problemnew/show/1067题目:题目描述一元 n 次多项式可用如下的表达式表示:其中,aixi称为 i 次项,ai 称为 i 次项的系数。给出一个一元多项式各项的次数和系数,请按照如下规定的格式要求输出该多项式:1. 多项式中自变量为 x,从左到右按照次数递减顺序给出多项式。
2017-12-17 13:25:44 563
原创 【模拟】HDU4147KFC -Z+W
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4147#include#define INF 1<<29;using namespace std;int main(){ int n,b,d,f,F; string s; cin.sync_with_stdio(false); while(cin>>n>>b>>d>>f>>F){
2017-09-15 22:30:35 651
原创 【思维】HDU4104Discount【最小子集和】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4104#includeusing namespace std;const int N=1005;int a[N];int main(){ int n; while(cin>>n){ int sum=0; for(int i=0;i<n;i++) cin>>a[i];
2017-09-15 22:14:17 426
原创 【模拟】HDU1035Robot Motion
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1035#includeusing namespace std;const int N=1005;string s[N]; // 整行读入;int vis[N][N]; // 标记该位置是否走过,且记录是第几步走过int n,m,k;int check(int x,int y){
2017-09-13 11:16:43 279
原创 【结构体排序】HDU1234开门人和关门人
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1234#includeusing namespace std;const int N=10005;typedef struct time{ int h,m,s;}Node;struct node{ string s; Node in; Node out;}stu[N];bool
2017-09-12 16:36:54 333
原创 【枚举】HDU1164Eddy's research I
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1164#includeusing namespace std;const int N=100005;int isPrim[N];int vis[N];void getprime(){ int cnt=0; for(int i=2;i<65536;i++){ if(vis[i]==
2017-09-12 15:30:06 213
原创 【水题】HDU1017A Mathematical Curiosity
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1017#includeusing namespace std;int solve(int n,int m){ int cnt=0; for(int i=1;i<n-1;i++){ for(int j=i+1;j<n;j++){ if((i*i+j*j+m)%(i*j)==0)
2017-09-07 14:38:29 271
原创 【动态规划】HDU1422重温世界杯【最大子段和变形】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1422#include#define LL long longusing namespace std;const int N=500005;LL a[N];int main(){ LL n,x,y; cin.sync_with_stdio(false); whil
2017-09-07 00:03:59 451
原创 【分治】HDU1506Largest Rectangle in a Histogram
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1506#include#define LL long longusing namespace std;const int N=100005;LL a[N];LL solve(LL l,LL r){ if(l==r) return a[l]; LL mid=(l+r)/2;
2017-09-06 23:34:36 224
原创 【字符串】HDU1088Write a simple HTML Browser
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1088#includeusing namespace std;int main(){// freopen("test.txt","r",stdin); string s; string ans=""; int len=0; while(cin>>s){
2017-09-06 22:57:52 273
原创 【map/STL】HDU1029Ignatius and the Princess IV
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1029#includeusing namespace std;int main(){ int n; cin.sync_with_stdio(false); while(cin>>n){ mapMap; int cnt=(n+1)/2;
2017-09-06 21:49:44 276
原创 【栈】HDU1022Train Problem I
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022#includeusing namespace std;const int N=1050;int a[N],b[N],c[N];string s1,s2;int main(){ int n; while(cin>>n>>s1>>s2){ stacks
2017-09-06 21:22:33 230
原创 【结构体排序】HDU1084 What Is Your Grade?
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1084#includeusing namespace std;const int N=1050;struct node{ int n,h,m,s; int id;}stu[N];bool cmp(node a,node b){ if(a.n!=b.n) retur
2017-09-06 20:43:11 334
原创 【动态规划】HDU1081To The Max
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1081/* 将维度合成一列*/#includeusing namespace std;const int N=1050;int dp[N][N]; // dp[i][j]表示从dp[1][j]~dp[i][j]的和int a[N][N];int t[N];int ss,
2017-09-06 17:32:37 316
原创 【动态规划】HDU1559最大子矩阵
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1559/* 指定大小的最大子矩阵和 遍历每一个指定大小的矩阵*/#includeusing namespace std;const int N=1050;const int M=1050;int dp[N][M]={0}; // 从1,1到i,j的矩阵和int m
2017-09-06 16:17:29 327
原创 【动态规划】HDU1244Max Sum Plus Plus Plus
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1244这个题目要注意,n个数都是正整数。注意如果多一个段,状态怎么转移#includeusing namespace std;const int N=1050;const int INF=1<<29;int a[N],b[N],sum[N];int dp[N][N];void ini
2017-08-31 14:56:44 430
原创 【贪心/01背包】HDU1735字数统计
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1735#includeusing namespace std;const int N=10050;const int M=25;const int L=105;int a[N][L];int dp[M];int n,m,l;int ans=0;void init(){ a
2017-08-27 15:14:58 260
原创 【枚举】HDU5104Primes Problem【BestCoder Round #18】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5104#includeusing namespace std;const int N=10005;int prime[N]={0};bool notPrime[N];int len=0;int dp[N*3]={0}; // 枚举p1+p2的和的方案数;void get_p
2017-08-17 02:06:10 428
原创 【计数】HDU5804Price List【BestCoder Round #86】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5804#includeusing namespace std;int main(){ int t,n,m; cin.sync_with_stdio(false); cin>>t; while(t--){ cin>>n>>m; st
2017-08-14 21:52:04 168
原创 【枚举计数】HDU5907Find Q【BestCoder Round #88】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5907#includeusing namespace std;int main(){ int t; string s; cin.sync_with_stdio(false); cin>>t; while(t--){ cin>>s;
2017-08-12 12:58:24 293
原创 【枚举】HDU5944Fxx and string【BestCoder Round #89】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5944#includeusing namespace std;int main(){ int t; string s; cin.sync_with_stdio(false); cin>>t; while(t--){ cin>>s;
2017-08-12 12:40:56 254
原创 【思维/DP】HDU6016Count the Sheep【BestCoder Round #92】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6016方法一(思维):四只羊,中间开始枚举;#includeusing namespace std;const int N=100005;int a[N],b[N],bb[N];int main(){ int t,n,m,k; cin.sync_with_stdio(f
2017-08-09 01:34:24 374
原创 【STL】HDU6019MG loves gold【 BestCoder Round #93】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6019这个题目听说有很有的AC姿势哦0.0由于一把铲子不能挖掘同种颜色的金克拉,我们只要线性扫描序列即可。按照贪心思想,若当前颜色种类的金克拉已经在挖掘范围内,我们只能迫不得已地换一把铲子,此时答案+1+1。同时我们需要O(nlogn)O(nlogn)的时间将所有颜色离散
2017-08-08 22:11:02 384
原创 【结构体排序】HDU6015Skip the Class【BestCoder Round #92】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6015#include#includeusing namespace std;const int N=1005;struct node{ string s; int v;}score[N];bool cmp(node a,node b){ if(a.s!=b.
2017-08-08 10:16:17 219
原创 【枚举计数】HDU5995Kblack loves flag【BestCoder Round #90】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5995#include#include#includeusing namespace std;// 获取随机位置const int _K=50268147,_B=6082187,_P=100000007;const int N=1000001;int _X;inline int
2017-08-07 14:30:26 257
原创 【水题】HDU4931Happy Three Friends【BestCoder Round #4】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4931#include#includeusing namespace std;int a[10];int main(){ int t; cin>>t; while(t--){ for(int i=0;i<6;i++){ cin
2017-08-07 13:49:27 535
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人