
练习题目
文章平均质量分 91
红点雷龙XL
这个作者很懒,什么都没留下…
展开
-
【51nod】1138 连续整数的和(计算公式,思维)
1138 连续整数的和1 秒 131,072 KB 10 分 2 级题给出一个正整数N,将N写为若干个连续数字和的形式(长度 >= 2)。例如N = 15,可以写为1 + 2 + 3 + 4 + 5,也可以写为4 + 5 + 6,或7 + 8。如果不能写为若干个连续整数的和,则输出No Solution。收起输入输入1个数N(3 <= N ...原创 2019-04-10 23:01:51 · 539 阅读 · 0 评论 -
牛客练习赛34部分题解11.14
A.little w and Soda链接:https://ac.nowcoder.com/acm/contest/297/A来源:牛客网 题目描述 不知道你听没听说过这样一个脑筋急转弯。2元可以买一瓶汽水(玻璃瓶装的),因为瓶身是玻璃瓶的比较贵,所以两个瓶身可以换一瓶汽水。你现在有4元钱,问最多能喝到多少瓶汽水?答案是4瓶。一开始先用4元钱买两瓶汽水喝掉,再用这两瓶的...原创 2018-12-19 00:29:45 · 520 阅读 · 0 评论 -
11.22A 御坂美琴-优先队列模拟
链接:https://ac.nowcoder.com/acm/contest/271/A来源:牛客网 题目描述misaka是呱太爷爷的小粉丝,呱太爷爷有一句话说的好:"一尺之棰,日取其半,万世不竭"。misaka现在有 n 个呱太玩偶放在一堆,每一次操作,misaka会选择当前个数 > 1 的一堆呱太玩偶。并将这一堆呱太玩偶分成 和 两堆,x 是当前这一堆玩偶的个数。现在 m...原创 2018-11-23 23:56:23 · 415 阅读 · 0 评论 -
【洛谷】P5015 标题统计(java)
题目描述凯凯刚写了一篇美妙的作文,请问这篇作文的标题中有多少个字符? 注意:标题中可能包含大、小写英文字母、数字字符、空格和换行符。统计标题字 符数时,空格和换行符不计算在内。输入输出格式输入格式: 输入文件只有一行,一个字符串 ss。 输出格式: 输出文件只有一行,包含一个整数,即作文标题的字符数(不含空格和换行符)。 输入输出样例输入样例#1: ...原创 2018-11-18 00:23:34 · 986 阅读 · 0 评论 -
牛客小白月赛9-11.17
A.签到(除数取模转化为逆元快速幂)链接:https://ac.nowcoder.com/acm/contest/275/A来源:牛客网 你在一栋楼房下面,楼房一共有n层,第i层每秒有pi的概率会扔下一个东西并砸到你求第一秒内你被砸到的概率输入描述:第一行一个整数n之后有n行,第i+1行有两个整数ai,bi,表示输出描述:设答案为,你只需要找到一个最小的非负整数...原创 2018-11-18 00:07:05 · 450 阅读 · 0 评论 -
POJ2034Anti-prime Sequences--dfs
Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 4127 Accepted: 1857 DescriptionGiven a sequence of consecutive integers n,n+1,n+2,...,m, an anti-prime sequence is a re...原创 2018-08-11 08:26:27 · 212 阅读 · 0 评论 -
POJ2142The Balance 扩展欧几里得求解最小砝码数量
Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 8764 Accepted: 3806 DescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of...原创 2018-08-10 17:16:54 · 358 阅读 · 0 评论 -
Intense Heat-前缀和暴力求解
【题目】The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. ...原创 2018-07-31 19:28:55 · 493 阅读 · 0 评论 -
The Cow Prom -Tarjan求强连通分量-模板
题目描述The N (2 <= N <= 10,000) cows are so excited: it's prom night! They are dressed in their finest gowns, complete with corsages and new shoes. They know that tonight they will each try to pe...原创 2018-07-29 16:12:36 · 173 阅读 · 0 评论 -
Expedition -贪心+优先队列
【题目】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 puncture the truck's fuel tan...原创 2018-07-28 09:50:30 · 426 阅读 · 1 评论 -
P2850-虫洞Wormholes-bellman_ford找负环
题目描述While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time ...原创 2018-07-27 16:16:51 · 220 阅读 · 0 评论 -
P2855 ]河跳房子River Hopscotch-最大最小值-二分
题目描述Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river wit...原创 2018-07-27 11:38:46 · 241 阅读 · 0 评论 -
P2854-牛的过山车Cow Roller Coaster -dfs剪枝
题目描述The cows are building a roller coaster! They want your help to design as fun a roller coaster as possible, while keeping to the budget.The roller coaster will be built on a long linear stretch...原创 2018-07-27 10:28:58 · 238 阅读 · 0 评论 -
Cow Picnic -dfs
【题目】The cows are having a picnic! Each of Farmer John's K (1 ≤ K ≤ 100) cows is grazing in one of N (1 ≤ N ≤ 1,000) pastures, conveniently numbered 1...N. The pastures are connected by M (1 ≤ M ≤ 10...原创 2018-07-26 19:59:28 · 264 阅读 · 0 评论 -
Stall Reservations -贪心+优先队列-区间问题
【题目】Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A..B (1 <= A <= B <= 1,000,000), which includes both ...原创 2018-07-26 18:13:50 · 308 阅读 · 0 评论 -
Backward Digit Sums -全排列找解
【题目】FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer nu...原创 2018-07-26 14:56:13 · 153 阅读 · 0 评论 -
Treats for the Cows -dp
【题目】FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a g...原创 2018-07-26 13:43:10 · 199 阅读 · 0 评论 -
Dollar Dayz-完全背包+大数处理
【题目】Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer John has e...原创 2018-07-26 11:38:02 · 1530 阅读 · 0 评论 -
Roadblocks-次最短路,Dijkstra变形+邻接表存储
题目: Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the w...原创 2018-07-15 15:28:58 · 327 阅读 · 0 评论 -
Fence Repair-贪心优先队列
题目: Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (...原创 2018-07-15 13:03:44 · 267 阅读 · 0 评论 -
POJ 3273 Monthly Expense -二分区间最小的最大值
题目:Farmer 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 ≤ 10,000) tha...原创 2018-06-23 01:21:51 · 190 阅读 · 0 评论 -
22.Best Cow Line-最小的字符串
题目:FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.The contest org...原创 2018-06-12 17:15:19 · 304 阅读 · 0 评论 -
23.Exploration-取绝对值排序
题目:Bessie is traveling on a road teeming with interesting landmarks. The road is labeled just like a number line, and Bessie starts at the "origin" (x = 0). A total of N (1 ≤ N ≤ 50,000) landmarks are...原创 2018-06-09 23:52:42 · 241 阅读 · 0 评论 -
25.Avoid The Lakes-dfs
题目:Farmer John's farm was flooded in the most recent storm, a fact only aggravated by the information that his cows are deathly afraid of water. His insurance agency will only repay him, however, an a...原创 2018-06-09 17:08:30 · 172 阅读 · 0 评论 -
13.Catch that cow-bfs
题目:Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 10...原创 2018-06-09 16:13:48 · 163 阅读 · 0 评论 -
2.running-区间dp
题目: The cows are trying to become better athletes, so Bessie is running on a track for exactly N (1 ≤ N ≤ 10,000) minutes. During each minute, she can choose to either run or rest for the whole mi...原创 2018-05-30 00:54:35 · 209 阅读 · 0 评论 -
1.Cow Contest-Floyd
题目:N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is...原创 2018-05-30 00:12:45 · 231 阅读 · 0 评论