02 2017 档案
摘要:Farmer John is stuck with another problem while feeding his cows. All of his N (1 ≤ N ≤ 100,000) cows (numbered 1..N) are lined up in front of the bar
阅读全文
摘要:A Rectangular Barn Ever the capitalist, Farmer John wants to extend his milking business by purchasing more cows. He needs space to build a new barn f
阅读全文
摘要:Postal Vans Tiring of their idyllic fields, the cows have moved to a new suburb. The suburb is a rectangular grid of streets with a post office at its
阅读全文
摘要:A number, N (1 <= N < 5000), of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertic
阅读全文
摘要:Hidden Password Sometimes the programmers have very strange ways of hiding their passwords. Billy "Hacker" Geits chooses a string S composed of L (5 <
阅读全文
摘要:In order to teach her young calvess the order of the letters in the alphabet, Bessie has come up with a game to play with them. The calves are given a
阅读全文
摘要:Farmer John's cows like to keep in touch via email so they have created a network of cowputers so that they can intercowmunicate. These machines route
阅读全文
摘要:This problem requires you to write a program that performs character recognition. Each ideal character image has 20 lines of 20 digits. Each digit is
阅读全文
摘要:1001: [BeiJing2006]狼抓兔子 Description 现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的, 而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(N,M)(上图中N=4
阅读全文
摘要:You have won a contest sponsored by an airline. The prize is a ticket to travel around Canada, beginning in the most western point served by this airl
阅读全文
摘要:Farmer John wants to place a big square barn on his square farm. He hates to cut down trees on his farm and wants to find a location for his barn that
阅读全文
摘要:A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools t
阅读全文
摘要:You've just be assigned the project of implemented a windowing interface. This windowing interface is fairly simple, and fortunately, you don't have t
阅读全文
摘要:蚂蚁(ant.pas/c/cpp)题目大意在平面上有 N 只蚂蚁 N 个树洞,每个树洞只能容纳下一只蚂蚁,蚂蚁们都是直线行走的。 现在蚂蚁们希望能进入树洞中, 希望你能构造出一种方案使得任意两个蚂蚁的路线不相交。保证不会出现三点共线的情况。对于有多种不同的解,输出任意一组即可。无解时,输出-1。输入
阅读全文
摘要:斐波那契(fib.pas/c/cpp)题目大意众所周知,斐波那契数列就是 F(n)=F(n-1)+F(n-2),F(1)=F(2)=1,然后大小为 n 的一维斐波那契表就是 F(1),F(2),F(3),F(4)…F(n)。我们定义二维的斐波那契表的第(i,j)个位置也就是a(i,j)=F(i+j-
阅读全文
摘要:巧克力(chocolate.pas/c/cpp)题目大意现在有一块巧克力,大小为 n*m。现在要把它掰成 n*m 块 1*1 的小块。每次你可以选择一块巧克力,横着或者竖着把它掰成两块。求掰巧克力的最小次数。输入文件输入文件为 chocolate.in。输入第一行为 T,代表有 T 组数据。接下来
阅读全文
摘要:摩天大楼(dom.pas/c/cpp)题目大意在数轴上有 N 栋摩天大楼,第 i 栋的位置为 Xi,高度为 Hi,现在你需要推倒所有的摩天大楼。你每次可以选择炸毁一个大楼使得它往左边倒下去,或者往右边倒下去,在一栋摩天大楼倒下去的时候,有可能顺带推倒了一些其他的摩天大楼。第 i 栋大楼向左倒会将所有
阅读全文
摘要:————————————————————题解 统计这一列或行放通道能隔开几个人,然后贪心 输出没有排序QWQ
阅读全文
摘要:——————————————————————————题解 路径的长度是1-200000 然后路径的条数有n*(n+1)/2 根据鸽巢原理n*(n+1)/2 > 200000就一定是YES 所以复杂度只有n^2
阅读全文
摘要:————————————————————————————————————————题解 唯一没有想出来的题 我们发现以上两种操作 a0,a3,a6,a9……的相对位置不变 a1,a4,a7,a10……的相对位置不变 a2,a5,a8,a12……的相对位置不变 所以只要记下a0,a1,a2最后的位置,就
阅读全文
摘要:————————————————————————————————————————————题解 把最短路处理出来然后做背包 没有把head数组和all初始化qwq
阅读全文
摘要:Farmer John must measure Q (1 <= Q <= 20,000) quarts of his finest milk and deliver it in one big bottle to a customer. He fills that bottle with exac
阅读全文
摘要:Sally Snail likes to stroll on a N x N square grid (1 <n <= 120). She always starts in the upper left corner of the grid. The grid has empty squares (
阅读全文
摘要:Farmer John wishes to build a fence to contain his cows, but he's a bit short on cash right. Any fence he builds must contain all of the favorite graz
阅读全文
摘要:相当于在背包上面挂vector,这样我们就可以求出容量为j所有k优解 转移是把dp[i-1][j][k] 和 dp[i-1][j-w[i]][k]向dp[i][j][k]上转移,因为这两个地方的k优解的2k个解里一定含有dp[i][j]的k优解,而且这两个序列有单调性 可以直接把所有数赋为-inf然
阅读全文
摘要:24 星球的末日【问题描述】24 星球的世界末日就要到了 , 可是诺亚方舟还没有制造完成 。 为了制造诺亚方舟这个星球上的所有国家都站在统一战线 。 现在一共有n个国家 , 一个国家到另一个国家都有一条且仅有一条通信渠道,且这个渠道有一个距离,这样就形成了一个有向完全图。 。 世界末日的预兆已经来了
阅读全文
摘要:A musical melody is represented as a sequence of N (1 <= N <= 5000) notes that are integers in the range 1..88, each representing a key on the piano.
阅读全文
摘要:High up in the night sky, the shining stars appear in clusters of various shapes. A cluster is a non-empty group of neighbouring stars, adjacent in ho
阅读全文
摘要:Consider the following five picture frames shown on an 9 x 8 array: Now place all five picture frames on top of one another starting with 1 at the bot
阅读全文
摘要:The Shuttle Puzzle of size 3 consists of 3 white marbles, 3 black marbles, and a strip of wood with 7 holes. The marbles of the same color are placed
阅读全文
摘要:Letter games are popular at home and on television. In one version of the game, every letter has a value, and you collect letters to form one or more
阅读全文
摘要:Figure 1 gives an example of a course for a street race. You see some points, labeled from 0 to N (here, N=9), and some arrows connecting them. Point
阅读全文
摘要:1036: [ZJOI2008]树的统计Count Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点
阅读全文

浙公网安备 33010602011771号