自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(65)
  • 收藏
  • 关注

原创 hdu6351 多校第5场 Beautiful Now

将当前位与后面最小值交换为最优,但可能最小值有多个,比如 2311 交换两次 最小值为  1123 ,那么交换哪一个呢,我们dfs遍历一下所有最小值,然后求一个min,如果当前位是最小值,那么就不交换,由于最多交换9次所以复杂度不高。 求最大值同理注意首位不能为0,所以将首位单独拿出来算一下 转载请注明出处:  https://blog.csdn.net/qq_25973789/art...

2018-08-06 14:44:02 868

原创 CICD流程语法树分析代码差异执行相关测试用例

首先通过git diff分析代码差异,然后对代码建立语法树,然后执行相关测试用例。python代码可以用ast进行语法树分析。上述代码可以找到变更代码的函数名和文件名。如果测试用例都通过可以更新代码。

2024-02-27 11:18:49 117

原创 前端vue后端go实现大文件分片下载

先获取文件大小,然后将文件切片传输给前端,前端再按顺序组合所有切片。

2024-02-27 11:01:41 586 1

原创 1

class SQLite3Manager: NSObject{ let DBFILE_NAME = "sqlitedemo.db" private var db: OpaquePointer? = nil func create_database() { // 数据库路径 let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)...

2020-06-19 17:11:00 183

原创 Linux

VI的使用:1)首先使用VI,输入如下的文件内容,存盘为1-1.txt: Bill Jones, HI-TEK Corporation , CA, 95011 Sharon Lee Smith, Design Works Incorporated, CA, 95012 B. Amos , Hill Street Cafe, CA, 95013 ...

2019-05-14 19:49:21 195

原创 使用C语言在Win控制台中输出带颜色的文字

#include <conio.h>#include <stdio.h>#include <windows.h>int main(int argc, char *argv[]){ HANDLE hOut; hOut = GetStdHandle(STD_OUTPUT_HANDLE); int i; for (i = 1...

2018-10-11 11:29:39 1715 1

原创 bitset 巧妙用法 hdu5972

题目链接bitset用法整理#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include<queue>#include&

2018-09-29 14:51:51 255 3

原创 半平面交 poj 2451

poj 2451 #pragma GCC optimize(2)#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include<queu...

2018-08-10 10:30:34 210 1

原创 hdu 6370 多校第6场 Werewolf (dfs)

WerewolfTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 940    Accepted Submission(s): 254Problem Description"The Werewolves" is a popu...

2018-08-09 10:58:05 156

原创 hdu6373 多校第6场 Pinball

Problem DescriptionThere is a slope on the 2D plane. The lowest point of the slope is at the origin. There is a small ball falling down above the slope. Your task is to find how many times the ball ...

2018-08-08 17:04:22 271

原创 python 爬取视频 学习

代码中使用的BeautifulSoup 的select,也可使用 find和find_allre.findall中req为正则表达式 urllib.request.urlretrieve()#将视频复制入文件中import requestsimport reimport urllib.requestfrom bs4 import BeautifulSoupheader...

2018-08-05 16:02:34 2459

转载 python 爬虫爬取图片 BeautifulSoup

转载地址#coding=utf-8import requestsfrom bs4 import BeautifulSoupimport osfrom multiprocessing import Pool# http请求头Hostreferer = { 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows N...

2018-08-04 20:53:28 517

转载 python 爬虫爬取小说 单进程与多进程 学习

转载地址1 单进程:# -*- coding:UTF-8 -*-from bs4 import BeautifulSoupimport requests, sys"""类说明:下载《笔趣看》网小说《一念永恒》"""class downloader(object): def __init__(self): self.server = 'http:...

2018-08-03 15:27:50 576 3

原创 python 爬虫抓取图片 学习

from tkinter import *from tkinter import messageboximport requestsfrom PIL import ImageTk,Imagedef down(): st = 'http://www.uustv.com/' name=entry.get() name=name.strip() if name...

2018-08-02 20:47:09 426

原创 hdu6336 多校第四场E题 Matrix from Arrays

首先打表找出规律,它是以边长为2*n的正方形为一个周期向下和后扩散的,所以将周期的下标存到二维数组中,然后对于每个询问,求出完整周期有多少个,然后不完整的单独算即可。solve函数求的是(0,0)到(x,y)的和.所以结果就是:solve(x2,y2)-solve(x2,y1-1)-solve(x1-1,y2)+solve(x1-1,y1-1); #pragma GCC opti...

2018-08-01 16:42:11 167

原创 python学习 库安装 打包exe文件

1 python库安装方法1.Win + R 打开运行窗口,输入cmd回车2.找到pip安装路径——x:\Python xx\Scripts3. 在命令行中切换至该目录cd x:\Python xx\Scripts4.输入 pip install ***(库名称)2 使用pycharm安装python库 和查看在虚拟环境中是否按装了相应的库的扩展:File->Settin...

2018-08-01 10:39:24 333

原创 hdu 6319 多校第三场 Ascending Rating

题目链接从后往前维护最大值的单调队列,所以单调队列中的元素从走到右递增,且左边没比他大的元素在队列中,所以队列中元素个数就是count的个数。注意q*i爆int,wa了我好久。//#include <bits/stdc++.h>#pragma GCC optimize(2)#include<stdio.h>#include<string.h>...

2018-07-31 10:08:50 116

原创 洛谷P3690 【模板】Link Cut Tree (动态树)

洛谷P3690 【模板】Link Cut Tree (动态树)不开o2优化就要TLE,不知道为啥。//#include <bits/stdc++.h>#pragma GCC optimize(2)#include<stdio.h>#include<string.h>#include<string>#include<math....

2018-07-27 15:51:43 262 1

原创 bzoj 3669 魔法森林 LCT

题目地址 //#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include&am

2018-07-26 20:35:13 140 1

原创 bzoj - 2002 Bounce 弹飞绵羊 LCT

题目LCT解释//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h&g

2018-07-24 18:11:15 174

原创 hdu 6304 多校第一场 Chiaki Sequence Revisited

//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include<queue

2018-07-24 10:35:30 296

原创 C语言走迷宫小游戏

#include <bits/stdc++.h>#include <conio.h>#include <windows.h>#include <time.h>#define height 20#define width 20//cout.setf(ios::fixed);//freopen("out.t

2018-07-23 11:22:40 1918

原创 C语言最简单贪吃蛇小游戏

#include <stdio.h>#include <windows.h>#include <time.h>#include <conio.h>#define height 20#define width 40int i,j,k;char ch='w';int grow=0;struct Food{

2018-07-22 18:16:37 540

原创 UVA - 10305 拓扑排序

题目地址//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include&lt

2018-07-22 11:04:34 133

原创 POJ 2763 树链剖分 或LCA加树状数组

地址树链剖分//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include&

2018-07-17 14:33:22 137

原创 落谷P3384树链剖分

题目地址详解#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include<queue>#include<vector

2018-07-17 11:18:45 116

原创 【线段树+扫描线】&矩形覆盖求面积/周长问题(POJ - 1151 /HDU 1828)

poj 1151#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include<queue>#include<vector

2018-07-13 16:07:31 447

原创 poj 3487 稳定婚姻问题

poj 3487详细解释请点击//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>

2018-04-20 21:02:21 700

原创 poj 2954 pick公式

poj 2954S=a+b/2-1#include <cstdio>#include <cstdlib>#define inf 0x7fffffff#define linf 0x7fffffffffffffff#define fil(x,y) memset(x,y,sizeof(x))#define fup(i,x,y) for(int i=(x);i&...

2018-04-20 19:05:11 116

原创 hdu 1798 求相交圆面积

hdu 1798 详细解释 坑点:计算三角形面积不能用d求,会wa,不知道为什么#include<bits/stdc++.h>#define inf 0x7fffffff#define linf 0x7fffffffffffffff#define fil(x,y) memset(x,y,sizeof(x))#define fup(i,x,y) for(int i=(x...

2018-04-20 18:34:54 165

原创 求三角形外接圆 hdu4720

hdu4720详细解释坑点:如果为钝角三角形,不求外接圆,圆心直接在最大边中点,面积才为最小#include<bits/stdc++.h>#define inf 0x7fffffff#define linf 0x7fffffffffffffff#define fil(x,y) memset(x,y,sizeof(x))#define fup(i,x,y) for(...

2018-04-19 22:09:24 211

原创 hdu 1007 平面最近点对

hdu 1007详细解释#include<bits/stdc++.h>#define inf 0x7fffffff#define linf 0x7fffffffffffffff#define fil(x,y) memset(x,y,sizeof(x))#define fup(i,x,y) for(int i=(x);i<=(y);i++)#define fdn...

2018-04-19 20:25:22 108

原创 ac自动机 hud2222

hdu2222详细解释 请见 解释#include<bits/stdc++.h>#define inf 0x7fffffff#define linf 0x7fffffffffffffff#define mem(a,b) memset(a,b,sizeof(a))#define fup(i,x,y) for(int i=(x);i<=(y);i++)#defin...

2018-04-19 00:33:33 265

原创 hdu 2594 KMP或者扩展KMP

hdu2594扩展KMP详细解释见 链接方法一:KMP//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<...

2018-04-17 22:03:38 289 2

原创 KMP hdu1686

hdu1686 详细解释参见博客//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>

2018-04-17 19:33:29 103

原创 cogs1570 KMP hash

cogs1570 【输入格式】输入包含多组数据。输入文件的第一行有一个整数,代表数据组数。接下来是这些数据,以如下格式给出:第一行是单词W,一个由{‘A’,’B’,’C’,…,’Z’}中字母组成的字符串,保证1<=|W|<=10000(|W|代表字符串W的长度)第二行是文章T,一个由{‘A’,’B’,’C’,…,’Z’}中字母组成的字符串,保证|W|<=|T|&...

2018-04-14 17:16:03 144

原创 manacher 最长回文子串 hdu3068

hdu 3068Manacher 算法 (马拉车)空间复杂度:插入分隔符形成新串,占用了线性的空间大小;RL数组也占用线性大小的空间 ,因此空间复杂度是线性的。 时间复杂度:尽管代码里面有两层循环,通过amortized analysis我们可以得出 ,Manacher的时间复杂度是线性的。由于内层的循环只对尚未匹配的部分进行, 因此对于每一个字符而言,只会进行一次,因此时间复...

2018-03-24 22:04:35 130

原创 牛客网广工大 因子个数 L题加F题

牛客网广工大 因子个数 L题 F题L题//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream...

2018-03-24 20:52:04 170

原创 牛客网广工大 DP 最长回文子串 D题

牛客网//#include <bits/stdc++.h>#include<stdio.h>#include<string.h>#include<string>#include<math.h>#include<algorithm>#include<iostream>#include<

2018-03-24 20:25:58 110

原创 LCA hdu2586

hdu 2586 dp[x][i]表示节点i往上走2^j次所到达的祖先,那么不难写出转移方程: dp[x][i]=dp[dp[x][i-1]][i-1]; 然后在求LCA的时候,有这样一个性质:(假设a和b深度一样) 于是求法就渐渐的现行了: 1. 把a和b移到同一深度(设deep[x]为节点x的深度),假设deep[a]<=deep[b],所以我们的目的是把b向上 移动i=(...

2018-03-24 12:25:42 187 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除