自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 是男人就过 8 题--Pony.AI 题A String Game(博弈 SG 后缀自动机)

将每个单轮的SG函数抑或可得最终结果。为了计算SG函数,先对主串用后缀自动机处理,对输入的每个子串,先在自动机上走到对应串的节点,然后枚举后续状态,这些状态即为SG函数对应的后继状态,求SG函数,并将结果保存,否则会超时。//http://www.cnblogs.com/IMGavin///https://nanti.jisuanke.com/t/24852#i...

2018-08-11 12:07:00 182

转载 hihocoder 1475数组分拆

#1475 : 数组分拆时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Ho得到了一个数组作为他的新年礼物,他非常喜欢这个数组!在仔细研究了几天之后,小Ho成功的将这个数组拆成了若干段,并且每段的和都不为0!现在小Ho希望知道,这样的拆分方法一共有多少种?两种拆分方法被视作不同,当且仅当数组断开的所有位置...

2017-04-17 21:18:00 143

转载 hihocoder [Offer收割]编程练习赛8 矩形计数

考虑k比较小,想到容斥原理,枚举,容斥求和。//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#i...

2017-03-05 16:11:00 133

转载 hihocoder8 [Offer收割]编程练习赛8 拆字游戏

bfs//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>...

2017-03-05 16:08:00 163

转载 hihocoder8 [Offer收割]编程练习赛8 小Ho的强迫症

数学题,找循环节,枚举//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <...

2017-03-05 16:07:00 117

转载 骑士共存问题(二分图最大独立集)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-18 12:08:00 125

转载 最长k可重区间集问题(费用流)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-18 11:09:00 96

转载 深海机器人问题(费用流)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-17 22:48:00 92

转载 运输问题(费用流)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-17 20:33:00 221

转载 负载平衡问题(费用流)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-17 20:32:00 83

转载 Linux 使用create_ap开热点后无法连接wifi问题的解决

使用create_ap开启热点,关闭后,无法连接wifi.使用sudo rfkill list all发现wifi没有被锁住,使用sudo service network-manager start也无法解决问题后来使用create_ap -h查看此软件的相关帮助,其中有--fix-unmanaged If NetworkManager shows your interfa...

2017-02-17 19:46:00 801

转载 汽车加油行驶问题(最短路)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-12 23:14:00 239

转载 孤岛营救问题(最短路 状态压缩)  网络流24题

状态压缩,最短路//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vec...

2017-02-12 21:40:00 96

转载 软件补丁问题(状态压缩 最短路)

先状态压缩,再求费用流,但耗内存太大,改变存边方式降低内存使用。直接求最短路即可//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#inclu...

2017-02-12 16:43:00 98

转载 餐巾计划问题(费用流)

拆点,建二分图,Xi表示第i天用完的餐巾,Yi表示第i天需要的餐巾,求费用流。//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include ...

2017-02-11 23:19:00 83

转载 分配问题(二部图的最佳匹配 KM) 线性规划与网络流24题

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-10 22:24:00 275

转载 数字梯形问题(费用流)

费用流,拆点//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vecto...

2017-02-10 22:00:00 111

转载 星际转移问题(最大流 枚举)

使用并查集判断有无解,若有解枚举天数若最大流等于人数则可行。//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue...

2017-02-10 17:46:00 126

转载 方格取数问题(二分图点权最大独立集)

//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstdlib>#include <cstring>#include <queue>#include <vector>#inc...

2017-02-10 12:01:00 107

转载 最长递增子序列问题(费用流)

http://acm.nefu.edu.cn/JudgeOnline/problemShow.php?problem_id=487费用流,每次沿着最长边增广//http://www.cnblogs.com/IMGavin/#include <iostream>#include <stdio.h>#include <cstd...

2017-02-06 18:07:00 108

转载 Linux 下开wifi热点

跑坑无数,终于使用create_ap开启wifi热点。可以使用github上托管的项目,地址https://github.com/oblique/create_ap/安装如https://github.com/oblique/create_ap/教程所示,安装后使用命令sudocreate_ap wlan0 lowifiname password其中wlan0 为无线网卡...

