![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
日常
菜鸡9号
这个作者很懒,什么都没留下…
展开
-
HDU-1253 胜利大逃亡 (bfs-时间???)
Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个ABC的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每分钟能从一个坐标走到相邻的六个坐标中的其中一个.现在给你城堡的地图,请你计算出Ignatius能否在魔王回来前离开城堡(只要走到出口就算离开城堡,如果走到出口的时候魔王刚好回来也算逃亡成功),如果可原创 2020-08-15 11:04:20 · 114 阅读 · 0 评论 -
acwing 动态中位数 (对顶堆)
依次读入一个整数序列,每当已经读入的整数个数为奇数时,输出已读入的整数构成的序列的中位数。输入格式第一行输入一个整数P,代表后面数据集的个数,接下来若干行输入各个数据集。每个数据集的第一行首先输入一个代表数据集的编号的整数。然后输入一个整数M,代表数据集中包含数据的个数,M一定为奇数,数据之间用空格隔开。数据集的剩余行由数据集的数据构成,每行包含10个数据,最后一行数据量可能少于10个,数据之间用空格隔开。输出格式对于每个数据集,第一行输出两个整数,分别代表数据集的编号以及输出中位数的个数(应原创 2020-08-02 17:55:47 · 133 阅读 · 0 评论 -
Balanced Lineup (树状数组 时间???)
Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 80158 Accepted: 36581Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decide原创 2020-07-19 13:24:55 · 179 阅读 · 0 评论 -
Virtual Friends (并查集 map )
These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends’ friends, their friends’ friends’ friends, and so on), has bec原创 2020-05-16 11:39:29 · 128 阅读 · 0 评论 -
K-th Number (主席树-记录每一个瞬间!!!)
You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able to return quic...原创 2020-05-04 17:34:25 · 140 阅读 · 0 评论 -
POJ - 1274 The Perfect Stall (二分图匹配)
Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new barn are different. For the fi...原创 2020-04-19 12:32:08 · 144 阅读 · 0 评论 -
最大流 ( Dinic -- 时间都去哪了???)
Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph.InputThe first line of input contains an integer T...原创 2020-04-18 17:14:41 · 89 阅读 · 0 评论 -
C - Just a Hook (线段树-区间更新)
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length.Now Pudge wa...原创 2020-04-09 22:42:05 · 170 阅读 · 0 评论 -
Euclid's Game (博弈--有两种选择的人必赢 )
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6259 Accepted Submission(s): 2939Problem DescriptionTwo players, Stan and Ollie, play, sta...原创 2020-04-08 23:06:03 · 278 阅读 · 0 评论 -
Brackets (区间dp)
Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17618 Accepted: 9095DescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regul...原创 2020-04-08 22:31:54 · 163 阅读 · 0 评论 -
统计难题(字典树)
Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题...原创 2020-04-05 22:10:54 · 194 阅读 · 0 评论 -
dp (--寻找我的小弟-- 和我一样的了)
dp[i]=d[i-1]*a+dp[i-2]*b+c…原创 2020-04-05 16:25:12 · 79 阅读 · 0 评论 -
Xor Sum (字典树-- 数组 大?小?)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 9424 Accepted Submission(s): 3891Problem DescriptionZeus 和 Prometheus 做了一个游戏,Prometheus ...原创 2020-04-05 12:29:59 · 151 阅读 · 0 评论 -
Berland Fair CodeForces - 1073D (单调栈优化 无用???)
XXI Berland Annual Fair is coming really soon! Traditionally fair consists of n booths, arranged in a circle. The booths are numbered 1 through n clockwise with n being adjacent to 1. The i-th booths ...原创 2020-04-04 17:28:14 · 119 阅读 · 0 评论 -
女孩的研究 (马拉车)
One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:First step: girls will write a long string (only contains lower case) o...原创 2020-03-25 20:29:28 · 155 阅读 · 0 评论 -
最长回文 (Manacher 三目运算符???)
给出一个只由小写英文字符a,b,c…y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c…y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一个整数x,对应一组case,表示该组ca...原创 2020-03-25 19:51:19 · 98 阅读 · 0 评论 -
Count Subrectangles (枚举)
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n×m formed by following rule: ci,j=ai⋅bj (i.e. ai multiplied by bj). ...原创 2020-03-22 12:24:23 · 216 阅读 · 0 评论 -
Dominated Subarray (算是贪心吧 -- 数组没事别开太大会超时的哎!!!(memset))
Let’s call an array t dominated by value v in the next situation.At first, array t should have at least 2 elements. Now, let’s calculate number of occurrences of each number num in t and define it as...原创 2020-03-22 11:03:40 · 191 阅读 · 0 评论 -
Number Sequence (kmp .-)
Given two sequences of numbers : a[1], a[2], … , a[N], and b[1], b[2], … , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1] = b[2...原创 2020-03-21 11:52:39 · 89 阅读 · 0 评论 -
推式子 (用自己求自己)( % 构造新的自变量 数论么?,先乘后除(%) 要小心 )
Vasya likes to solve equations. Today he wants to solve (x div k)⋅(xmodk)=n, where div and mod stand for integer division and modulo operations (refer to the Notes below for exact definition). In this...原创 2020-03-15 12:05:24 · 110 阅读 · 0 评论 -
Harmonious Graph (并查集 —父亲为最大值)
You’re given an undirected graph with n nodes and m edges. Nodes are numbered from 1 to n.The graph is considered harmonious if and only if the following property holds:For every triple of integers ...原创 2020-03-14 21:09:08 · 185 阅读 · 0 评论 -
Find a way (双bfs、重载小于号是要全(map)!!!)
Find a wayTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 35884 Accepted Submission(s): 11404Problem DescriptionPass a year learning in H...原创 2020-03-14 11:24:14 · 104 阅读 · 0 评论 -
The Luckiest number (ksm + ksadd +数论+ euler + bug %lld?%d )
Chinese people think of ‘8’ as the lucky digit. Bob also likes digit ‘8’. Moreover, Bob has his own lucky number L. Now he wants to construct his luckiest number which is the minimum among all positiv...原创 2020-03-12 21:52:22 · 79 阅读 · 0 评论 -
Terrible Sets (单调栈)
Let N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all real numbers. wi, hi for i = 1 . . . n are some elements in N, and w0 = 0.Define set B = {< x, y > | x, y ∈...原创 2020-03-10 18:35:27 · 166 阅读 · 0 评论 -
Feel Good(单调栈)ans == 0 ?-1;
Feel GoodTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 23748 Accepted: 6480Case Time Limit: 1000MS Special JudgeDescriptionBill is developing a new mathematical theory for human em...原创 2020-03-10 17:12:25 · 117 阅读 · 0 评论 -
Prime Distance (大素数 -- 双筛)
The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of primali...原创 2020-03-08 22:00:22 · 302 阅读 · 0 评论 -
Journey Planning CodeForces (根--找相同)
Tanya wants to go on a journey across the cities of Berland. There are n cities situated along the main railroad line of Berland, and these cities are numbered from 1 to n.Tanya plans her journey as ...原创 2020-03-07 11:45:13 · 107 阅读 · 0 评论