排序:
默认
按更新时间
按访问量

LCA练习题

poj1330题意:求祖先,解释了啥是LCA。 想法:模板。#include<cstdio> #include<algorithm> #include<cstring> #include<vector> using namespace std; #...

2017-11-11 15:23:21

阅读数:169

评论数:0

HDU 6129 Just do it【杨辉三角】

题目来戳呀 Problem Description There is a nonnegative integer sequence a1…n of length n. HazelFan wants to do a type of transformation called prefix-X...

2017-08-18 21:05:35

阅读数:152

评论数:0

HDU 6127 Hard challenge【极角排序】

题目来戳呀Problem DescriptionThere are n points on the plane, and the ith points has a value vali, and its coordinate is (xi,yi). It is guaranteed that no...

2017-08-18 20:19:34

阅读数:131

评论数:0

HDU 6140 Hybrid Crystals【思维】

题目来戳呀Problem Description Kyber crystals, also called the living crystal or simply the kyber, and known as kaiburr crystals in ancient times, were r...

2017-08-18 17:25:35

阅读数:157

评论数:0

HDU 6143 Killer Names【容斥定理】【排列组合】

题目来戳呀Problem Description Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who liv...

2017-08-18 10:20:07

阅读数:236

评论数:0

POJ 2976 Dropping tests【分数规划】【二分搜索】

题目来戳呀 #include #include #include #include using namespace std; double a[1100],b[1100],f[1100];; const double acc=1e-7; int main() { int n,k; ...

2017-08-16 17:30:22

阅读数:92

评论数:0

数论之组合数取模

组合数取模:CmnC_n^m % p三个链接表示的是该种方法的定理定义之类的~怕三种方法合在一起太长(ノ`Д)ノ一、杨辉三角打表求组合数——1≤m≤n≤1000,1≤p≤10910^9int Combination(int n) { int i,j; a[0][0]...

2017-08-16 16:36:17

阅读数:155

评论数:0

数论之Lucas定理及证明过程

转自这里 http://blog.csdn.net/m674019130/article/details/76149170         Lucas定理主要用于组合数取模。 <span class="math" id="MathJax-Span-...

2017-08-16 16:16:47

阅读数:160

评论数:0

数论之杨辉三角

一、定义杨辉三角,是二项式系数在三角形中的一种几何排列。在欧洲,这个表叫做帕斯卡三角形(Pascal三角形)。 (注意图上是从第0行开始的+_+)二、性质前提:每行端点与结尾的数为1. 每个数等于它上方两数之和。 每行数字左右对称,由1开始逐渐变大。 第n行的数字有n项。 第n行数字和为2n...

2017-08-16 15:42:04

阅读数:182

评论数:0

HDU 6130 Kolakoski【找规律】

题目来戳呀Problem DescriptionThis is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1……. This sequence consists of 1 and 2, and its first term...

2017-08-15 20:20:43

阅读数:660

评论数:0

HDU 6070 Dirt Ratio【分数规划】【线段树】

题目来戳呀Problem DescriptionIn ACM/ICPC contest, the ”Dirt Ratio” of a team is calculated in the following way. First let’s ignore all the problems the t...

2017-08-15 11:00:19

阅读数:103

评论数:0

动态规划之01分数规划

不完全转载自这里 原文还有习题一、定义所谓的01分数规划问题是指这样的一类问题,给定两个数组,a[i]表示选取i的收益,b[i]表示选取i的代价。 求一个选择方案使得R=∑(a[i]∗x[i])∑(b[i]∗x[i])\frac{\sum(a[i]*x[i])}{\sum(b[i]*x[i])}...

2017-08-15 10:39:54

阅读数:90

评论数:0

HDU 6078 Wavel Sequence【动态规划】

题目来戳呀Problem DescriptionHave you ever seen the wave? It’s a wonderful view of nature. Little Q is attracted to such wonderful thing, he even likes ev...

2017-08-14 17:05:23

阅读数:103

评论数:0

HDU 6063 RXD and math【快速幂】【打表找规律】

题目来戳呀Problem DescriptionRXD is a good mathematician. One day he wants to calculate: output the answer module 10^9+7. 1≤n,k≤10^18 μ(n)=1(n=1)μ(n)=...

2017-08-14 16:25:22

阅读数:158

评论数:0

HDU 6097 Mindis【计算几何】

题目来戳呀Problem DescriptionThe center coordinate of the circle C is O, the coordinate of O is (0,0) , and the radius is r. P and Q are two points not o...

2017-08-14 09:59:12

阅读数:121

评论数:0

HDU 6060 RXD and dividing

题目来戳呀Problem DescriptionRXD has a tree T, with the size of n. Each edge has a cost. Define f(S) as the the cost of the minimal Steiner Tree of the s...

2017-08-12 09:54:53

阅读数:77

评论数:0

HDU 6098 Inversion【思维】

题目来戳呀Problem DescriptionGive an array A, the index starts from 1. Now we want to know Bi=maxi∤jAj , i≥2.InputThe first line of the input gives the n...

2017-08-11 09:28:15

阅读数:96

评论数:0

HDU 6059 Kanade's trio【字典树】

题目来戳呀Problem DescriptionGive you an array A[1..n],you need to calculate how many tuples (i,j,k) satisfy that (i<j<k) and (AiA_i xor AjA_j )< (AjA_...

2017-08-10 23:49:27

阅读数:130

评论数:0

HDU 6106 Classes【简单思维】

题目来戳呀Problem DescriptionThe school set up three elective courses, assuming that these courses are A, B, C. N classes of students enrolled in these co...

2017-08-10 22:58:35

阅读数:96

评论数:0

HDU 6069 Counting Divisors【素数筛】【约数个数定理】

题目来戳呀Problem DescriptionIn mathematics, the function d(n) denotes the number of divisors of positive integer n.For example, d(12)=6 because 1,2,3,4,6...

2017-08-09 23:23:41

阅读数:247

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