![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
寒训
ischanx
GDUT本科毕业,前端
展开
-
[POJ - 3061] Subsequence(尺取法)
[POJ - 3061] Subsequence此题要寻找最小长度的连续子序列和最大值(尺取法)原创 2019-02-01 14:24:21 · 187 阅读 · 0 评论 -
Taming the Herd
DescriptionEarly in the morning, Farmer John woke up to the sound of splintering wood. It was the cows, and they were breaking out of the barn again!Farmer John was sick and tired of the cows' mor...原创 2019-03-16 21:58:47 · 105 阅读 · 0 评论 -
[USACO18DEC] Back and Forth
DescriptionFarmer John has two milking barns, each of which has a large milk tank as well as a storage closet containing10 buckets of various sizes. He likes to carry milk back and forth between t...原创 2019-03-16 22:21:29 · 460 阅读 · 0 评论 -
[USACO18FEB] Rest Stops(贪心)
DescriptionFarmer John and his personal trainer Bessie are hiking up Mount Vancowver. For their purposes (and yours), the mountain can be represented as a long straight trail of lengthLmeters (1≤L...原创 2019-03-16 22:34:33 · 327 阅读 · 0 评论 -
Teleportation
DescriptionOne of the farming chores Farmer John dislikes the most is hauling around lots of cow manure. In order to streamline this process, he comes up with a brilliant invention: the manure telep...原创 2019-03-16 22:45:46 · 149 阅读 · 0 评论 -
[USACO18OPEN] Out of Sorts S
DescriptionKeeping an eye on long term career possibilities beyond the farm, Bessie the cow has started learning algorithms from various on-line coding websites.Her favorite algorithm thus far is ...原创 2019-03-16 22:54:03 · 119 阅读 · 0 评论 -
[USACO] Team Tic Tac Toe
DescriptionFarmer John owns 26 cows, which by happenstance all have names starting with different letters of the alphabet, so Farmer John typically refers to each cow using her first initial – a cha...原创 2019-03-16 23:06:13 · 431 阅读 · 0 评论 -
[USACO18OPEN] Lemonade Line
DescriptionIt's a hot summer day out on the farm, and Farmer John is serving lemonade to hisNcows! AllNcows (conveniently numbered1…N) like lemonade, but some of them like it more than others. ...原创 2019-03-16 23:13:44 · 243 阅读 · 0 评论 -
[HDU - 2256] Problem of Precision(矩阵快速幂)
InputThe first line of input gives the number of cases, T. T test cases follow, each on a separate line. Each test case contains one positive integer n. (1 <= n <= 10^9)OutputFor each i...原创 2019-03-16 23:39:20 · 92 阅读 · 0 评论 -
[HDU - 4548] 美素数
Description小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 =11也是素数,所以它是美素数。给定一个区间,你能计算出这个区间内有多少个美素数吗?Input第一行输入一个正整数T,表示总共有T组数据(T &l...原创 2019-03-16 23:46:57 · 127 阅读 · 0 评论 -
[HDU - 2710] Max Factor
Problem DescriptionTo improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is u...原创 2019-03-16 23:56:15 · 174 阅读 · 0 评论 -
[USACO18DEC] Mixing Milk (模拟)
解析题意:有三只桶,读入桶的容量和初始牛奶量。然后他将桶1的牛奶倒入桶2,然后将桶2中的牛奶倒入桶3,然后将桶3中的牛奶倒入桶1,然后再将桶1的牛奶倒入桶2,如此周期性地操作,共计进行100次。最后输出三个桶的牛奶量。每次保证直到前一个桶被倒空或是后一个桶被倒满。思路:模拟倒牛奶过程就好了原创 2019-03-14 13:04:27 · 764 阅读 · 0 评论 -
[USACO18DEC] Mooyo Mooyo (DFS+码量)
洛谷传送:点击传送(中文题面)这题题面看不懂的时候,看下note会好很多DescriptionWith plenty of free time on their hands (or rather, hooves), the cows on Farmer John's farm often pass the time by playing video games. One of thei...原创 2019-03-14 12:47:54 · 272 阅读 · 0 评论 -
[USACO18DEC] The Bucket List
洛谷传送:点击传送(中文题面)题意:有N头奶牛,每头奶牛产奶开始时间si,结束时间ti,需要桶bi,求最少需要多少只桶能满足所有奶牛需求。看数据可知道时间最多为1000,所以可以直接按每一刻时间来分析。思路:枚举每一个时间需要的桶,寻找最大值即为答案。#include<iostream>#include<cstdio>#include<cst...原创 2019-03-14 12:21:47 · 475 阅读 · 0 评论 -
[POJ - 2100] Graveyard Design(尺取法)
尺取法:不满足条件右端点右移(+),否则左端点右移(-)也可记成 满减少加原创 2019-02-01 15:00:10 · 222 阅读 · 0 评论 -
[HYSBZ - 1734] Aggressive cows 愤怒的牛(二分)
1734: [Usaco2005 feb]Aggressive cows 愤怒的牛DescriptionFarmer John has built a new long barn, with N (2 &amp;amp;amp;amp;lt;= N &amp;amp;amp;amp;lt;= 100,000)stalls. The stalls are located along a straight line at positionsx1,…,xN...原创 2019-02-01 15:38:50 · 291 阅读 · 0 评论 -
[Gym - 101375H]MaratonIME gets candies(交互+二分)
一个猜数字游戏。非常有趣的交互题目,你猜电脑给的是什么数字,然后电脑回答你他的数(answer)和你的数(guess)的关系。原创 2019-02-01 16:14:43 · 333 阅读 · 0 评论 -
[Codeforces 115B] Lawnmower
题目传送门:点击传送Time limit per test:2 secondsMemory limit per test:256 megabytesDescriptionYou have a garden consisting entirely of grass and weeds. Your garden is described by ann × mgrid, with...原创 2019-03-02 12:01:53 · 249 阅读 · 1 评论 -
[Codeforces 1015E1] Stars Drawing (Easy Edition)
题目传送门:点击传送Time limit per test:3 secondsMemory limit per test:256 megabytesDescriptionAstaris a figure of the following type: an asterisk character '*' in the center of the figure and four ...原创 2019-03-01 22:16:52 · 388 阅读 · 0 评论 -
[Codeforces80B] Depression
题目传送门:点击传送Time limit per test:1 secondMemory limit per test:256 megabytesDescriptionDo you remember a kind cartoon "Beauty and the Beast"? No, no, there was no firing from machine guns or ra...原创 2019-02-20 15:26:49 · 170 阅读 · 0 评论 -
[POJ - 1979] Red and Black(DFS)
题意:从'@'开始走能到达多少个'.',注意'#'是障碍,被它围起来的'.'是走不了的。原创 2019-02-20 14:23:59 · 169 阅读 · 0 评论 -
[Codeforces 948A] Protect Sheep (DFS)
题目传送门:点击传送Time limit per test:1 secondMemory limit per test:256 megabytesDescriptionBob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf at...原创 2019-02-20 14:56:25 · 253 阅读 · 0 评论 -
[POJ - 2386] Lake Counting (简单的DFS)
一个鱼塘定义:一个W和它八连通方向(上下左右+四个45度方向)连成的一块W算一个鱼塘。如样例,有三块W,所以是三个鱼塘。比较明显的一个图的搜索,这题我用DFS的做法。原创 2019-02-20 12:47:20 · 256 阅读 · 0 评论 -
[Codeforces 500C] New Year Book Reading (贪心?)
解析题意:给n本书你,每本书对应一个重量。要看m天的书,当天要看的书需要放在表面。如果当天要看的书被压着,就要抽起上面的书(lift),最后算总共lift的最小值。(具体过程可看Hint图片)思路:想要lift最小,自然就是把要看的书放在前面。按照看书的顺序(第一次出现)排好顺序,然后模拟过程,得到的即为答案。原创 2019-03-14 11:08:52 · 104 阅读 · 0 评论 -
[LightOJ - 1282] Leading and Trailing
DescriptionYou are given two integers:nandk, your task is to find the most significant three digits, and least significant three digits ofnk.InputInput starts with an integerT (≤ 1000), den...原创 2019-03-17 10:44:08 · 98 阅读 · 0 评论