水题之路
是奥利奥阿
世上安得两全法,不负AC不负卿
展开
-
HDU - 6739 2019CCPC秦皇岛赛区 I. Invoker(DP+思维)
问题链接:http://acm.hdu.edu.cn/showproblem.php?pid=6739问题简述:在 dota2 中有一个叫做祈求者(Invoker)的英雄,在游戏中他有三个基础技能:冰(Quas),雷(Wex),火(Exort),每施展一个技能就可以获得相应属性的一个法球(element)。但是祈求者同时最多只能有三个法球,即如果他在有三个法球的状态下又使用了某个法球技能,...原创 2019-11-12 18:45:10 · 292 阅读 · 0 评论 -
HDU - 1171 Big Event in HDU (01背包)
Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer College and Software College in 2002.Th...原创 2019-01-23 22:32:24 · 72 阅读 · 0 评论 -
CodeForces - 41A Translation (简单搜索)
The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a litt...原创 2019-01-23 22:36:12 · 183 阅读 · 0 评论 -
CodeForces - 136A Presents (简单模拟)
Little Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided to give it to somebody else as what can be more pleasant than givin...原创 2019-01-23 22:39:47 · 232 阅读 · 0 评论 -
CodeForces - 486A Calculating Function (简单模拟)
For a positive integer n let’s define a function f:f(n) = - 1 + 2 - 3 + … + ( - 1)nnYour task is to calculate f(n) for a given integer n.InputThe single line contains the positive integer n (1 ≤ ...原创 2019-01-23 22:43:29 · 193 阅读 · 0 评论 -
CodeForces - 451A Game With Sticks (找规律)
After winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made of n horizontal and m vertical sticks.An intersection point is any poin...原创 2019-01-23 22:53:43 · 232 阅读 · 0 评论 -
CodeForces - 472A Design Tutorial: Learn from Math (素数判断)
One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.For example, there is a stateme...原创 2019-01-23 23:06:36 · 98 阅读 · 0 评论 -
CodeForces - 144A Arrival of the General (简单搜索)
A Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Colonel SuperDuper. Having learned the news, the colonel ordered to all n squad soldiers to li...原创 2019-01-23 23:16:57 · 276 阅读 · 0 评论 -
CodeForces - 82A Double Cola (找规律)
Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a “Double Cola” drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks i...原创 2019-01-23 23:29:00 · 209 阅读 · 0 评论 -
CodeForces - 469A I Wanna Be the Guy (简单搜索)
There is a game called “I Wanna Be the Guy”, consisting of n levels. Little X and his friend Little Y are addicted to the game. Each of them wants to pass the whole game.Little X can pass only p leve...原创 2019-01-23 23:34:04 · 383 阅读 · 0 评论 -
CodeForces - 460A Vasya and Socks (简单模拟)
Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them a...原创 2019-01-24 12:47:30 · 133 阅读 · 1 评论 -
CodeForces - 318A Even Odds (简单模拟)
Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determined to rearrange...原创 2019-01-24 12:51:45 · 188 阅读 · 0 评论 -
CodeForces - 379A New Year Candles (简单模拟)
Vasily the Programmer loves romance, so this year he decided to illuminate his room with candles.Vasily has a candles.When Vasily lights up a new candle, it first burns for an hour and then it goes o...原创 2019-01-24 12:54:36 · 148 阅读 · 1 评论 -
CodeForces - 617A Elephant (简单模拟)
An elephant decided to visit his friend. It turned out that the elephant’s house is located at point 0 and his friend’s house is located at point x(x > 0) of the coordinate line. In one step the el...原创 2019-01-24 13:01:05 · 138 阅读 · 1 评论 -
CodeForces - 61A Ultra-Fast Mathematician (简单模拟)
Shapur was an extremely gifted student. He was great at everything including Combinatorics, Algebra, Number Theory, Geometry, Calculus, etc. He was not only smart but extraordinarily fast! He could ma...原创 2019-01-24 13:03:07 · 188 阅读 · 1 评论 -
CodeForces - 344A Magnets (简单模拟)
Mad scientist Mike entertains himself by arranging rows of dominoes. He doesn’t need dominoes, though: he uses rectangular magnets instead. Each magnet has two poles, positive (a “plus”) and negative ...原创 2019-01-24 13:06:11 · 268 阅读 · 2 评论 -
CodeForces - 268A Games (简单模拟)
Manao works on a sports TV. He’s spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms: home...原创 2019-01-24 13:10:54 · 427 阅读 · 1 评论 -
CodeForces - 119A Epic Game (最大公约数+简单模拟)
Simon and Antisimon play a game. Initially each player receives one fixed positive integer that doesn’t change throughout the game. Simon receives number a and Antisimon receives number b. They also h...原创 2019-01-24 13:14:28 · 238 阅读 · 1 评论 -
HDU - 2049 不容易系列之(4)——考新郎 (错排问题)
国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的:首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排;然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个.最后,揭开盖头,如果找错了对象就要当众跪搓衣板…看来做新郎也不是容易的事情…假设一共有N对新婚夫妇,其中有M...原创 2019-01-25 12:03:01 · 111 阅读 · 0 评论 -
CodeForces - 500A New Year Transportation (简单模拟)
New Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 × n board. People live in cells. However, it was hard to move between distinct cells, becaus...原创 2019-01-25 12:09:12 · 171 阅读 · 0 评论 -
CodeForces - 443A Anton and Letters (简单搜索)
Recently, Anton has found a set. The set consists of small English letters. Anton carefully wrote out all the letters from the set in one line, separated by a comma. He also added an opening curved br...原创 2019-01-25 12:14:16 · 244 阅读 · 0 评论 -
HDU - 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 (完全背包)
急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们...原创 2019-01-25 12:26:05 · 121 阅读 · 0 评论 -
HDU - 1016 Prime Ring Problem (判断素数+DFS)
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of fir...原创 2019-01-25 13:12:12 · 125 阅读 · 0 评论 -
HDU - 2068 RPG的错排(错排问题)
今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;…可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我们的野骆驼想都知道她们,可现在有N多人,...原创 2019-01-25 13:15:53 · 128 阅读 · 2 评论 -
CodeForces - 510A Fox And Snake (找规律)
Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.A snake is a pattern on a n by m t...原创 2019-01-25 18:16:28 · 203 阅读 · 0 评论 -
CodeForces - 268B Buttons (简单模拟,找规律)
Manao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it either s...原创 2019-01-25 18:21:27 · 245 阅读 · 0 评论 -
UVA - 11389 The Bus Driver Problem (贪心)
In a city there are n bus drivers. Also there are n morning bus routes and n afternoon bus routes with various lengths. Each driver is assigned one morning route and one evening route. For any driver,...原创 2019-01-25 18:33:55 · 172 阅读 · 0 评论 -
HDU - 1078 FatMouse and Cheese (DFS+DP)
FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid lo...原创 2019-01-25 18:37:56 · 135 阅读 · 0 评论 -
CodeForces - 509A Maximum in Table (类杨辉三角,构建数组)
An n × n table a is defined as follows:The first row and the first column contain ones, that is: ai, 1 = a1, i = 1 for all i = 1, 2, …, n.Each of the remaining numbers in the table is equal to the s...原创 2019-01-26 23:25:07 · 138 阅读 · 0 评论 -
HDU - 2181 哈密顿绕行世界问题 (DFS)
一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条...原创 2019-01-26 23:32:24 · 86 阅读 · 0 评论 -
HDU - 1213 How Many Tables (并查集)
Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...原创 2019-01-26 23:36:53 · 95 阅读 · 0 评论 -
POJ-1995 Raising Modulo Numbers (快速幂)
People are different. Some secretly read magazines full of interesting girls’ pictures, others create an A-bomb in their cellar, others like using Windows, and some like difficult mathematical games. ...原创 2019-01-22 10:39:36 · 99 阅读 · 0 评论 -
HDU - 1420 Prepared for New Acmer (快速幂)
集训进行了将近2个礼拜,这段时间以恢复性训练为主,我一直在密切关注大家的训练情况,目前为止,对大家的表现相当满意,首先是绝大部分队员的训练积极性很高,其次,都很遵守集训纪律,最后,老队员也起到了很好的带头作用,这里特别感谢为这次DP专题练习赛提供题目和测试数据的集训队队长xhd同学.特别高兴的是,跟随集训队训练的一批新队员表现非常好,进步也比较显著,特别是训练态度大大超出我的预期,我敢说,如果各...原创 2019-01-22 10:46:49 · 128 阅读 · 0 评论 -
CodeForces - 580A Kefa and First Steps (求连续不递减数列)
Kefa decided to make some money doing business on the Internet for exactly n days. He knows that on the i-th day (1 ≤ i ≤ n) he makes ai money. Kefa loves progress, that’s why he wants to know the len...原创 2019-01-22 10:53:19 · 148 阅读 · 0 评论 -
CodeForces - 479A Expression (枚举)
Petya studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was t...原创 2019-01-22 10:56:56 · 140 阅读 · 0 评论 -
CodeForces - 208A Dubstep (简单搜索)
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.Let’s ...原创 2019-01-22 11:02:19 · 171 阅读 · 0 评论 -
UVA - 424 Integer Inquiry (高精度计算)
One of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration ofpowers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.“This supercompu...原创 2019-01-22 11:08:55 · 118 阅读 · 0 评论 -
POJ - 3984 迷宫问题 (DFS)
左上角到右下角的最短路径,格式如样例所示。Sample Input0 1 0 0 00 1 0 1 00 0 0 0 00 1 1 1 00 0 0 1 0Sample Output(0, 0)(1, 0)(2, 0)(2, 1)(2, 2)(2, 3)(2, 4)(3, 4)(4, 4)问题链接:http://poj.org/problem?id=3984问题...原创 2019-01-22 11:15:52 · 152 阅读 · 0 评论 -
HDU - 1576 (扩展欧几里得)
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input21000 53...原创 2019-01-22 11:24:18 · 118 阅读 · 0 评论 -
HDU - 2099 整除的尾数 (简单模拟)
Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?Input输入数据有若干组,每组数据包含二个整数a,b(0<a<10000, 10<b<100),若遇到0 0则处理结束。Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输原创 2018-12-15 12:45:49 · 145 阅读 · 0 评论