信息学奥赛一本通提高篇P2018[第一章例题1.1]活动安排描述设有n个活动的集合E={1,2,..,n},其中每个活动都要求使用同一资源,如演讲会场等,而在同一时间内只有一个活动能使用这一资源。每个活动i都有一个要求使用该资源的起始时间si和一个结束时间fi,且si
LOJ 一本通提高篇2.2KMP算法 例题+练习(坑)
xxxLJYing
lojKMP
复习时食用,会比较简略。推荐阅读的blogs:https://www.cnblogs.com/SYCstudio/p/7194315.htmlhttps://blog.csdn.net/v_july_v/article/details/7041827总是忘所以要多复习呀!模板最大:#10043.「一本通2.2例1」剪花布条目录#10043.「一本通2.2例1」剪花布条#10035.「一本通2.1练
LOJ 一本通提高篇2.3Trie字典树 例题+练习(坑)
xxxLJYing
loj字典树
复习时食用,会比较简略。原理就不讲了,还不会字典树的先下车吧。目录#10049.「一本通2.3例1」PhoneList#10050.「一本通2.3例2」TheXORLargestPair#10051.「一本通2.3例3」Nikitosh和异或#10052.「一本通2.3练习1」ImmediateDecodability#10053.「一本通2.3练习2」L语言#10054.「一本通2.3练习3」S
信息学奥赛一本通 提高篇 提高版 第六部分 数学基础 第1章 快速幂
mrcrack
信息学奥赛一本通提高篇提高版NOIP普及组复赛NOIP提高组复赛
信息学奥赛一本通提高篇提高版第六部分数学基础第1章快速幂#10193「一本通6.1例1」序列的第k个数//#10193.「一本通6.1例1」序列的第k个数//在线测评地址https://loj.ac/problem/10193//样例通过,提交AC。2018-9-2523:09#include#defineLLlonglong#definemod200907LLquickPow(LLb,LLn){
树状数组的理解(前缀和 and 差分)
weixin_30750335
二更——有神仙反映数星星那个题外链炸了,我决定把图给你们粘一下,汉语翻译的话在一本通提高篇的树状数组那一章里有,同时也修改了一些汉语语法的错误这段时间学了线段树组,当神仙们都在学kmp和hash的时候,我这个蒟蒻致远星了,,,,,所以在补完字符串算法之后我决定再补一补数据结构这篇总结主要就是给自己看的,所以树状数组的原理请移步这篇高赫奆佬的blogs这篇以例题为主首先是一道板子题P3374【模板】
LOJ 一本通提高篇4.1树状数组 例题+练习
xxxLJYing
洛谷树状数组
复习时食用,会比较简略。原理不讲,还不会的先下车。目录#130.树状数组1:单点修改,区间查询—>板子不讲。#10114.「一本通4.1例2」数星星Stars#10115.「一本通4.1例3」校门外的树#10116.「一本通4.1练习1」清点人数—>板子不讲。#10117.「一本通4.1练习2」简单题#133.二维树状数组1:单点修改,区间查询#10114.「一本通4.1例2」数星星Stars题目
浪在ACM(1009)钓鱼——信息学奥赛一本通提高篇
Dream-chasing ant
这道题刚开始一点没思路,看洛谷的题解才做出来的。题中给了一条很关键的信息,那就是不能走回头路,因为总时间是一定的,要么走路消耗,要么钓鱼消耗。我们假设知道最远到达的鱼塘,减去到达鱼塘的时间,那剩余的时间就全是钓鱼的时间了。所以剩下的我们只需要知道哪里最大,在哪里钓鱼就可以了。#include#include#includeusingnamespacestd;constintmaxn=27;stru
一本通提高篇之一句话系列
weixin_30660027
[通知]由于LL喜新厌旧另置新书,这篇博客目测,会无限咕下去大概会在十月及以后再次拿起[进度]20/34咿呀,还有14章了QwQ我太蒻了连一本通都没刷完是分块哒(^~^)例题解析请看书啦当然如果有些题我很欢喜,会吧代码存在博客里第一部分基础算法第1章贪心算法总结:贪心的习题大致与例题一个思路一般来说都是强行暴力,也不一定,反正实在没法,贪心一发注意数据的处理1.数列极差对于每次产生的新数放入序列中
LOJ 一本通提高篇5.1区间类动态规划 例题+练习
xxxLJYing
DPloj
是最讨厌的DP啊/哭/,但是总考不是/大哭/,我有什么办法/哭死了/。好吧,DP还好几种:区间、树形、数位..@$#%4*(我才没有骂人)切腹自尽。其实区间DP的用法还是比较单一的?(至少下面的题是?)我还不是一样做不出来。目录#10147.「一本通5.1例1」石子合并#10148.「一本通5.1例2」能量项链#10149.「一本通5.1例3」凸多边形的划分#10150.「一本通5.1练习1」括号
NOIP2019复习(学习)计划
weixin_30386713
距离NOIP2019还有3个月计划:找时间做补题解(暂时咕咕咕?)做完本世纪的noip提高原题主要学习方向(争取回校前ak)拓展网课普及:随便看看提高:$1/10$书(大致(再)看一遍)《一本通提高篇》《挑战程序设计竞赛》《入门经典》《习题与解答》《进阶指南》《训练指南》《数学一本通》《一本通高手训练》《算法导论》疯狂刷题cxb“2019”的题目补完akcxb(Challenge!!!)洛谷usa
【 贪心 进阶总结 】【 来自一本通提高篇 】
violin-wang
巧妙题贪心
#10000.「一本通1.1例1」活动安排求区间与区间的最大不覆盖数—套板子(区间右端点从小到大排序,选择不冲突的,尽可能的选)简记为线段覆盖问题#10001.「一本通1.1例2」种树求区间内最少单点满足覆盖要求,不管是各个区间需要一个点还是一个子区间(这个子区间是可连续、可不连续的)按照区间右端点从小到大排序,依次满足各个区间的要求,如此下来种的树(需要的点)最少。如果想不出贪心,线段树+优化亦
LOJ 一本通提高篇1.1贪心算法 练习
xxxLJYing
loj贪心
复习时食用,会比较简略。目录#10005.「一本通1.1练习1」数列极差#10006.「一本通1.1练习2」数列分段#10007.「一本通1.1练习3」线段#10008.「一本通1.1练习4」家庭作业#10009.「一本通1.1练习5」钓鱼#10010.「一本通1.1练习6」糖果传递#10005.「一本通1.1练习1」数列极差题目题目大意一个由n个正整数组成的数列,每次擦去其中的两个数a和b。然后
树状数组和lowbit的使用,见一本通提高篇209-210页
以为自己是猫的鱼
这两天搞懂了树状数组和lowbit,好玩,喵。题目是洛谷P3374三个要点:1、求lowbit2、对某个元素进行加法操作3、查询前缀和代码如下:#include#include#includeusingnamespacestd;constintMaxN=1e6+10;//表示定义整型常量,1e5+10即为105+10intc[MaxN];//c是树状数组,其中c[i]=a[i-2k+1]+…+a[
信息学奥赛一本通提高篇题解
!.
(感谢齐工大OJ提供测试环境)1.1贪心活动安排:区间贪心,对于区间,按照右端点升序排序,然后选择离前一个区间最近的不重合区间种树:对于区间,按照右端点升序排序,让树尽量种在靠右的地方,用数组标记状态喷水装置:1.2二分愤怒的牛:最小值最大,二分距离mid,对于mid,如果距离大于mid的牛舍大于等于牛的数量,答案就是合法的数列分段Ⅱ:wa了许多次,好多地方都没考虑到1)l,r的取值万分注意2)c
一本通提高篇树状数组做题集
wangyh1008
一本通提高篇
前奏做树状数组的题之前,需要做三道板子题:板子题1——单点修改,区间查询板子题就不写题解了哈╮(╯▽╰)╭代码#include#include#include#include#include#include#defineintlonglongusingnamespacestd;intn,q,a[1000005],c[1000005];voidupdate(intt,intv){for(intx=t
二分与三分
loceaner
最近老师让我们重新开始学一本通提高篇,虽然这本书比较烂,但是由于我很菜,什么都不会,所以必须(\(lhy\)大佬喜欢说必须)好好学!还有就是……因为\(loj\)可以用了,所以以后在\(loj\)上做了(信息学奥赛一本通官方网站真是太\(rubbish\)了……)\(ps:\)由于前几天已经把第一部分第一章做完了,所以从第二章开始写二分与三分首先……二分是一种非常精妙的算法,这个东西要用的话,必须
10/14训练日志
sean(SunPeishuai)
ACM开学训练日志
1.看了关于树状数组的一些知识,lowbit(),update(i,k),sum(x)等,看了有关的博客,有些题可以看懂,有的依然不明白为什么那样写,这样写为什么会产生这样的结果还是有点不理解,有待进一步深入的学习,然后不看题解试几道题。2.准备看看之前的一些东西,并跟着信息学奥赛一本通提高篇做点题,巩固提高,下阶段的打算。3.一天一个小时的时间,现在没有特殊情况是可以保证的,但是时间还是有点短,
Hadoop(一)
朱辉辉33
hadooplinux
今天在诺基亚第一天开始培训大数据,因为之前没接触过Linux,所以这次一起学了,任务量还是蛮大的。
首先下载安装了Xshell软件,然后公司给了账号密码连接上了河南郑州那边的服务器,接下来开始按照给的资料学习,全英文的,头也不讲解,说锻炼我们的学习能力,然后就开始跌跌撞撞的自学。这里写部分已经运行成功的代码吧.
在hdfs下,运行hadoop fs -mkdir /u
maven An error occurred while filtering resources
blackproof
maven报错
转:http://stackoverflow.com/questions/18145774/eclipse-an-error-occurred-while-filtering-resources
maven报错:
maven An error occurred while filtering resources
Maven -> Update Proje
jdk常用故障排查命令
daysinsun
jvm
linux下常见定位命令:
1、jps 输出Java进程
-q 只输出进程ID的名称,省略主类的名称;
-m 输出进程启动时传递给main函数的参数;
&nb
java 位移运算与乘法运算
周凡杨
java位移运算乘法
对于 JAVA 编程中,适当的采用位移运算,会减少代码的运行时间,提高项目的运行效率。这个可以从一道面试题说起:
问题:
用最有效率的方法算出2 乘以8 等於几?”
答案:2 << 3
由此就引发了我的思考,为什么位移运算会比乘法运算更快呢?其实简单的想想,计算机的内存是用由 0 和 1 组成的二
java中的枚举(enmu)
g21121
java
从jdk1.5开始,java增加了enum(枚举)这个类型,但是大家在平时运用中还是比较少用到枚举的,而且很多人和我一样对枚举一知半解,下面就跟大家一起学习下enmu枚举。先看一个最简单的枚举类型,一个返回类型的枚举:
public enum ResultType {
/**
* 成功
*/
SUCCESS,
/**
* 失败
*/
FAIL,
MQ初级学习
510888780
activemq
1.下载ActiveMQ
去官方网站下载:http://activemq.apache.org/
2.运行ActiveMQ
解压缩apache-activemq-5.9.0-bin.zip到C盘,然后双击apache-activemq-5.9.0-\bin\activemq-admin.bat运行ActiveMQ程序。
启动ActiveMQ以后,登陆:http://localhos
Spring_Transactional_Propagation
布衣凌宇
springtransactional
//事务传播属性
@Transactional(propagation=Propagation.REQUIRED)//如果有事务,那么加入事务,没有的话新创建一个
@Transactional(propagation=Propagation.NOT_SUPPORTED)//这个方法不开启事务
@Transactional(propagation=Propagation.REQUIREDS_N
我的spring学习笔记12-idref与ref的区别
aijuans
spring
idref用来将容器内其他bean的id传给<constructor-arg>/<property>元素,同时提供错误验证功能。例如:
<bean id ="theTargetBean" class="..." />
<bean id ="theClientBean" class=&quo
Jqplot之折线图
antlove
jsjqueryWebtimeseriesjqplot
timeseriesChart.html
<script type="text/javascript" src="jslib/jquery.min.js"></script>
<script type="text/javascript" src="jslib/excanvas.min.js&
JDBC中事务处理应用
百合不是茶
javaJDBC编程事务控制语句
解释事务的概念; 事务控制是sql语句中的核心之一;事务控制的作用就是保证数据的正常执行与异常之后可以恢复
事务常用命令:
Commit提交
[转]ConcurrentHashMap Collections.synchronizedMap和Hashtable讨论
bijian1013
java多线程线程安全HashMap
在Java类库中出现的第一个关联的集合类是Hashtable,它是JDK1.0的一部分。 Hashtable提供了一种易于使用的、线程安全的、关联的map功能,这当然也是方便的。然而,线程安全性是凭代价换来的――Hashtable的所有方法都是同步的。此时,无竞争的同步会导致可观的性能代价。Hashtable的后继者HashMap是作为JDK1.2中的集合框架的一部分出现的,它通过提供一个不同步的
ng-if与ng-show、ng-hide指令的区别和注意事项
bijian1013
JavaScriptAngularJS
angularJS中的ng-show、ng-hide、ng-if指令都可以用来控制dom元素的显示或隐藏。ng-show和ng-hide根据所给表达式的值来显示或隐藏HTML元素。当赋值给ng-show指令的值为false时元素会被隐藏,值为true时元素会显示。ng-hide功能类似,使用方式相反。元素的显示或
【持久化框架MyBatis3七】MyBatis3定义typeHandler
bit1129
TypeHandler
什么是typeHandler?
typeHandler用于将某个类型的数据映射到表的某一列上,以完成MyBatis列跟某个属性的映射
内置typeHandler
MyBatis内置了很多typeHandler,这写typeHandler通过org.apache.ibatis.type.TypeHandlerRegistry进行注册,比如对于日期型数据的typeHandler,
上传下载文件rz,sz命令
bitcarter
linux命令rz
刚开始使用rz上传和sz下载命令:
因为我们是通过secureCRT终端工具进行使用的所以会有上传下载这样的需求:
我遇到的问题:
sz下载A文件10M左右,没有问题
但是将这个文件A再传到另一天服务器上时就出现传不上去,甚至出现乱码,死掉现象,具体问题
解决方法:
上传命令改为;rz -ybe
下载命令改为:sz -be filename
如果还是有问题:
那就是文
通过ngx-lua来统计nginx上的虚拟主机性能数据
ronin47
ngx-lua 统计 解禁ip
介绍
以前我们为nginx做统计,都是通过对日志的分析来完成.比较麻烦,现在基于ngx_lua插件,开发了实时统计站点状态的脚本,解放生产力.项目主页: https://github.com/skyeydemon/ngx-lua-stats 功能
支持分不同虚拟主机统计, 同一个虚拟主机下可以分不同的location统计.
可以统计与query-times request-time
java-68-把数组排成最小的数。一个正整数数组,将它们连接起来排成一个数,输出能排出的所有数字中最小的。例如输入数组{32, 321},则输出32132
bylijinnan
java
import java.util.Arrays;
import java.util.Comparator;
public class MinNumFromIntArray {
/**
* Q68输入一个正整数数组,将它们连接起来排成一个数,输出能排出的所有数字中最小的一个。
* 例如输入数组{32, 321},则输出这两个能排成的最小数字32132。请给出解决问题
Oracle基本操作
ccii
Oracle SQL总结Oracle SQL语法Oracle基本操作Oracle SQL
一、表操作
1. 常用数据类型
NUMBER(p,s):可变长度的数字。p表示整数加小数的最大位数,s为最大小数位数。支持最大精度为38位
NVARCHAR2(size):变长字符串,最大长度为4000字节(以字符数为单位)
VARCHAR2(size):变长字符串,最大长度为4000字节(以字节数为单位)
CHAR(size):定长字符串,最大长度为2000字节,最小为1字节,默认
[强人工智能]实现强人工智能的路线图
comsci
人工智能
1:创建一个用于记录拓扑网络连接的矩阵数据表
2:自动构造或者人工复制一个包含10万个连接(1000*1000)的流程图
3:将这个流程图导入到矩阵数据表中
4:在矩阵的每个有意义的节点中嵌入一段简单的
给Tomcat,Apache配置gzip压缩(HTTP压缩)功能
cwqcwqmax9
apache
背景:
HTTP 压缩可以大大提高浏览网站的速度,它的原理是,在客户端请求网页后,从服务器端将网页文件压缩,再下载到客户端,由客户端的浏览器负责解压缩并浏览。相对于普通的浏览过程HTML ,CSS,Javascript , Text ,它可以节省40%左右的流量。更为重要的是,它可以对动态生成的,包括CGI、PHP , JSP , ASP , Servlet,SHTML等输出的网页也能进行压缩,
SpringMVC and Struts2
dashuaifu
struts2springMVC
SpringMVC VS Struts2
1:
spring3开发效率高于struts
2:
spring3 mvc可以认为已经100%零配置
3:
struts2是类级别的拦截, 一个类对应一个request上下文,
springmvc是方法级别的拦截,一个方法对应一个request上下文,而方法同时又跟一个url对应
所以说从架构本身上 spring3 mvc就容易实现r
windows常用命令行命令
dcj3sjt126com
windowscmdcommand
在windows系统中,点击开始-运行,可以直接输入命令行,快速打开一些原本需要多次点击图标才能打开的界面,如常用的输入cmd打开dos命令行,输入taskmgr打开任务管理器。此处列出了网上搜集到的一些常用命令。winver 检查windows版本 wmimgmt.msc 打开windows管理体系结构(wmi) wupdmgr windows更新程序 wscrip
再看知名应用背后的第三方开源项目
dcj3sjt126com
ios
知名应用程序的设计和技术一直都是开发者需要学习的,同样这些应用所使用的开源框架也是不可忽视的一部分。此前《
iOS第三方开源库的吐槽和备忘》中作者ibireme列举了国内多款知名应用所使用的开源框架,并对其中一些框架进行了分析,同样国外开发者
@iOSCowboy也在博客中给我们列出了国外多款知名应用使用的开源框架。另外txx's blog中详细介绍了
Facebook Paper使用的第三
Objective-c单例模式的正确写法
jsntghf
单例iosiPhone
一般情况下,可能我们写的单例模式是这样的:
#import <Foundation/Foundation.h>
@interface Downloader : NSObject
+ (instancetype)sharedDownloader;
@end
#import "Downloader.h"
@implementation
jquery easyui datagrid 加载成功,选中某一行
hae
jqueryeasyuidatagrid数据加载
1.首先你需要设置datagrid的onLoadSuccess
$(
'#dg'
).datagrid({onLoadSuccess :
function
(data){
$(
'#dg'
).datagrid(
'selectRow'
,3);
}});
2.onL
jQuery用户数字打分评价效果
ini
JavaScripthtmljqueryWebcss
效果体验:http://hovertree.com/texiao/jquery/5.htmHTML文件代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery用户数字打分评分代码 - HoverTree</
mybatis的paramType
kerryg
DAOsql
MyBatis传多个参数:
1、采用#{0},#{1}获得参数:
Dao层函数方法:
public User selectUser(String name,String area);
对应的Mapper.xml
<select id="selectUser" result
centos 7安装mysql5.5
MrLee23
centos
首先centos7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要先卸载掉mariadb,以下为卸载mariadb,安装mysql的步骤。
#列出所有被安装的rpm package rpm -qa | grep mariadb
#卸载
rpm -e mariadb-libs-5.
利用thrift来实现消息群发
qifeifei
thrift
Thrift项目一般用来做内部项目接偶用的,还有能跨不同语言的功能,非常方便,一般前端系统和后台server线上都是3个节点,然后前端通过获取client来访问后台server,那么如果是多太server,就是有一个负载均衡的方法,然后最后访问其中一个节点。那么换个思路,能不能发送给所有节点的server呢,如果能就
实现一个sizeof获取Java对象大小
teasp
javaHotSpot内存对象大小sizeof
由于Java的设计者不想让程序员管理和了解内存的使用,我们想要知道一个对象在内存中的大小变得比较困难了。本文提供了可以获取对象的大小的方法,但是由于各个虚拟机在内存使用上可能存在不同,因此该方法不能在各虚拟机上都适用,而是仅在hotspot 32位虚拟机上,或者其它内存管理方式与hotspot 32位虚拟机相同的虚拟机上 适用。
SVN错误及处理
xiangqian0505
SVN提交文件时服务器强行关闭
在SVN服务控制台打开资源库“SVN无法读取current” ---摘自网络 写道 SVN无法读取current修复方法 Can't read file : End of file found
文件:repository/db/txn_current、repository/db/current
其中current记录当前最新版本号,txn_current记录版本库中版本