- 博客(33)
- 收藏
- 关注
原创 2022牛客五一集训派对day1 G题 Counting regions
2022牛客五一集训派对day1G Counting regions题意:正的奇数边形端点两两相连,问,最后分割出多少区域,结果对1000000007取模个人思路:利用画图工具先弄出几个样例,然后根据样例归纳总结,然后推导出公式归纳总结得:ans=ai*xi+1xi是输入,i是序号a1=2d1=5dd1=5di=di-1+ddi-1ai=ai-1+di-1由:an=an-1+dn-1an-1=an-2+dn-2a2=a1+d1推得:an=a1+∑i=1n−1di\su
2022-04-30 17:21:07 457
原创 HDU - 2072 单词数 (字典树)
HDU - 2072AYIT606-2021 第十周周赛lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。Output每组只输出一个整数,其单独成行,该整数代表一篇文章里不同单词的总数。Sample Inputyou are my friend#
2021-11-15 21:39:17 235
原创 #10035. 「一本通 2.1 练习 1」Power Strings(字符串Hash)
10035. 「一本通 2.1 练习 1」Power StringsAC代码:#include<cstdio>#include<algorithm>#include<cmath>#include<map>#include<cstring>#include<iostream>using namespace std;typedef long long LL;typedef unsigned long long UL.
2021-11-03 21:29:08 371
原创 CodeForces - 1578E Easy Scheduling
CodeForces - 1578EAYIT609国庆大作战一Eonathan Eostar decided to learn the magic of multiprocessor systems. He has a full binary tree of tasks with height h. In the beginning, there is only one ready task in the tree — the task in the root. At each moment of t
2021-10-03 22:01:51 641
原创 CodeForces - 1569B Chess Tournament
CodeForces - 1569BAYIT609第一周周赛(2021)A chess tournament will be held soon, where n chess players will take part. Every participant will play one game against every other participant. Each game ends in either a win for one player and a loss for another pl
2021-09-18 23:43:52 254
原创 HDU - 7125 Master of Shuangpin
HDU - 7125AYIT609第一周周赛(2021)Problem DescriptionAs you know, there are three kinds of Chinese input methods commonly used: Wubi, Pinyin and Shuangpin. With Shuangpin, you can type any Chinese word by pressing keys only twice.Attention that:1: For p
2021-09-18 20:10:34 523
原创 【总结】AYIT-2021 609暑假集训STL专题训练
AYIT-2021 609暑假集训STL专题训练从此习题集的题中所学以及补充:1.C++ 的输入输出:头文件:<iostream >cin语句的一般格式为:cin>>变量1>>变量2>>……>>变量n;cout语句的一般格式为:cout<<表达式1<<表达式2<<……<<表达式n;若要输出一定小数位数的浮点数需要:增加头文件<iomanip> 以及cout<
2021-08-15 16:03:00 233 1
原创 HDU - 1338 Game Prediction
Game PredictionHDU - 1338AYIT-2021 609暑假集训第一周 周赛题Suppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positive integer which is at most N*M. And there are no two
2021-08-02 17:35:23 116
原创 HDU - 5747 Aaronson
AaronsonHDU - 5747AYIT-2021 609暑假集训第一周 周赛题Recently, Peter saw the equation x0+2x1+4x2+…+2mxm=n. He wants to find a solution (x0,x1,x2,…,xm) in such a manner that ∑i=0mxi is minimum and every xi (0≤i≤m) is non-negative.InputThere are multiple test c
2021-08-02 17:32:44 142
原创 HDU - 1078 FatMouse and Cheese
FatMouse and CheeseHDU - 1078AYIT-2021 609暑假集训第一周下 记忆化搜索和背包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
2021-08-01 14:51:13 99
原创 HDU - 4508 湫湫系列故事——减肥记I
湫湫系列故事——减肥记IHDU - 4508AYIT-2021 609暑假集训第一周下 记忆化搜索和背包对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增加的卡路里量。Input输入包含多组测试用例。
2021-08-01 14:45:08 85
原创 POJ - 1014 Dividing
DividingPOJ - 1014AYIT-2021 609暑假集训第一周下 记忆化搜索和背包Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value
2021-08-01 14:39:19 123
原创 POJ - 1276 Cash Machine
Cash MachinePOJ - 1276AYIT-2021 609暑假集训第一周下 记忆化搜索和背包A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k
2021-08-01 14:27:15 79
原创 HDU - 2955 Robberies
RobberiesHDU - 2955AYIT-2021 609暑假集训第一周下 记忆化搜索和背包The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrative bu
2021-08-01 12:31:25 96
原创 HDU - 2546 饭卡
饭卡HDU - 2546AYIT-2021 609暑假集训第一周下 记忆化搜索和背包电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Input多组数据。对于每组数据:第一行为正整数n,表示菜的数量。n<
2021-08-01 12:22:27 105
原创 HDU - 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活HDU - 2191AYIT-2021 609暑假集训第一周下 记忆化搜索和背包急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们
2021-08-01 12:16:48 107
原创 POJ - 1088 滑雪
滑雪POJ - 1088AYIT-2021 609暑假集训第一周下 记忆化搜索和背包Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个
2021-08-01 12:12:08 83
原创 POJ - 1579 Function Run Fun
Function Run FunPOJ - 1579AYIT-2021 609暑假集训第一周下 记忆化搜索和背包We all love recursion! Don’t we?Consider a three-parameter recursive function w(a, b, c):if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns:1if a > 20 or b > 20 or c >
2021-08-01 12:05:02 120
原创 HDU - 1495 非常可乐
非常可乐HDU - 1495AYIT-2021 609暑假集训第一周下 记忆化搜索和背包大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>0,N>0,M>
2021-08-01 11:48:37 71
原创 HDU - 1978 How many ways
How many waysHDU - 1978AYIT-2021 609暑假集训第一周下 记忆化搜索和背包这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。如上图,机器人一开始在(1,1)点,并拥有4单位
2021-07-31 17:58:48 90
原创 LibreOJ - 10003 加工生产调度
加工生产调度LibreOJ - 10003AYIT-2021 609暑假集训第一周上 搜索和贪心题目描述某工厂收到了 个产品的订单,这 个产品分别在 A、B 两个车间加工,并且必须先在 A 车间加工后才可以到 B 车间加工。某个产品 在 A,B 两车间加工的时间分别为 。怎样安排这 个产品的加工顺序,才能使总的加工时间最短。这里所说的加工时间是指:从开始加工第一个产品到最后所有的产品都已在 A,B 两车间加工完毕的时间。输入格式第一行仅—个数据 ,表示产品的数量;接下
2021-07-31 17:53:09 181
原创 UVA - 307 Sticks
SticksUVA - 307AYIT-2021 609暑假集训第一周上 搜索和贪心George took sticks of the same length and cut them randomly until all parts became at most 50 unitslong. Now he wants to return sticks to the original state, but he forgot how many sticks he had originallyand
2021-07-31 17:43:33 72
原创 UVA - 10382 Watering Grass
Watering GrassUVA - 10382AYIT-2021 609暑假集训第一周上 搜索和贪心n sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkleris installed at the horizontal center line of the strip. For each sprinkler we are given its p
2021-07-31 17:36:53 112
原创 POJ - 1328 Radar Installation
Radar InstallationPOJ - 1328AYIT-2021 609暑假集训第一周上 搜索和贪心DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, l
2021-07-31 17:23:50 164
原创 POJ - 2376 Cleaning Shifts
Cleaning ShiftsPOJ - 2376AYIT-2021 609暑假集训第一周上 搜索和贪心DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divid
2021-07-24 11:28:03 132
原创 POJ - 3069 Saruman‘s Army
Saruman’s ArmyPOJ - 3069AYIT-2021 609暑假集训第一周上 搜索和贪心DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops
2021-07-24 10:48:57 129
原创 CodeForces - 327A Flipping Game
Flipping GameCodeForces - 327AAYIT-2021 609暑假集训第一周上 搜索和贪心Iahub got bored, so he invented a game to be played on paper.He writes n integers a1, a2, …, an. Each of those integers can be either 0 or 1. He’s allowed to do exactly one move: he chooses two
2021-07-24 10:32:15 421
原创 HDU - 2612 Find a way
Find a wayHDU - 2612AYIT-2021 609暑假集训第一周上 搜索和贪心Problem DescriptionPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifenfei’s hom
2021-07-24 10:06:53 52
原创 HDU - 2102 A计划
A计划HDU - 2102AYIT-2021 609暑假集训第一周上 搜索和贪心Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表
2021-07-24 09:59:45 85
原创 HDU - 2181 哈密顿绕行世界问题
哈密顿绕行世界问题HDU - 2181AYIT-2021 609暑假集训第一周上 搜索和贪心Problem Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出
2021-07-24 09:52:40 81
原创 CodeForces - 540C Ice Cave
Ice CaveCodeForces - 540CAYIT-2021 609暑假集训第一周上 搜索和贪心You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through
2021-07-24 09:44:01 211
原创 Naruto追Sasuke
https://vjudge.net/contest/436980#problem/G题目:佐助被大蛇丸诱骗走了,鸣人在多少时间内能追上他呢?已知一张地图(以二维矩阵的形式表示)以及佐助和鸣人的位置。地图上的每个位置都可以走到,只不过有些位置上有大蛇丸的手下,需要先打败大蛇丸的手下才能到这些位置。鸣人有一定数量的查克拉,每一个单位的查克拉可以打败一个大蛇丸的手下。假设鸣人可以往上下左右四个方向移动,每移动一个距离需要花费1个单位时间,打败大蛇丸的手下不需要时间。如果鸣人查克拉消耗完了,则只可以走到没有
2021-05-10 18:52:08 183
原创 ayit大一五五欢乐赛(补题)
ayit大一五五欢乐赛BA tourist gets lost in the desert with n liters of water. He drinks positive integer units of water each day.Write a program to calculate how many different ways the tourist can drink up the water.InputThe first line contains the number of
2021-05-07 21:39:34 185
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人