自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(61)
  • 收藏
  • 关注

原创 Cow Gymnastics//队列//排位1

Word Processor//队列//排位3题目In order to improve their physical fitness, the cows have taken up gymnastics! Farmer John designates his favorite cow Bessie to coach the N other cows and to assess their ...

2020-03-12 21:55:16 234

原创 Bucket Brigade//水题//排位2

Bucket Brigade//水题//排位2题目A fire has broken out on the farm, and the cows are rushing to try and put it out! The farm is described by a 10×10 grid of characters like this: [Math Processing Error] Th...

2020-03-12 21:49:51 208

原创 Loan Repayment//二分//排位3

Loan Repayment//二分题目Farmer John owes Bessie N gallons of milk (1≤N≤1012). He has to give her the milk within K days. However, he doesn’t want to give the milk away too quickly. On the other hand, h...

2020-03-11 23:37:26 236

原创 Word Processor//队列//排位3

Word Processor//队列题目Bessie the cow is working on an essay for her writing class. Since her handwriting is quite bad, she decides to type the essay using a word processor.The essay contains N words...

2020-03-11 23:18:38 253

原创 Race//枚举//排位3

Race//枚举题目Bessie is running a race of length K (1≤K≤109) meters. She starts running at a speed of 0 meters per second. In a given second, she can either increase her speed by 1 meter per second, ke...

2020-03-11 23:13:34 117

原创 Photoshoot//枚举//排位3

Photoshoot//枚举题目Farmer John is lining up his N cows (2≤N≤103), numbered 1…N, for a photoshoot. FJ initially planned for the i-th cow from the left to be the cow numbered ai, and wrote down the perm...

2020-03-11 23:07:26 186

原创 Milk Factory//排位2

Milk Factory//暴力?题目The milk business is booming! Farmer John’s milk processing factory consists of N processing stations, conveniently numbered 1…N (1≤N≤100), and N−1 walkways, each connecting some...

2020-03-11 23:02:38 476

原创 MooBuzz//简单的数学问题//排位1

MooBuzz//简单的数学问题题目Farmer John’s cows have recently become fans of playing a simple number game called “FizzBuzz”. The rules of the game are simple: standing in a circle, the cows sequentially count...

2020-03-11 22:54:43 151

原创 Where Am I?//枚举//排位1

Where Am I?//枚举题目Farmer John has gone out for a walk down the road and thinks he may now be lost! Along the road there are N farms (1≤N≤100) in a row. Farms unfortunately do not have house numbers,...

2020-03-11 22:45:55 161

原创 Meetings//二分搜索//排位1

Meetings//二分搜索题目Two barns are located at positions 0 and L (1≤L≤109) on a one-dimensional number line. There are also N cows (1≤N≤5⋅104) at distinct locations on this number line (think of the barn...

2020-03-11 22:40:11 161

原创 Milk Visits//并查集//排位1

Milk Visits//并查集题目Farmer John is planning to build N (1≤N≤105) farms that will be connected by N−1 roads, forming a tree (i.e., all farms are reachable from each-other, and there are no cycles). Ea...

2020-03-11 22:05:22 239

转载 I Hate It//HDU - 1754//线段树

I Hate It//HDU - 1754//线段树题目很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0&l...

2020-03-03 19:57:14 170

原创 A Simple Problem with Integers//POJ - 3468//线段树

A Simple Problem with Integers//POJ - 3468//线段树题目You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number...

2020-03-03 07:45:04 88

原创 Stars//POJ - 2352//树状数组

Stars//POJ - 2352//树状数组题目Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the st...

2020-03-02 08:09:23 75

原创 Wormhole Sort//kruskal//排位3

Wormhole Sort//kruskal题目Farmer John’s cows have grown tired of his daily request that they sort themselves before leaving the barn each morning. They have just completed their PhDs in quantum physi...

2020-02-27 15:54:43 322

原创 Largest Rectangle in a Histogram//HDU - 1506

Largest Rectangle in a Histogram//HDU - 1506题目A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different he...

2020-02-26 14:24:07 134

原创 Fence Planning//并查集//排位2

Fence Planning//并查集题目Farmer John’s N cows, conveniently numbered 1…N (2≤N≤105), have a complex social structure revolving around “moo networks” — smaller groups of cows that communicate within thei...

2020-02-24 21:23:00 178

原创 Snakes//dp//排位2

Snakes//dp题目According to legend, St. Patrick banished all of the snakes in Mooland over a thousand years ago. However, snakes have since made their way back to Mooland! St. Patrick’s day was on Mar...

2020-02-24 21:14:33 122

原创 Livestock Lineup//全排列//排位1

