3 一只二十四节气

尚未进行身份认证

我要认证

博客号不再用了 退役

等级
TA的排名 4k+

L2-028 秀恩爱分得快 (25 point(s))

古人云:秀恩爱,分得快。互联网上每天都有大量人发布大量照片,我们通过分析这些照片,可以分析人与人之间的亲密度。如果一张照片上出现了 K 个人,这些人两两间的亲密度就被定义为 1/K。任意两个人如果同时出现在若干张照片里,他们之间的亲密度就是所有这些同框照片对应的亲密度之和。下面给定一批照片,请你分析一对给定的情侣,看看他们分别有没有亲密度更高的异性朋友?输入格式:输入在第一行给出 2 个正整...

2019-03-10 12:40:55

Monthly Expense(二分)

Monthly ExpenseFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ...

2018-10-15 11:23:15

Instability HDU - 5917(Ramsey定理)

Instability HDU - 5917Long long ago, there was a prosperous kingdom which consisted of n cities and every two cites were connected by an undirected road.However, one day a big monster attacked the k...

2018-09-25 17:11:25

K-th Number HDU - 6231(二分+尺取)

K-th Number HDU - 6231Alice are given an array A[1…N] with N numbers.Now Alice want to build an array B by a parameter K as following rules:Initially, the array B is empty. Consider each interval i...

2018-09-24 11:02:57

A Simple Stone Game HDU - 6237(分解质因子+思维)

A Simple Stone Game HDU - 6237After he has learned how to play Nim game, Bob begins to try another stone game which seems much easier.The game goes like this: one player starts the game with N piles...

2018-09-24 07:57:01

Expressions UVA - 10157(组合数学+递推)

Expressions UVA - 10157题目:给你n个括号,求合法的匹配中,深度不超过d的组合数。分析:组合,计数,dp,大整数。这个题目很像卡特兰数,不过深度有限制,可以利用卡特兰数的递推公式求解;设DP(k,d)为k对括号形成深度不超过d的合法匹配方法数;则有:DP(k,d)= Σ(DP(i,d-1)*DP(k-1-i,d)) { i 取0到 k-1 }(按卡特兰数递推,...

2018-09-23 09:09:10

Counting UVA - 10198(线性递推式)

Counting UVA - 10198题意:Gustavo数数时总是把1和4搞混,他认为4只是1的另外一种写法。给出一个整数n,Gustavo想知道有多少个数的数字之和恰好为n。例如,当n=2时,有5个数:11、14、41、44、2。分析:设dp[n]表示加和为n的组合的个数那么很明显这些组合中应该含有含1的组合,那么去掉这个1的话就是dp[n-1]的个数加上一个1,同理含2 的话有d...

2018-09-22 09:33:02

Sum HDU - 4407(容斥定理)

Sum HDU - 4407XXX is puzzled with the question below:1, 2, 3, …, n (1<=n<=400000) are placed in a line. There are m (1<=m<=1000) operations of two kinds.Operation 1: among the x-th numb...

2018-09-21 13:30:04

Balloon Robot ZOJ - 3981(思维)

Balloon Robot ZOJ - 3981The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be teams participating in the contest, and the contest will be held on a huge round table ...

2018-09-21 10:23:14

Safest Buildings ZOJ - 3993(计算几何+思维)

Safest Buildings ZOJ - 3993PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others...

2018-09-21 07:42:55

Numbers ZOJ - 3987(二进制思维+贪心)

Numbers ZOJ - 3987DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimizes their bitwise or (i.e. and should be as small as possible).InputThere are mul...

2018-09-19 12:07:08

Crusaders Quest ZOJ - 3983(思维+暴力)

Crusaders Quest ZOJ - 3983Crusaders Quest is an interesting mobile game. A mysterious witch has brought great darkness to the game world, and the only hope for your kingdom is to save the Goddesses s...

2018-09-19 07:40:59

Uva12230Crossing Rivers (数学期望)

Uva12230Crossing Rivers (数学期望)问题:You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B), but there are several ri...

2018-09-18 11:13:19

ACM-ICPC 2018 焦作网络预赛K-Transport Ship(多重背包)

ACM-ICPC 2018 焦作网络预赛K-Transport ShipThere are NNN different kinds of transport ships on the port. The ithi^{th}ith kind of ship can carry the weight of V[i]V[i]V[i] and the number of the ithi^{th}it...

2018-09-16 10:29:03

ACM-ICPC 2018 焦作网络预赛 B - Mathematical Curse(dp)

ACM-ICPC 2018 焦作网络预赛 B - Mathematical CurseA prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young, and was entangled in some mathemati...

2018-09-16 08:45:57

Computer HDU - 2196(树形DP)

Computer HDU - 2196A school bought the first computer some time ago(so this computer’s id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one o...

2018-09-15 09:53:37

Puzzled Elena HDU - 5468(dfs序+容斥定理)

Puzzled Elena HDU - 5468 Since both Stefan and Damon fell in love with Elena, and it was really difficult for her to choose. Bonnie, her best friend, suggested her to throw a question to them, and s...

2018-09-14 19:56:12

Stern-Brocot Tree HDU - 4556(法里数列长度)

Stern-Brocot Tree HDU - 4556 上图是一棵Stern-Brocot树,其生成规则如下:  从第1行到第n行,每行相邻两数a/b和c/d,产生中间数(a+c)/(b+d),置于下一行中。将一行的分数(包括0/1,1/0),进行约分简化,则每一行(包括0/1,1/0,1/1),不会出现两个相同的分数。若分子或者分母大于n,则去掉该分数,将剩下的分数,从小到大排序,得...

2018-09-14 15:54:46

Pythagoras HDU - 6211(法里数列构造+本原勾股数组+本地预处理不出来。。)

Pythagoras HDU - 6211Given a list of integers a0,a1,a2,⋯,a2k−1. Pythagoras triples over 109 are all solutions of x2+y2=z2 where x,y and z are constrained to be positive integers less than or equal t...

2018-09-14 15:08:43

Zuma HDU - 6212(区间dp)

Zuma HDU - 6212Think about the Zuma Game. You have a row of at most 200 black(0) or white(1) balls on the table at the start. Each three consecutive balls never share the same colour. You also ...

2018-09-14 09:44:45

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!