转载自新博客:https://acxblog.site/archives/smst problem.html Problem BZOJ 入门OJ P1634 Luogu P4180 BJWC 次小生成树 Introduction 首先讲非严格次小生成树的做法。 先建立权值之和为$W$的最小生成树。接 ...
分类:
其他好文 时间:
2018-04-26 01:27:16
阅读次数:
212
问题 A: 动态中位数问题 题目描述 输入一组整数a1, a2, …, an ,每输入一个整数,输出到此时为止的中位数。 中位数定义:如果数串的大小是偶数 2j,中位数是从小到大排列的第 j 个数;如果数串的大小是奇数 2j+1,中位数是从小到大排列的第 j+1 个数。 输入一组整数a1, a2, ...
分类:
编程语言 时间:
2018-04-26 01:15:12
阅读次数:
243
1、天天向上的力量: 一年365天,以第1天的能力值为基数,记为1.0。当好好学习时,能力值相比前一天提高N‰;当没有学习时,由于遗忘等原因能力值相比前一天下降N‰。每天努力或放任,一年下来的能力值相差多少呢?其中,N的取值范围是1到10,N可以是小数。 获得用户输入N,计算每天努力和每天放任365 ...
分类:
编程语言 时间:
2018-04-21 00:21:59
阅读次数:
250
近期刷了好几次的oj,好受伤好多都是相似的题目。 最长回文子串 string preprocess(string &str) { string afterProcessStr="#"; for(int i=0;i<str.size();++i) { afterProcessStr += str.su ...
分类:
其他好文 时间:
2018-04-20 22:10:16
阅读次数:
221
题目 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 ...
分类:
其他好文 时间:
2018-04-19 12:04:34
阅读次数:
125
效果图如下: 二级列表附有点击事件。 1、布局文件: 此处加了一个自定义的导航RelativeLayout,记得注activity的时候添加 android:theme="@style/Theme.AppCompat.Light.NoActionBar" 去掉自带的导航。 2、一级列表布局: 3、二 ...
分类:
其他好文 时间:
2018-04-18 18:59:26
阅读次数:
171
题目 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 functio ...
分类:
其他好文 时间:
2018-04-18 11:40:52
阅读次数:
164
【Real Time Rendering 2】 1、The light vector l is usually defined pointing in a direction opposite to the direction the light is traveling. 2、The surfac ...
分类:
其他好文 时间:
2018-04-14 17:13:49
阅读次数:
171
一、介绍 目的:通过在Unity场景中添加C#脚本完成日夜轮转的效果。 软件环境:Unity 2017.3.0f3,VS2013 二、操作过程 通过拖拽场景中的Directional Light我们知道,只要控制好平行光的旋转就可以模拟出轮转的更替,所以我们要在Directional Light中添 ...
分类:
编程语言 时间:
2018-04-13 13:21:38
阅读次数:
380