BZOJ1010(HNOI2008)[玩具装箱toy]--斜率优化DP
【链接】 bzoj1010 【解题报告】 典型的斜率优化DP,但要证决策单调性 hzwer大佬写的证明(点这里),博主好懒啊,QAQ #include<cstdio> #define LL long long using namespace std; const int maxn=50005; int n,L,hed,til,que[maxn]; LL...
View ArticleBZOJ1045(HAOI2008)[糖果传递]&&BZOJ3293(Cqoi2011)[分金币]--中位数
【链接】 bzoj1045 bzoj3293 【解题报告】 又是双倍经验题 推导如下: 这里的B是定值也就是∑ni=1AiN 就解决了两题,yeh #include<cstdio> #include<algorithm> using namespace std; const int maxn=1000005; int n,a[maxn]; long long...
View Article第 2 章 线性表
第 1 节 队列 有一串加密过的数字6 3 1 7 5 8 9 2 4,解密的规则是:首先将第1个数删除,紧接着将第2个数放到这串数的末尾,再将第3个数删除并将第4个数放到这串数的末尾,再将第5个数删除……直到省些最后一个数,将最后一个数也删除。按照刚才删除的顺序,把这些删除的数连在一起就是解密出的数字。 #include <stdio.h> int main(){ int...
View Articlenanomsg 框架简介
1、nanomsg概述 Ø nanomsg是一个socket library,它提供了几种常见的通信模式,为了能使网络层快速、可扩展并且能易于使用。用C实现,且适用于广泛的操作系统,几乎不需要依赖。这里的通信模式(也称为“可扩展性协议”)是构建分布式系统的基本框架。通过组合它们,可以创建广泛的分布式应用程序。 Ø 目前可用的可扩展性协议有: PAIR - 简单的一对一沟通 BUS -...
View ArticleBZOJ2006(NOI2010)[超级钢琴]--贪心+ST算法+堆
【链接】 bzoj2006 【题目大意】 给出一个序列,选出 k个长度在 [L,R]的子段(不可选重),求k 个子段的和的最大值。 【解题报告】 首先有个想法就是将所有子段都求出来,排序后取前kk个,但是个数太多了,内存开不下。 所以进一步想,我们可以从k来考虑。 定义三元组MAX(i,l,r)=max(sum[i]−sum[t−1]|l≤t≤r)即以 i 为右端点,左端点范围在[l,r]...
View Article深度学习装机、系统、环境配置指南--预算15000
随着要处理的任务越来越复杂,对计算能力要求越来越高,所以最近萌生了要自己配一台深度学习主机的想法。只是苦于一直没有钱==然后很幸运的被评上了国奖,果断入手!!!!然后就是历时一周的各种查资料看博客上京东看价钱的来回对比,终于从一个完全小白变身成入门级玩家。下面就详细说一下自己的配置和装机经历,满满的血泪史啊。。。 主机配件...
View Article【蓝桥杯】【猜年龄】
【题目】 美国数学家维纳(N.Wiener)智力早熟,11岁就上了大学。他曾在1935~1936年应邀来中国清华大学讲学。 一次,他参加某个重要会议,年轻的脸孔引人注目。于是有人询问他的年龄,他回答说: “我年龄的立方是个4位数。我年龄的4次方是个6位数。 这10个数字正好包含了从0到9这10个数字,每个都恰好出现1次。” 请你推算一下,他当时到底有多年轻。 通过浏览器,直接提交他那时的年龄数字。...
View ArticlePOJ 3254 Corn Fields (状态压缩)
刚开始的思路是 把0-2^x的 所有状态枚举, 然后找符合条件的, 但是 发现 当12*12 时 1的数量x 超过64 这是个庞大的数字, 跟本就没法枚举; 想到用状态压缩, 但是 怎么压缩才行 ? 作为这是状态压缩入门题, 感觉 废了好大力气; 【思路】 把每一行 0/1状态 转换成 十进制的数, 每一行看成一个整体, 进行压缩, 【第一步】 先提前处理...
View ArticleLeetcode c语言-Permutations
TItle: Given a collection of distinct numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ]...
View Articlenested exception is java.lang.ClassCastException:XXX cannot be cast to...
Type Exception Report Message Request processing failed; nested exception is java.lang.ClassCastException: cn.com.ecict.bean.UserBean cannot be cast to java.io.Serializable Description The server...
View Article79. Word Search
题目 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically...
View ArticleJava的字符类String、StringBuffer与StringBuilder异同对比分析
Java的字符类String、StringBuffer与StringBuilder异同对比分析Java String是一个“不可变常量字符串”对象,final属性定义。之所以这么说,是从String内部在盛放字符串时候的容器char数组而言。比如当用户在初始化阶段定义了一个String对象String...
View Article80. Remove Duplicates from Sorted Array II
题目 Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,2,3], Your function should return length = 5, with the first five...
View ArticleHDU4810 亦或,组合数
I - Wall Painting HDU - 4810 Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) every day. Every day before painting, she produces a wonderful color of pigments by mixing water and...
View Article81. Search in Rotated Sorted Array II
题目 Follow up for “Search in Rotated Sorted Array”: What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose an array sorted in ascending order is rotated at some...
View Article82. Remove Duplicates from Sorted List II
题目 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return...
View Article86. Partition List
题目 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of...
View ArticleMakefile和Kconfig配置项目——fingerprint
RTFSC – Read The Fucking Source Code Fucking在这里难道完全就是语气词?当然不是这么肤浅。 RTFSC 一词 生动形象的体现了阅读源代码的艰难和重要性。 Linux的鼻祖Linus Torvalds在回答有人提出的Minix的一个问题时,所说的第一句话就是”Read The Fucking Source Code”,这就是RTFSC的来由。...
View Article89. Gray Code
题目 The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, print the sequence of...
View Articlemybatis 配置错误 XML document structures must start and end within the same entity
问题如下:Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating document...
View Article