- 博客(13)
- 收藏
- 关注
原创 江苏省赛--湘潭杯-highway 题解
HighwayIn ICPCCamp there were n towns conveniently numbered with 1,2,…,n connected with (n−1) roads. The i-th road connecting towns ai and bi has length ci.
2017-06-24 12:22:02 488
原创 codefoces214b 整除问题
/*首先这道题的题意是所给的数中挑选可以被2,5,3同时整除的最大的数 可以不选完,即从中挑选一些,不能有前导零 0时可以; 被2,5整除,必须含有0,当全是0时,只输出一个 被三整除的数的性质 各位数加起来之和也能被3整除,当各位数和%3==2时 删除一个%3余1的 1 4 7 或者删除两个%3余2的 2 5 8 各位数和%3==1 时 同理
2017-06-21 16:16:56 372
转载 codeforces 255C C. Almost Arithmetical Progression(dp)
题目大意: 给出一个序列,求最长的子序列,满足隔位的两个数相等,问这个最长的子序列的长度是多少。 例如:10,20,10,20,10 题目分析:定义状态dp[i][j]代表以第i个数为末尾,第j个数为倒数第二个的情况下的最长子序列。转移的方法很简单:dp[i][j]=dp[j][k]+1(a[k]==a[i])其中k的找法很简单,直接在转移的过程中顺便找与a[i]相等的比当前位小的最大的
2017-06-21 15:10:12 230
原创 cf -148 b double追赶问题模拟
The princess is going to escape the dragon’s cave, and she needs to plan it carefully. The princess runs at vp miles per hour, and the dragon flies at vd miles per hour. The dragon will discover the e
2017-06-15 18:22:37 276
原创 cf - 148 -- c 特殊判定 构造特定序列
C. Terse princess time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output «Next please», — the princess called and cast an estimating glance at the
2017-06-15 18:19:06 339
原创 巧妙地计算几何 Dancing Stars on Me
留给学弟学妹们的题目HDU - 5533 https://vjudge.net/contest/161167#problem/G 给你一些整数点,看这些点组成的多边形是否为正多边形 首先是东庆聚聚的解法 对于每个点找出离他距离最近的点即为邻边,然后对每两条边求向量的夹角(题目数据太水,不判也可以),还有所有边是否相等,判断是否是一个正多边形 方法2 东庆菊苣写了一个n^2的代码,无
2017-06-10 21:24:48 434
原创 SDUT 2017 春夏组队训练赛11 2017 6 10
本次比赛做出四个题,题目是2015长春区域赛的题目 其中l题为求表面积的题目 先算出方块的总个数然后*5,减去重叠部分即可(根据具体例子写) J题 是一个简单的优化,算1000个数中不相同的i,j,k三个值异或的最大值,之前一直受long long 的坑影响,这次又换了复杂度,其中圣昭写的i(0,n) j(i+1,n) k(0,n) 三重for复杂度为 (n^3 )/2,而用另一种方法写出
2017-06-10 20:46:50 304
原创 模板---LIS(最长上升子序列优化算法)
模板—LIS(最长上升子序列优化算法) 链接:HDU - 5532 https://vjudge.net/contest/161167#problem/F 复杂度 n*logn 二分查找+dp输入n n个数 查找n个数的最长上升子序列 方法一:STL版int LIS(void){ int tail[100005],len = 0; //最长下降子序列 改为for(in
2017-06-10 20:01:27 317
原创 最短路 poj flyod
Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British
2017-06-01 19:22:30 372
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人