April 29 2017 Week 17 Saturday】的更多相关文章

Every man is a poet when he is in love. 每个恋爱中的人都是诗人. It is said this saying was from Plato, the famous ancient philosopher. Notice that when you are dating with a girl, the romantic process may involve flowers, chocolate, sweet words and surprising g…
题意:给你一个序列,长度不超过52,每个元素不超过13.让你重新对这个序列排序,sum(i)表示i的前缀和,使得排序过后,对每个i,都有sum(i)%i==0. 深搜,加两个优化:①倒着从后向前搜:②枚举的时候不要枚举52个,而枚举值域(只有13),能快一点. 另外,一开始想的是相同的元素在最后一定都相邻,但是事实上试了试之后发现不行. #include<cstdio> #include<cstdlib> using namespace std; int path[60],a[60…
题意:给你一个凸多边形,和多次询问,每次询问给你一条直线,问你这条直线与凸包上的顶点的最近距离是多少. 记当前询问的直线的斜率为K, 先找到与这条直线距离最远的两个点: 就把凸包所有的边当做有向直线进行排序,那么距离最远的两个点一定是斜率最接近+K和-K的,可以通过二分求得. 然后这两个点把凸包分成两个凸壳,就可以通过三分求得距离最近的点了.…
题意:给你一个序列,支持两种操作:单点修改:询问一个区间中所有相邻位置下标奇偶性均不同的子序列中,和最大的是多少. 线段树每个结点维护四个值: 以奇数下标开始到奇数下标结束的最大子序列和: 以偶数下标开始到偶数下标结束的最大子序列和: 以奇数下标开始到偶数下标结束的最大子序列和: 以偶数下标开始到奇数下标结束的最大子序列和. 合并的时候先在左右两区间中取较大者,然后奇-偶的答案能通过奇-奇+偶-偶.奇-偶+奇-偶得到:奇-奇的答案能通过奇-奇+偶-奇.奇-偶+奇-奇得到……这样讨论一下. #in…
题意:给你一个串,让你从左到右构造这个串,一次操作可以直接在当前串后面添加一个任意字符,或者拷贝当前串的任意一个子串到当前串的后面.问你最少要多少次操作才能构造出这个串. 从前向后贪心,从当前已构造的串的后面开始,尽量往后走,尝试在后缀自动机上转移,直到不能转移为止,便求出了后面的串的在当前串中能找到的最长前缀是多少,然后答案++,然后把这个最长前缀加入后缀自动机接着跑即可.不会证明. #include<cstdio> #include<cstring> #include<a…
Much effort, much prosperity. 越努力,越幸运. I have ever seen this sentence in many people's signature of their social media applications, like WeChat, Tecent QQ, and so on. I ever thought that may be true, if you make much more efforts, you would be able…
There is more to life than increasing its speed. 生活不仅仅是匆匆赶路. Get a life, a real life, not a manic pursuit of the next promotion, the bigger paycheck, the larger house, and so on. Get a life in which you are not alone. Find people you love, and who lo…
The only thing more painful than learning from experience is not learning from experience. 比从经验中学习更为痛苦的事情就是没能从经验中学习. Learning from experience is painful, but the alternative of not learning is worse. Yes, it it easy to understand why not learning fro…
Had I not seen the sun, I could have borne the shade. 我本可以忍受黑暗,如果我不曾见过阳光. A poem by Emily Dickinson, and the full text follows: Had I not seen the sun I could have borne the shade But light a newer wilderness My wilderness had made Aha, if just readi…
We read the world wrong and say that it deceives us. 我们把世界看错了,反而说它欺骗了我们. It is not a cakewalk to see the world clearly and read it in the right way. Sometimes we didn't attain the things we expected, we might complain that the world deceived us. Why…
Have you ever known the theory of chocie? There are a bunch of axiems, but there are only two thing we really need to concern with. One, the only person's behaviors that we can control are our own. And two, the only thing that we can truly give other…
It is a characteristic of wisdom not to do desperate things. 不做孤注一掷的事情是智慧的表现. We are told that we had better not to put all our eggs into one basket, that means, we must learn how to spread the risks so as to reduce the potential risks to the minimum…
Fear is an essential part of our survival, it keeps us alert. 恐惧是生存的重要部分,它让我们保持警惕. Fear and pain are both the essential part of our survival. If a child can't feel pain, then his or her life would be full of danger, as we know in many stories, one ca…
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…
win10 如何配置 java jdk 环境变量 2017.8.17 本篇还适用于 windows server 2012. windows server 2014+ 一.安装 下载 jdk 64位 windows 版本安装(默认安装) 默认安装的路径: C:\Program Files\Java\.0_144 C:\Program Files\Java\.0_144 二.配置环境变量 安装好后增加系统的环境变量,如图: 新建变量: JAVA_HOME C:\Program Files\Java…
预计分数:100+60+60=220 实际分数:100+60+40=200 除了暴力什么都不会的我..... T1 2017.9.17巧克力棒(chocolate) 巧克力棒(chocolate)Time Limit:1000ms Memory Limit:64MB题目描述LYK 找到了一根巧克力棒,但是这根巧克力棒太长了,LYK 无法一口吞进去.具体地,这根巧克力棒长为 n,它想将这根巧克力棒折成 n 段长为 1 的巧克力棒,然后慢慢享用.它打算每次将一根长为 k 的巧克力棒折成两段长为 a…
环境: win7_x64旗舰版.VS2017企业版 一.安装VS2017 1.1 安装VS2017时,必须要勾选“使用C++的modules开发”选项 1.2 安装成功后,会在VS安装目录Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017生成ifc文件夹 二.创建和配置项目 2.1 创建Win32控制台项目 2.2 添加module.cpp文件内容 // module.cpp : 定义控制台应用程序的入口点. //…
If you are not brave enough, no one will back you up. 如果你不够勇敢,没人会替你坚强. I was told that the real man can smile in trouble, gather strength from distress, and grow brave by reflection. I learned that courage is not the absence of fear, but the triumph…
Courage is grace under pressure. 勇气就是压力下的优雅. In the face of stress, can you deal with your task smoothly? I can't, I can't keep calm, because I am vulnerable to pressures. I just become anxious if facing the pressures, but I seldom take measures to r…
Mountains look beautiful from a distance. 远处看山山更美. This gnomic seems to circulate very long, its more universal version is the distance can produce the beauty, alleged far see a flower, see posse hemp nearly. Yes, the distance produces beauty, while…
CSS---表现层,修饰和表现html文档,为了解决结构层和表现层分离的问题. 通过CSS极大的提高了工作效率,方便工作人员维护和管理CSS:层叠样式表,目前用的最广泛的css版本为css2,最新版本是css3 ----------------------------------------------------------------一 CSS的放置位置1 嵌入式css里面我们叫html标签为html元素放置位置:直接将css代码嵌入到html元素中语法:<tag style="css…
Happiness is a direction, not a place. 快乐是一个方向,不是一个目的. Do you remember those moments in your life when you were happy and joyful? Do you remeber how those moments came, and how they made you feel? If you have some clear answers, I think you will know…
It does not do to dwell on dreams and forget to live. 整天沉溺于梦想而忘记如何好好生活,毫无意义. Bingo, and I think it is useless, even harmful to spend time on these lack-of-rewarding things. Sometimes it would be far better to format the system and restore the whole e…
All I ever wanted was a single thing worth fighting for. 我想要的只不过是一件能让我奋不顾身的事业. Stop complaining the unfairness of fate. Promise yourself to dream more and hesitate less. To believe in yourself more and judge yourself less by the accomplishments of ot…
Only I can change my life. No one can do it for me. 只有我可以改变我的命运,没有人可以帮我做. Stop complaining about the unfairness of your fate. Except for some unexpected reasons, many of the results are determined by our own actions. So, if we want to make some chang…
I was well beaten myself, and I am beffer for it. 我自己也被打败过,但我因此变得更好. For most of us, the life road can't be as easy and smooth as we had expected, it is inevitable that we would experience failures, frustrations and losses. No doubt the effects of th…
好不容易搞来的题目,不写一写怎么行呢. 不过难度真心不高(一小时K掉),都是老题+暴力题,没有欧洲玄学. 再说一句,这试卷是叶可禾出的吧. T1 好老的题目,看到有多组数据我还怕了,以为有更流弊的算法.没想到减了数据范围. 首先把边sort一遍,因为要求,max-min最小,所以枚举最短边,然后向后找到第一条满足联通的边即可. 联通的话通过并查集就可以实现. (没有联通要输-1,题目里没说) CODE #include<cstdio> #include<algorithm> usi…
以后平时练习还是写一写吧. (题目搞来搞去太烦了,直接PDF存起来) T1 水题(???),主要是数据水,正解是设一个阙值,然而根本没人打.(暴力出奇迹) CODE #include<cstdio> using namespace std; inline void read(int &x) { x=; char ch=getchar(); ') ch=getchar(); +ch-',ch=getchar(); } ; int sum,a[N],n,t,p,i,q; int main(…