2017-01-22 18:24:00 203

转载 Linux 开机自动执行程序

在/etc/rc.local中添加命令,开机时以root权限运行在~/.profile中添加命令,开机时以登陆用户权限运行转载于:https://www.cnblogs.com/IMGavin/p/6341068.html

2017-01-22 18:13:00 113

转载 1736 飞行员配对方案问题(二分图)

//https://www.oj.swust.edu.cn/problem/show/1736//ID:Gavin#include<cstdio>#include<iostream>#include<cstdlib>#include<cstring>#include<string>#include...

2017-01-22 18:02:00 141

转载 UVALive4998 Simple Encryption(数论 同余)

题意:给出K1,求一个12位数(不含前导0)K2,使得K1^K2 mod (10^12) = K2思路:借鉴他人思路,任取一个K2,若K1^K2 mod (10^12) != K2,则令K2 =K1^K2 mod (10^12) ,效率较高,但具体原因不知,若了解原因请指教//http://www.cnblogs.com/IMGavin/#include &l...

2017-01-21 15:54:00 48

转载 hihocoder1455 Rikka with Tree III(bitset 莫队 dfs序)

//http://www.cnblogs.com/IMGavin///http://hihocoder.com/problemset/problem/1455//https://media.hihocoder.com/contests/challenge25/solution.pdf//bitset 莫队 dfs序/*in1[]表示当前处理的子树的bitset...

2017-01-12 19:50:00 123

转载 Linux deepin 下sublimes配置g++ openGL

参考 :http://blog.csdn.net/u010129448/article/details/47754623ubuntu 下gnome只要将代码中deepin-terminal改为gnome终端就行G++{ "shell_cmd": "g++ '${file}' -o '${file_path}/${file_base_nam...

2016-12-08 13:42:00 94

转载 UVA 10692 Huge Mods(指数循环节)

指数循环节,由于a ^x =a ^(x % m + phi(m)) (mod m)仅在x >= phi(m)时成立,故应注意要判断//by:Gavin http://www.cnblogs.com/IMGavin///指数循环节 递归处理#include<cstdio>#include<iostream>#include&lt...

2016-12-01 23:19:00 115

转载 Codeforces #380 Subordinates(贪心 构造)

从前往后扫,找到一出现次数为0的数,从后面找一个出现不为0的数转化而来。设置两指针l, r来处理。#include<cstdio>#include<iostream>#include<cstdlib>#include<cstring>#include<string>#include<al...

2016-11-26 16:03:00 90

转载 HDU5988 Coding Contest(费用流)

2016青岛现场赛的一题,由于第一次走过不会产生影响,需要拆点,不过比赛时没想到,此外还有许多细节要注意,如要加eps,时间卡得较紧要注意细节优化等#include <iostream>#include <cstring>#include <queue>#include <cstdio>#include &lt...

2016-11-24 23:13:00 79

转载 linux 下UGet闪退问题

安装UGet,开始使用正常,后来打开时会闪退,估计是软件配置错误,但软件重装也没用,用dpkg --purge也无法删除配置文件。后来想到是在下载eclipse时,将eclipse文件删除,导致软件启动时无法访问文件,所以程序崩溃,所以将配置文件删除应该就OK后来使用sudo grep -rn "eclipse-inst-linux64" *来搜索包含eclipse-...

2016-11-20 15:42:00 214

转载 2016年区域赛结束总结

今年最后一场区域赛结束了, 这一年,打了3场区域赛,只拿到了铜牌,大一当初说好的要夺金呢?沈阳那场,AC自动机加高斯消元最后没调出来,青岛那场,费用流没调出来,最终没有实现从铜到银的蜕变。这几次比赛, 也暴露出很多问题,虽然学了那么多算法,理解的却不够深,导致比赛时只能理论AC,但就是写不出来。接下来这段时间算法学习不能放松,同时还要学习开发。先定下一下学习方案,要...