Livestock Lineup//全排列题目Every day, Farmer John milks his 8 dairy cows, named Bessie, Buttercup, Belinda, Beatrice, Bella, Blue, Betsy, and Sue. The cows are rather picky, unfortunately, and require ...

2020-02-19 23:13:34 443

原创 Bad Hair Day//POJ - 3250//单调栈

Bad Hair Day//POJ - 3250//单调栈题目Some of Farmer John’s N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of o...

2020-02-16 19:26:42 89

原创 Sliding Window//POJ - 2823//单调队列

Sliding Window//POJ - 2823//单调队列题目An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see ...

2020-02-12 11:50:32 92

原创 Expedition//POJ - 2431//优先队列

Expedition//POJ - 2431//优先队列题目A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock and pu...

2020-02-11 10:49:40 99

原创 Round Numbers//POJ - 3252//数位dp

Round Numbers//POJ - 3252//数位dp题目The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone’ (also known as ‘Rock, Paper, Scissors’, ‘Ro, Sham, Bo’, and a h...

2020-02-10 11:49:21 110

原创 Bomb//HDU - 3555//数位dp

Bomb//HDU - 3555//数位dp题目The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the ...

2020-02-10 11:13:20 145

原创 Kejin Player//HDU - 6656//概率dp/求逆元

Kejin Player//HDU - 6656//概率dp/求逆元题目Cuber QQ always envies those Kejin players, who pay a lot of RMB to get a higher level in the game. So he worked so hard that you are now the game designer of th...

2020-02-10 10:24:34 231

原创 不要62//HDU - 2089//数位dp

不要62//HDU - 2089//数位dp题目杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有...

2020-02-08 21:19:43 129

原创 Long Path//CodeForces - 407B//dp

Long Path//CodeForces - 407B//dp题目One day, little Vasya found himself in a maze consisting of (n + 1) rooms, numbered from 1 to (n + 1). Initially, Vasya is at the first room and to get out of the ...

2020-02-07 21:41:04 148

原创 Dice//LightOJ - 1248//概率dp

Dice//LightOJ - 1248//概率dp题目Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that the dice is fair, th...

2020-02-07 17:29:53 121

原创 最少拦截系统//HDU - 1257//dp

最少拦截系统//HDU - 1257//dp题目某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就...

2020-02-07 15:50:23 109

原创 Piggy-Bank//HDU - 1114//完全背包

Piggy-Bank//HDU - 1114//完全背包题目Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money...

2020-02-05 23:32:51 99

原创 Coins//POJ - 1742//多重背包

Coins//POJ - 1742//多重背包题目People in Silverland use coins.They have coins of value A1,A2,A3…An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a ...

2020-02-04 21:39:26 64

原创 ROADS//POJ - 1724//dijkstra

ROADS//POJ - 1724//dijkstra题目N cities named with numbers 1 … N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid...

2020-02-04 12:08:34 113

原创 CD//UVA - 624//记录路径的01背包

CD//UVA - 624//记录路径的01背包题目You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is onCDs. You need to have it on tapes so the problem to solve is: you hav...

2020-02-02 13:50:03 181

原创 青蛙的约会//POJ - 1061//数论

青蛙的约会//POJ - 1061//数论题目两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,...

2020-01-31 11:28:17 69

原创 Co-prime//HDU - 4135//数论

Co-prime//HDU - 4135//数论题目Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two integers are said to be co-prime or relative...

2020-01-30 21:07:29 265

原创 Beautiful Numbers//CodeForces-300C//数论

Beautiful Numbers//CodeForces-300C//数论题目Vitaly is a very weird man. He’s got two favorite digits a and b. Vitaly calls a positive integer good, if the decimal representation of this integer only co...

2020-01-29 22:57:22 173

原创 美素数//HDU - 4548//数论

美素数//HDU - 4548//数论题目小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。  问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。  给定一个区间,你能计算出这个区间内有多少个美素数吗?Input第一行输入一个正整数T,表...

2020-01-22 12:44:21 183

原创 Revenge of GCD//HDU - 5019//数论

Revenge of GCD//HDU - 5019//数论题目In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest common measure (gcm), of ...

2020-01-16 21:54:39 1365

原创 Fedya and Maths//Codeforces 456B//数论

Fedya and Maths//Codeforces 456B//数论题目Fedya studies in a gymnasium. Fedya’s maths hometask is to calculate the following expression:(1^n + 2^n + 3^n + 4^n) mod 5for given value of n. Fedya manage...

2020-01-15 21:31:27 171

原创 k-rounding//CodeForces - 858A//数论

k-rounding//CodeForces - 858A//数论题目For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and is divisible by n.Fo...

2020-01-15 20:51:22 132

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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