- 博客(65)
- 收藏
- 关注
原创 hdu6351 多校第5场 Beautiful Now
将当前位与后面最小值交换为最优,但可能最小值有多个,比如 2311 交换两次 最小值为 1123 ,那么交换哪一个呢,我们dfs遍历一下所有最小值,然后求一个min,如果当前位是最小值,那么就不交换,由于最多交换9次所以复杂度不高。 求最大值同理 注意首位不能为0,所以将首位单独拿出来算一下 转载请注明出处: https://blog.youkuaiyun.com/qq_25973789/art...
2018-08-06 14:44:02
970
原创 CICD流程语法树分析代码差异执行相关测试用例
首先通过git diff分析代码差异,然后对代码建立语法树,然后执行相关测试用例。python代码可以用ast进行语法树分析。上述代码可以找到变更代码的函数名和文件名。如果测试用例都通过可以更新代码。
2024-02-27 11:18:49
331
原创 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
290
原创 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
287
原创 使用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
1835
原创 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
417
1
原创 半平面交 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
308
1
原创 hdu 6370 多校第6场 Werewolf (dfs)
Werewolf Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 940 Accepted Submission(s): 254 Problem Description "The Werewolves" is a popu...
2018-08-09 10:58:05
243
原创 hdu6373 多校第6场 Pinball
Problem Description There 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
367
原创 python 爬取视频 学习
代码中使用的BeautifulSoup 的select,也可使用 find和find_all re.findall中req为正则表达式 urllib.request.urlretrieve()#将视频复制入文件中 import requests import re import urllib.request from bs4 import BeautifulSoup header...
2018-08-05 16:02:34
2631
转载 python 爬虫爬取图片 BeautifulSoup
转载地址 #coding=utf-8 import requests from bs4 import BeautifulSoup import os from multiprocessing import Pool # http请求头 Hostreferer = { 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows N...
2018-08-04 20:53:28
626
转载 python 爬虫爬取小说 单进程与多进程 学习
转载地址 1 单进程: # -*- coding:UTF-8 -*- from bs4 import BeautifulSoup import requests, sys """ 类说明:下载《笔趣看》网小说《一念永恒》 """ class downloader(object): def __init__(self): self.server = 'http:...
2018-08-03 15:27:50
712
原创 python 爬虫抓取图片 学习
from tkinter import * from tkinter import messagebox import requests from PIL import ImageTk,Image def down(): st = 'http://www.uustv.com/' name=entry.get() name=name.strip() if name...
2018-08-02 20:47:09
517
原创 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
250
原创 python学习 库安装 打包exe文件
1 python库安装方法 1.Win + R 打开运行窗口,输入cmd回车 2.找到pip安装路径——x:\Python xx\Scripts 3. 在命令行中切换至该目录cd x:\Python xx\Scripts 4.输入 pip install ***(库名称) 2 使用pycharm安装python库 和查看在虚拟环境中是否按装了相应的库的扩展:File->Settin...
2018-08-01 10:39:24
451
原创 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
181
原创 洛谷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
368
原创 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
206
1
原创 bzoj - 2002 Bounce 弹飞绵羊 LCT
题目 LCT解释 //#include &amp;lt;bits/stdc++.h&amp;gt; #include&amp;lt;stdio.h&amp;gt; #include&amp;lt;string.h&amp;gt; #include&amp;lt;string&amp;gt; #include&amp;lt;math.h&amp;g
2018-07-24 18:11:15
274
原创 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
376
原创 C语言走迷宫小游戏
#include &lt;bits/stdc++.h&gt; #include &lt;conio.h&gt; #include &lt;windows.h&gt; #include &lt;time.h&gt; #define height 20 #define width 20 //cout.setf(ios::fixed); //freopen("out.t
2018-07-23 11:22:40
2050
原创 C语言最简单贪吃蛇小游戏
#include &lt;stdio.h&gt; #include &lt;windows.h&gt; #include &lt;time.h&gt; #include &lt;conio.h&gt; #define height 20 #define width 40 int i,j,k; char ch='w'; int grow=0; struct Food {
2018-07-22 18:16:37
639
原创 UVA - 10305 拓扑排序
题目地址 //#include <bits/stdc++.h> #include<stdio.h> #include<string.h> #include<string> #include<math.h> #include<algorithm> #include<iostream> #include<
2018-07-22 11:04:34
226
原创 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
219
原创 落谷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
185
原创 【线段树+扫描线】&矩形覆盖求面积/周长问题(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
545
原创 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
847
原创 poj 2954 pick公式
poj 2954 S=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
190
原创 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
243
原创 求三角形外接圆 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
315
原创 hdu 1007 平面最近点对
hdu 1007 详细解释 #include&lt;bits/stdc++.h&gt; #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&lt;=(y);i++) #define fdn...
2018-04-19 20:25:22
174
原创 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
357
原创 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
394
原创 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
168
原创 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
221
原创 manacher 最长回文子串 hdu3068
hdu 3068 Manacher 算法 (马拉车) 空间复杂度:插入分隔符形成新串,占用了线性的空间大小;RL数组也占用线性大小的空间 ,因此空间复杂度是线性的。 时间复杂度:尽管代码里面有两层循环,通过amortized analysis我们可以得出 ,Manacher的时间复杂度是线性的。由于内层的循环只对尚未匹配的部分进行, 因此对于每一个字符而言,只会进行一次,因此时间复...
2018-03-24 22:04:35
196
原创 牛客网广工大 因子个数 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
254
原创 牛客网广工大 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
161
原创 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]&amp;lt;=deep[b],所以我们的目的是把b向上 移动i=(...
2018-03-24 12:25:42
282
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