ACM
文章平均质量分 58
jian圣楠
这个作者很懒,什么都没留下…
展开
-
W4 - 食物链(POJ-1182)
题目描述Input & OutputSampleCode/* * @Description: 食物链 * @version: * @Author: * @Date: 2021-04-21 22:14:45 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-21 23:26:27 */// self// 看了提示,提交五次,一次TLE,三次WA// TLE的可能原因(不能确定):cin大原创 2021-04-22 09:44:44 · 137 阅读 · 0 评论 -
W4 - How Many Tables(HDU - 1213)
题目描述Input & OutputSampleCode/* * @Description: How Many Tables * @version: * @Author: * @Date: 2021-04-21 20:24:41 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-21 20:51:39 */// self// 提交一次,输入的所有关系中执行以下操作,若第一个编号以前未出现原创 2021-04-22 09:42:48 · 54 阅读 · 0 评论 -
W4 - The Suspects(POJ - 1611)
题目描述Input & OutputSampleCode/* * @Description: The Suspects * @version: * @Author: * @Date: 2021-04-21 18:27:35 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-21 22:21:02 */// self// 提交三次,逻辑问题#include <iostream>原创 2021-04-22 09:40:51 · 64 阅读 · 0 评论 -
W4 - Wireless Network(POJ - 2236)
题目描述Input & OutputSampleCode/* * @Description: Wireless Network * @version: * @Author: * @Date: 2021-04-21 14:16:26 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-21 15:30:56 */// self// 提交三次// ! 两次编译错误,是编译器不支持C++11新特性原创 2021-04-22 09:38:55 · 55 阅读 · 0 评论 -
W4 - Heavy Transportation(POJ - 1797)
题目描述Input & OutputSampleCode/* * @Description: Heavy Transportation * @version: * @Author: * @Date: 2021-04-21 08:53:15 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-21 10:21:05 */// self// 理解了第二题,这道题与第二题一个思路,还是Dijst原创 2021-04-22 09:36:29 · 43 阅读 · 0 评论 -
W4 - Frogger(POJ - 2253)
题目描述Input & OutputSampleCode/* * @Description: Frogger * @version: * @Author: * @Date: 2021-04-20 19:52:39 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-21 12:04:32 */// self// 提交13次。。。我都不好意思写了,看了提示// 11次都是编译错误,导致编译原创 2021-04-22 09:34:38 · 47 阅读 · 0 评论 -
W4 - Til the Cows Come Home(POJ-2387)
题目描述Input & OutputSampleCode/* * @Description: Til the Cows Come Home * @version: * @Author: * @Date: 2021-04-20 17:57:41 * @LastEditors: Please set LastEditors * @LastEditTime: 2021-04-20 19:52:52 */// self 提交8次。// 看提示// ! 有几个坑需要注意:输入原创 2021-04-22 09:32:41 · 45 阅读 · 0 评论 -
W3 - Channel Allocation
问题描述When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each repeater must be carefully chosen so that nearby repeaters do not原创 2021-04-15 20:34:38 · 63 阅读 · 0 评论 -
W3 - Catch That Cow
问题描述农夫知道一头牛的位置,想要抓住它。农夫和牛都于数轴上 ,农夫起始位于点 N(0<=N<=100000) ,牛位于点 K(0<=K<=100000) 。农夫有两种移动方式:1、从 X移动到 X-1或X+1 ,每次移动花费一分钟;2、从 X移动到 2*X ,每次移动花费一分钟;假设牛没有意识到农夫的行动,站在原地不动。最少要花多少时间才能抓住牛?Input一行: 以空格分隔的两个字母: N 和 KOutput一行: 农夫抓住牛需要的最少时间。Samp原创 2021-04-15 20:31:49 · 49 阅读 · 0 评论 -
W3 - Find The Multiple
问题描述Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100原创 2021-04-15 20:21:51 · 52 阅读 · 0 评论 -
W3 - Red and Black
题目描述有一个长方形的房间,覆盖了正方形的磁砖。每块磁砖的颜色,要么是红色,要么是黑色。一名男子站在一块黑色的磁砖上。他可以从一块磁砖移至相邻四块磁砖中的某一块。但是,他不允许在红色磁砖上移动,他只允许在黑色磁砖上移动。编写一个程序,使得他允许重复上述的移动,判断他所能到达的黑色磁砖的数量。输入输入由多个数据集组成。数据集的起始行包含了两个正整数 W 和 H;W 和 H 分别是 x- 和 y- 方向的磁砖数量。W 和 H 不超过 20 。在数据集中,还有 H 行,每行包含了 W 个字符。每个原创 2021-04-15 20:19:51 · 84 阅读 · 0 评论 -
W3 - Knight Moves
问题描述BackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him?The ProblemYour task is to write a program to calculate the minimum number of moves neede原创 2021-04-15 20:17:27 · 132 阅读 · 0 评论 -
W2 - Tallest Cow
题目描述FJ’s N (1 ≤ N ≤ 10,000) cows conveniently indexed 1…N are standing in a line. Each cow has a positive integer height (which is a bit of secret). You are told only the height H (1 ≤ H ≤ 1,000,000) of the tallest cow along with the index I of that cow.原创 2021-04-09 08:29:56 · 74 阅读 · 0 评论 -
W2 - Color the ball
题目描述N个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a b(1 <= a <= b <= N)。当N = 0,输入结束。Output原创 2021-04-09 08:29:33 · 175 阅读 · 0 评论 -
W2 - 子段求和
题目描述给出一个长度为N的数组,进行Q次查询,查询从第i个元素开始长度为l的子段所有元素之和。例如,1 3 7 9 -1,查询第2个元素开始长度为3的子段和,1 {3 7 9} -1。3 + 7 + 9 = 19,输出19。Input第1行:一个数N,N为数组的长度(2 <= N <= 50000)。 第2 至 N + 1行:数组的N个元素。(-10^9 <= Ni <= 10^9) 第N + 2行:1个数Q,Q为查询的数量。 第N + 3 至 N + Q + 2行:每原创 2021-04-09 08:29:13 · 117 阅读 · 0 评论 -
W2 -放苹果
题目描述把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample Output8Code/* * @Description: 放苹果转载 2021-04-09 08:27:48 · 91 阅读 · 0 评论 -
W2 - Parentheses Balance
题目描述You are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a) if it is the empty string(b) if A and B are correct, AB is correct,© if A is correct, (A) and [A] is correct.Write a program that takes a原创 2021-04-09 08:30:10 · 114 阅读 · 0 评论 -
W2 - Ananagrams
题目描述Most crossword puzzle fans are used to anagrams — groups of words with the same letters in differentorders — for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have thisattribute, no matter how you rearrange their letters, you c原创 2021-04-08 19:24:47 · 88 阅读 · 0 评论 -
W2 - Let the Balloon Rise
题目描述Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.原创 2021-04-08 19:17:41 · 58 阅读 · 0 评论 -
W2 - Ignatius and the Princess II
题目描述Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebub has to beat our hero first. feng5166 says, “I have three question for you, if you can work them ou原创 2021-04-08 19:14:06 · 72 阅读 · 0 评论 -
W2 - Andy‘s First Dictionary
题目描述Andy, 8, has a dream - he wants to produce hisvery own dictionary. This is not an easy task forhim, as the number of words that he knows is,well, not quite enough. Instead of thinking up allthe words himself, he has a briliant idea. Fromhis book原创 2021-04-08 19:11:20 · 99 阅读 · 0 评论 -
W2 - The Blocks Problem
题目描述InputThe input begins with an integer n on a line by itself representing the number of blocks in the blockworld. You may assume that 0 < n < 25.The number of blocks is followed by a sequence of block commands, one command per line. Yourpro原创 2021-04-08 19:07:58 · 65 阅读 · 0 评论 -
W2 - Where is the Marble?
题目描述Raju and Meena love to play with Marbles. They have got a lot ofmarbles with numbers written on them. At the beginning, Raju wouldplace the marbles one after another in ascending order of the numberswritten on them. Then Meena would ask Raju to fi原创 2021-04-08 19:05:03 · 57 阅读 · 0 评论 -
W2 - Sorting
题目描述InputThe input consists of several test cases and is terminated by end-of-file.The first line of each test case contains an integer n.The i-th of the following n lines contains 3 integers ai, bi and ci.OutputSample Input21 1 11 1 221 1原创 2021-04-08 19:01:40 · 56 阅读 · 0 评论 -
W2 - The Next Permutation
题目描述For this problem, you will write a program that takes a (possibly long) string of decimal digits, and outputs the permutation of those decimal digits that has the next larger value (as a decimal number)than the input number. For example:123 -> 1原创 2021-04-08 18:58:17 · 59 阅读 · 0 评论 -
W2 - Catch Overflow!
题目描述Gugug gives you a function f written in a basic programming language. The function accepts an integer value x. x is an integer variable and can be assigned values from 0 to 2^{32}−1. The function contains three types of commands:for n — for loop;en原创 2021-04-08 18:51:28 · 74 阅读 · 0 评论 -
W2 - Team Queue
POJ 2259 Team Queue(队列)转载 2021-04-08 18:39:41 · 73 阅读 · 0 评论 -
第十二届蓝桥杯大赛模拟赛(第四期)(A组)C++实现
最近参加了本届蓝桥杯的模拟赛,这里分享一下题目和我的思路和解,供大家参考,10道题目中,一半填空,一半编程题。前四道编程题都是简单的题目,没有涉及到算法的思考,直接使用蛮力法即可。最后一题我把题目放出来,供大家讨论学习吧。因为我觉得我的正确度不高啊。。。小题参考:第十二届蓝桥杯大赛模拟赛(第四期)python实现记忆中应该是都一样。????????????/* * @Description: 首字母大写,其他小写 * @version: * @Author: * @Date: 2021-原创 2021-04-02 22:45:31 · 422 阅读 · 0 评论 -
W1——Rail Problem
问题描述InputThe input consists of blocks of lines. Each block except the last describes one train and possibly more requirements for its reorganization. In the first line of the block there is the integer N described above. In each of the next lines of原创 2021-04-02 09:38:39 · 80 阅读 · 0 评论 -
W1——Border Problem
问题描述InputThe first line of the input file contains the number of test cases in the file. Each test case that follows consists of two lines. The first line of each case contains two integer numbers x and y specifying the starting point of the path. Th原创 2021-04-02 09:34:57 · 55 阅读 · 0 评论 -
W1——Maya Calendar Problem
问题描述During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, professor discovered that the Maya civilization used a 365 day long year, called Haab, which had 19 months. Each of t原创 2021-04-02 09:32:05 · 83 阅读 · 0 评论 -
W1——Best Cow Line Problem
问题描述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 organizers adopted a new registration scheme this year:原创 2021-04-02 09:28:18 · 46 阅读 · 0 评论 -
W1——Aggressive cows Problem
问题描述Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).His C (2 <= C <= N) cows don’t like this barn layout and become原创 2021-04-02 09:25:01 · 76 阅读 · 0 评论