2016-11-19 10:53:00 146

转载 使用dd命令备份Linux分区

为了备份分区,开始使用的是Remastersys,但最终生成的iso文件仅有几十K,应该是软件bug,且此软件不再更新,后尝试使用Linux Respin,但github一直连接不上。其实可以尝试使用dd命令,使用的命令如下:sudo dd if=/dev/sda1 of=/media/gavin/d/file/deepin.imgif=后面接的是原地址,Linu...

2016-11-17 17:04:00 309

转载 1250 Super Fast Fourier Transform(湘潭邀请赛 暴力 思维)

湘潭邀请赛的一题,名字叫"超级FFT"最终暴力就行,还是思维不够灵活,要吸取教训。由于每组数据总量只有1e5这个级别,和不超过1e6,故先预处理再暴力即可。#include<cstdio>#include<iostream>#include<cstdlib>#include<cstring>#incl...

2016-11-06 20:14:00 145

转载 UVA 11768 Lattice Point or Not(扩展欧几里德)

将直线转化为ax + by = c的形式,然后扩展欧几里得求在[x1, x2]之间的解对直线与坐标轴平行的特判调试了好长时间,注意:1 正负数转化为整型的处理2 注意判断有无解#include<cstdio>#include<iostream>#include<cstdlib>#include<cs...

2016-11-06 17:02:00 109

转载 HDU5887 Herbs Gathering(2016青岛网络赛 搜索 剪枝)

背包问题,由于数据大不容易dp,改为剪枝,先按性价比排序,若剩下的背包空间都以最高性价比选时不会比已找到的最优解更好时则剪枝,即 if(val + (LD)pk[d].val / (LD)pk[d].w * (lim - w) + EPS <= ans){   return; }没想到一发过,0ms#include<cstdio>...

2016-11-05 22:08:00 110

转载 HDU5880 Family View(2016青岛网络赛 AC自动机)

题意:将匹配的串用‘*’代替tips:1注意内存的使用,据说g++中指针占8字节,c++4字节,所以用g++交会MLE2 注意这种例子,12abcdbcabc故失败指针要一直往下走,否则会丢弃一些串3 当出现非英文字符时应先将指针指向根节点,否则出现11cyc,,,,,,,y时结果为c,,,,,,**(由不止一种Bug造成的),正确的应为c,...

2016-11-05 20:49:00 144

转载 UVA 11645 Bits(组合数学)

从左往右处理,左半部分记为left, 右半部分记为right,若i,i -1均为1, 贡献为ans += (left + 1) + right * (1ll << (i - 1));否则贡献为ans += right * (1ll << (i - 1));import java.math.BigInteger;import java.util...

2016-11-02 18:34:00 107

转载 UVA 11481 Arrange the Numbers(组合数学 错位排序)

题意:长度为n的序列,前m位恰好k位正确排序,求方法数前m位选k个数正确排,为cm[m][k],剩余m - k个空位,要错排,这m - k个数可能是前m个数中剩下的,也可能来自后面的n - m个数考虑这样一个问题,共n个数,前i位错排的方法数,显然dp[i][0] = i!递推考虑:处理到第i个数时,等价于前i - 1个数错排的方法数减去在前i - 1个数错排的情况下第...

2016-11-01 22:23:00 119

转载 UVA 10780 Again Prime No Time.(数学)

给定两个整数m和n,求最大的k使得m^k是n!的约数对m质因子分解,然后使用勒让德定理求得n!包含的质数p的阶数,min(b[i] / a[i])即为结果k, 若为0无解#include<cstdio>#include<iostream>#include<cstdlib>#include<cstring>...

2016-10-19 16:53:00 101

转载 UVALive5031 Graph and Queries(Treap)

反向操作,先求出最终状态,再反向操作。然后就是Treap 的合并,求第K大值。#include<cstdio>#include<iostream>#include<cstdlib>#include<cstring>#include<string>#include<algorithm&g...

2016-10-17 13:20:00 107

空空如也

空空如也

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

TA关注的人

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