April 14 2017 Week 15 Friday】的更多相关文章

Try to be a rainbow in someone's cloud. 当乌云萦绕心头,我愿意成为你的彩虹. Actually there are many rainbows in our life, even when we think our life is totally darkened by heavy clouds and we can't see any light, even a small glimmer of light. Sometimes we may see t…
Love is hard to get into, but harder to get out of. 相爱不易,相忘更难. The past are hurt, but I think we can run from it or learn from it. If she turns her back on you, you also can turn your back on her. Please be barve when you have to be, for example, you…
Happiness takes no account of time. 幸福不觉光阴过. Do you know the theory of relativity? If you know about that, you may know one story about Einstein, how did he explain his theory to those who were totally ignorant about that? He said in a funny way: Yea…
Genius often betrays itself into great errors. 天才常被天才误. Genius can help us get greater achievements, and it can result in great errors as well. Whether it is helpful or harmful, depends on the purposes of those genius. To borrow from the Spiderman, w…
He alone is poor who does not possess knowledge. 没有知识,才是贫穷. Knowledge, as a important part of wisdom, can be converted into wealth, especially in this fast-developing world, because it is becoming more and more technology-driven, those people with go…
In the evening one may praise the day. 入夜方能赞美白昼. I think that could be understand in different ways, at least two. One is that we praise the day in the evening, because the day brings us the light, in the evening we know the value of light. The other…
原博客地址:http://jinnianshilongnian.iteye.com/blog/2018398 根据下载的pdf学习. 第二十一章 授予身份与切换身份(一) 1.使用场景 某个领导因为某些原因不能访问一些网站,他想把这个网站上的工作委托给秘书,但是他又不想提供账户.密码.此时可以使用shiro的 RunAs 功能. RunAs:允许一个用户假装为另一个用户(如果获得了允许)的身份进行访问. 注意,本章代码基于<第十六章 综合实例>,详细的数据模型及基本流程见该章. 2.表及数据…
2018年7月9日更新: CUDA已推出9.2版本,最高支持MSVC++ 14.13 _MSC_VER == 1913 (Visual Studio 2017 version 15.6). 然而最新版本是MSVC++ 14.14 _MSC_VER == 1914 (Visual Studio 2017 version 15.7),可见CUDA总比VS要慢一拍. 环境: CUDA Toolkit - v9.1.85 Visual Studio 2017 (VS2017 15.6.4) + 平台工具…
Visual Studio 2017 15.5 版本已正式发布,同时发布的还有 Visual Studio for Mac 7.3 .此次更新包含主要性能改进,新特性以及 bug 修复.发行说明中文版 目前尚未更新,可先查看 英文版.本站第一时间跟进了离线安装包的制作,并于2017年12月6日在 码农很忙 首发. 本离线安装包使用官方原版程序配合 layout 指令制作,包含 Visual Studio 2017 Enterprise 15.5 所有组件以及全部语言包.因最终包体较大且文件名较长…
Visual Studio 2017 版本 15.5.5 已修复的问题 (1)Xamarin 应用会引发“Cannot access a disposed object. Object name: 'MobileAuthenticatedStream'”错误. (2)当派生自 Application 类时,Xamarin.Android 应用会引发“ClassNotFoundException”. (3)升级可能会导致卸载以前安装的 Windows 和 Android SDK. (4)将 JDK…
/Date(1487053489965+0800)/用Java怎么转换成yyyy-MM-dd的格式 Tue Feb 14 2017 14:06:32 GMT+0800用Java怎么转换成yyyy-MM-dd的格式 跟普通的日期不太一样 public static void main(String[] args) { String str="/Date(1487053489965+0800)/"; str=str.replace("/Date(","&quo…
参考来自:http://blog.csdn.net/jeffleo/article/details/52194433 1.速度 一般来说,三者的速度是:StringBuilder > StringBuffer > String. 但是,在String a = "how" + "old" + "are" + "you".这种直接拼接的情况下,String速度最高.这是因为jvm的优化问题,jvm会自动识别,把&quo…
原博客地址:http://jinnianshilongnian.iteye.com/blog/2018398 根据下载的pdf学习. 开涛shiro教程-第二十一章-授予身份与切换身份(二) 1.回顾上节 在<2017.2.15 开涛shiro教程-第二十一章-授予身份与切换身份(一)table.entity.service.dao >中,做了这四件事.这只是准备材料,要实现 B 假借 A 的身份进行访问,还需要完成controller部分. 1 table:sys_user_runas 2…
安装opencv的时候,出现numpy的版本不匹配,卸载了不匹配的版本,重新安装却是一点用都没有,后面尝试了一下这里的提示pip更新,居然安装成功了,看来pip的版本过低真是误事啊. 报错是: Could not find a version that satisfies the requirement numpy==1.13.3 (from versions: 1.14.5, 1.14.6, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4,…
题目: Problem F. Matrix GameInput file: standard inputOutput file: standard inputTime limit: 1 secondMemory limit: 256 mebibytesAlice and Bob are playing the next game. Both have same matrix N × M filled with digits from 0 to 9.Alice cuts the matrix ve…
题目:Problem J. TerminalInput file: standard inputOutput file: standard inputTime limit: 2 secondsMemory limit: 256 mebibytesN programmers from M teams are waiting at the terminal of airport. There are two shuttles at the exitof terminal, each shuttle…
题目:Problem L. Canonical duelInput file: standard inputOutput file: standard outputTime limit: 2 secondsMemory limit: 256 megabytesIn the game «Canonical duel» board N × M is used. Some of the cells of the board contain turrets. Aturret is the unit wi…
题目:Problem A. Arithmetic DerivativeInput file: standard inputOutput file: standard inputTime limit: 1 secondMemory limit: 256 mebibytesLets define an arithmetic derivative:• if p = 1 then p0 = 0;• if p is prime then p0 = 1;• if p is not prime then n0…
题目:Problem D. Clones and TreasuresInput file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 256 mebibytesThe magical treasury consists of n sequential rooms. Due to construction of treasury its impossible togo from room…
给你一个网格(n<=2000,m<=2000),有一些炸弹,你可以选择一个空的位置,再放一个炸弹并将其引爆,一个炸弹爆炸后,其所在行和列的所有炸弹都会爆炸,连锁反应. 问你所能引爆的最多炸弹数. 转化成: 将行列当成点,炸弹当成边,然后你可以给这个二分图加1条边,问你最大的连通块的边的数量. 可以通过枚举所有可以建的边,通过并查集来尝试更新答案.由于一条边必然会让总度数+2,所以一个连通块的边数是所有点的度数之和/2. 并查集不必要动态维护集合的大小,一开始就建好并查集,提前统计好即可. 最后…
有两辆车,容量都为K,有n(10w)个人被划分成m(2k)组,依次上车,每个人上车花一秒.每一组的人都要上同一辆车,一辆车的等待时间是其停留时间*其载的人数,问最小的两辆车的总等待时间. 是f(i,j)表示前i组,j个人是否可行.w(i)表示第i组的人数. if f(i,j)==1 then f(i+1,j+w(i+1))=1. 这是个bitset可以做的事情,每次左移以后或上f(i-1)的bitset即可.其实可以滚动数组. 然后每更新一次bitset,求一下其最左侧的1的位置,就是对于第一辆…
给你n个字符串,问你最小的长度的前缀,使得每个字符串任意循环滑动之后,这些前缀都两两不同. 二分答案mid之后,将每个字符串长度为mid的循环子串都哈希出来,相当于对每个字符串,找一个与其他字符串所选定的子串不同的子串,是个二分图最大匹配的模型,可以匈牙利或者Dinic跑最大流看是否满流. 一个小优化是对于某个字符串,如果其所有不同的子串数量超过n,那么一定满足,可以直接删去. 卡常数,不能用set,map啥的,采取了用数组记录哈希值,排序后二分的手段进行去重和离散化. #include<cst…
给你一个n*m的字符矩阵,将横向(或纵向)全部裂开,然后以任意顺序首尾相接,然后再从中间任意位置切开,问你能构成的字典序最大的字符串. 以横向切开为例,纵向类似. 将所有横排从大到小排序,枚举最后切开的位置在哪一横排,将这一排提到排序后的字符串数组最前面,求个“最大表示法”,如果最大表示法的位置恰好在第一排的位置,那么可以用来更新答案. 如果不在第一排的位置,那么其所构成的仍然是合法的串,而且一定不会影响答案. 这是一个最小表示法的板子. #include<cstdio> #include&l…
给你n,K,问你要选出最少几个长度为2的K进制数,才能让所有的n位K进制数删除n-2个元素后,所剩余的长度为2的子序列至少有一个是你所选定的. 如果n>K,那么根据抽屉原理,对于所有n位K进制数,必然会至少有1个数字出现2次或以上,所以00,11,...,K-1 K-1这样的数对是必选的. 对于其他的情况下,我们需要让他构造不出来n位不含重复数字的K进制数. 于是可以把K个数尽可能平均地分成n-1组,每一组内部让他们选出任意两个数都不合法,于是只能组间互相拼,这样他只能构造出最多n-1位的K进制…
给你一行房间,有的是隐身药水,有的是守卫,有的是金币. 你可以任选起点,向右走,每经过一个药水或金币就拿走,每经过一个守卫必须消耗1个药水,问你最多得几个金币. 药水看成左括号,守卫看成右括号, 就从每个位置贪心地向右走,如果在 r 遇到不匹配,则把下一次的左端点置成r+1,接着走. O(n)即可. 因为如果把左端点放在上次的l和r之间,要么会发生不匹配,要么答案无法比上次走的更优. 队友代码: #include <iostream> #include <cstdio> #incl…
假设一个数有n个质因子a1,a2,..,an,那么n'=Σ(a1*a2*...*an)/ai. 打个表出来,发现一个数x,如果x'=Kx,那么x一定由K个“基础因子”组成. 这些基础因子是2^2,3^3,5^5,7^7,11^11,13^13.只有6个,K不超过30,于是可以dfs. 要注意搜索顺序(每次枚举的时候,都从大于等于前项的开始搜)和可行性剪枝(如果超过r则剪枝,虽说有可能爆long long,但其实整除就可以判,而且没有精度误差). #include<cstdio> //#incl…
You only live once, but if you do it right, once is enough. 人生只有一次,但如果活对了,一次也就够了. Maybe I am going to have to do a lot more work on the project before it is presentable. A lot of people can finish their work effortlessly, but it is so stiff for me to…
Attitude is a little thing that makes a big difference. 小态度,大不同. Attitudes can make a big difference, if combined properly with practice and ambition. I often complain that the God is unfair because I think I have not gain what I deserve. But if I re…
Life is the art of drawing without an eraser. 人生如画,落笔无悔. Yesterday I watched a film from Japan, After the Storm, which told a story about a middleaged man. He is a unsuccessful novelist and divorced his wife, because he was indulged in gambling. But…
A good heart is better than all the brains in the world. 聪明绝顶,不如宅心仁厚. A good heart can be useful to this world, at least a good-hearted person seldom does harm to the society. That can be a good explaination for why we often makes friends with some g…