
-----------数据结构
文章平均质量分 63
dxyinme
这个作者很懒,什么都没留下…
展开
-
[nowcoder]红球进黑洞
题目链接:https://ac.nowcoder.com/acm/contest/6046/C时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述在心理疏导室中有一种奇特的疏导工具,叫做红球。红球被提前分为了许多正方形小方格。每当有人来找ATB做心理疏导时,ATB就会让他去先玩红球,然后通过红球小格方的高度来判断一个人的压力程度的高低具体地讲,ATB会让该人对于一个序列执行以下操作区间求和,原创 2020-06-17 14:06:24 · 363 阅读 · 0 评论 -
[hdu6230]Palindrome
Time Limit: 6000/3000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionAlice like strings, especially long strings. For each string, she has a special evaluation system...原创 2019-10-13 22:01:10 · 206 阅读 · 0 评论 -
[codeforces813E]Army Creation
time limit per test : 2 secondsmemory limit per test : 256 megabytesAs you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known as Rage ...原创 2019-04-13 16:34:14 · 385 阅读 · 0 评论 -
[HDU3887]Counting Offspring
Time Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionYou are given a tree, it’s root is ppp, and the node is numbered from 111 to nnn. Now define f(i)f...原创 2019-03-09 15:08:29 · 164 阅读 · 0 评论 -
[BZOJ5016][Snoi2017]一个简单的询问
Time Limit: 30 SecMemory Limit: 512 MBDescription给你一个长度为NNN的序列aia_iai,1≤i≤N1≤i≤N1≤i≤N和qqq组询问,每组询问读入l1,r1,l2,r2l_1,r_1,l_2,r_2l1,r1,l2,r2,需输出get(l,r,x)get(l,r,x)get(l,r,x)表示计算区间[l,r][l,r][l,r...原创 2019-03-02 11:22:17 · 262 阅读 · 0 评论 -
[ZOJ4089]Little Sub and Isomorphism Sequences
Time Limit: 3 SecondsMemory Limit: 65536 KBLittle Sub has a sequence A1,A2,A3,...,ANA_1,A_2,A_3,...,A_NA1,A2,A3,...,AN. Now he has a problem for you.Two sequences X1,X2,X3,...,XuX_1,X_2,X_3,......原创 2019-01-20 10:29:22 · 2029 阅读 · 0 评论 -
[HDU5023]A Corrupt Mayor's Performance Art
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 100000/100000 K (Java/Others)Problem DescriptionCorrupt governors always find ways to get dirty money. Paint something, then sell the worthless p...原创 2019-01-13 19:57:25 · 211 阅读 · 0 评论 -
[HDU3966]Aragorn's Story
Time Limit: 10000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionOur protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Ara...原创 2018-12-01 09:31:26 · 428 阅读 · 0 评论 -
[BZOJ3211]花神游历各国
Time Limit: 5 SecMemory Limit: 128 MBDescriptionInputOutput每次x=1时,每行一个整数,表示这次旅行的开心度Sample Input41 100 5 551 1 22 1 21 1 22 2 31 1 4Sample Output1011111HINT对于100%的数据, n≤100000,m...原创 2018-11-28 14:53:53 · 192 阅读 · 0 评论 -
[BZOJ2038][2009国家集训队]小Z的袜子(hose)
Time Limit: 20 SecMemory Limit: 259 MBDescription作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这NNN只袜子从111到NNN编号,然后从编号LLL到RRR 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否...原创 2018-12-02 15:07:13 · 216 阅读 · 0 评论 -
[codeforces1061D]TV Shows
time limit per test : 2 secondsmemory limit per test : 256 megabytesThere are nnn TV shows you want to watch. Suppose the whole time is split into equal parts called “minutes”. The i-th of the shows...原创 2018-11-25 01:34:20 · 1003 阅读 · 0 评论 -
[codeforces1070C]Cloud Computing
time limit per test : 3 secondsmemory limit per test : 256 megabytesBuber is a Berland technology company that specializes in waste of investor’s money. Recently Buber decided to transfer its infras...原创 2018-11-21 22:13:06 · 392 阅读 · 0 评论 -
[POJ2796]Feel Good
Time Limit: 3000MS Memory Limit: 65536KCase Time Limit: 1000MS Special JudgeDescriptionBill is developing a new mathematical theory for human emotions. His recent investigations are dedicated t...原创 2018-11-01 23:07:32 · 240 阅读 · 0 评论 -
[BZOJ1047][HAOI2007]理想的正方形
Time Limit: 10 SecMemory Limit: 162 MBDescription有一个a∗ba*ba∗b的整数组成的矩阵,现请你从中找出一个n∗nn*nn∗n的正方形区域,使得该区域所有数中的最大值和最小值的差最小。 Input第一行为3个整数,分别表示a,b,na,b,na,b,n的值第二行至第a+1行每行为b个非负整数,表示矩阵中相应位置上的数。每行相邻两数之间...原创 2018-11-03 13:11:35 · 223 阅读 · 0 评论 -
[codeforces1139C]Edgy Trees
time limit per test : 2 secondsmemory limit per test : 256 megabytesYou are given a tree (a connected undirected graph without cycles) of nnn vertices. Each of the n−1n−1n−1 edges of the tree is col...原创 2019-04-05 11:45:30 · 312 阅读 · 0 评论 -
[HDU2540]遮挡判断
Time Limit: 10000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description在一个广场上有一排沿着东西方向排列的石柱子,阳光从东边以一定的倾角射来(平行光)。有的柱子可能被在他东边的高大的柱子的影子给完全遮挡住了。现在你要解决的问题是求出有多少柱子是没有被完全遮挡住的。...原创 2019-03-28 13:46:45 · 328 阅读 · 0 评论 -
[HDU2969]Skyscrapers
Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionIn a seaside village, there is an avenue of skyscrapers. Each skyscrapers is 100m wide and has cer...原创 2019-03-28 16:17:38 · 284 阅读 · 0 评论 -
[codeforces1208D]Restore Permutation
time limit per test : 2 secondsmemory limit per test : 256 megabytesAn array of integers p1,p2,…,pnp_1,p_2,…,p_np1,p2,…,pn is called a permutation if it contains each number from 111 to nnn exact...原创 2019-09-01 11:16:18 · 279 阅读 · 0 评论 -
[poj3368]Frequent values
Time Limit: 2000MS Memory Limit: 65536K分数:2100,小思维题DescriptionYou are given a sequence of n integers a1,a2,...,ana_1 , a_2 , ... , a_na1,a2,...,an in non-decreasing order. In addition to that,...原创 2019-08-16 13:42:39 · 190 阅读 · 0 评论 -
[学习]整体二分
在?看看整体二分整体二分是个啥,就是递归进行二分答案的操作,按照当前二分出的区间对询问操作和修改操作进行左右分类。有点类似于归并排序的样子,但是需要用个维护区间的数据结构来维护当前询问区间的区间的查询和修改操作,每次查询完当前区间的操作之后,需要清空之前的修改操作。整体二分可以保证会互相影响的操作可以按照顺序进行。但是本质还是离线算法。这样执行的操作时间复杂度是O(M∗log(ans)∗log...原创 2019-08-16 10:31:25 · 162 阅读 · 0 评论 -
[codeforces 1187D]Subarray Sorting
time limit per test:2 secondsmemory limit per test:256 megabytesYou are given an array a1a_1a1,a2a_2a2,…,ana_nan and an array b1b_1b1,b2b_2b2,…,bnb_nbn.For one operation you can sort in non-d...原创 2019-07-17 01:00:26 · 265 阅读 · 0 评论 -
[codeforces920E]Connected Components?
time limit per test : 2 secondsmemory limit per test : 256 megabytes分数:2100You are given an undirected graph consisting of nnn vertices and edges. Instead of giving you the edges that exist in the ...原创 2019-07-23 20:46:38 · 190 阅读 · 0 评论 -
[codeforces920F]SUM and REPLACE
time limit per test : 2 secondsmemory limit per test : 256 megabytes分数:2000Let D(x)D(x)D(x) be the number of positive divisors of a positive integer xxx. For example, D(2) = 2D(2) = 2D(2) = 2 (222 ...原创 2019-07-23 20:00:19 · 180 阅读 · 0 评论 -
[hdu6562][CCPC2018吉林站]Lovers
Problem DescriptionThe Fool comes to a cross-road, filled with energy, confidence and purpose, knowing exactly where he wants to go and what he wants to do. But he comes to a dead stop. A flowering t...原创 2019-07-18 11:17:55 · 342 阅读 · 0 评论 -
[hdu4217]Data Structure?
Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionData structure is one of the basic skills for Computer Science students, which is a particular way...原创 2019-07-06 15:11:49 · 171 阅读 · 0 评论 -
[codeforces1096F]Inversion Expectation
time limit per test : 2 secondsmemory limit per test : 256 megabytesA permutation of size nnn is an array of size nnn such that each integer from 111 to nnn occurs exactly once in this array. An inv...原创 2019-06-02 22:38:42 · 229 阅读 · 0 评论 -
[codeforces1095F]Make It Connected
time limit per test : 2 secondsmemory limit per test : 256 megabytesYou are given an undirected graph consisting of nnn vertices. A number is written on each vertex; the number on vertex iii is aia_...原创 2019-06-08 10:59:35 · 352 阅读 · 0 评论 -
[codeforces1132F]Clear the String
time limit per test : 3 secondsmemory limit per test : 256 megabytesYou are given a string sss of length nnn consisting of lowercase Latin letters. You may apply some operations to this string: in o...原创 2019-05-31 13:05:16 · 217 阅读 · 0 评论 -
[codeforces803G]Periodic RMQ Problem
time limit per test : 4 secondsmemory limit per test : 512 megabytesYou are given an array aaa consisting of positive integers and qqq queries to this array. There are two types of queries:111 lll ...原创 2019-04-25 17:59:17 · 216 阅读 · 0 评论 -
[BZOJ1113][Poi2008]海报PLA
Time Limit: 10 SecMemory Limit: 162 MBDescriptionN个矩形,排成一排. 现在希望用尽量少的矩形海报Cover住它们.Input第一行给出数字N,代表有N个矩形.N在[1,250000] 下面N行,每行给出矩形的长与宽.其值在[1,1000000000]Output最少数量的海报数.Sample Input51 21 32 2...原创 2018-10-26 19:50:05 · 280 阅读 · 0 评论 -
[BZOJ1103][POI2007]大都市meg
Time Limit: 10 SecMemory Limit: 162 MBDescription在经济全球化浪潮的影响下,习惯于漫步在清晨的乡间小路的邮递员Blue Mary也开始骑着摩托车传递邮件了。不过,她经常回忆起以前在乡间漫步的情景。昔日,乡下有依次编号为1…n的n个小村庄,某些村庄之间有一些双向的土路。从每个村庄都恰好有一条路径到达村庄1(即比特堡)。并且,对于每个村庄,它到比特...原创 2018-10-26 19:30:33 · 181 阅读 · 0 评论 -
[BZOJ4810][Ynoi2017]由乃的玉米田
Time Limit: 30 SecMemory Limit: 256 MB由乃在自己的农田边散步,她突然发现田里的一排玉米非常的不美。这排玉米一共有N株,它们的高度参差不齐。由乃认为玉米田不美,所以她决定出个数据结构题这个题是这样的:给你一个序列a,长度为n,有m次操作,每次询问一个区间是否可以选出两个数它们的差为x,或者询问一个区间是否可以选出两个数它们的和为x,或者询问一个区间是否...原创 2018-10-22 18:50:41 · 297 阅读 · 0 评论 -
[UESTC 1583]曜酱的心意
Time Limit: 3000/1000MS (Java/Others) Memory Limit: 131072/131072KB (Java/Others)Chika 说希望和我一起做学园偶像的时候,我真的很开心。——WatanabeYou 曜是千歌的青梅竹马,但是Aqours成立以后,千歌似乎总是与梨子在一起,而把曜冷落了。为了让千歌知晓自己的心意,曜酱决定做一件大事!她决定原创 2017-08-08 20:39:53 · 464 阅读 · 0 评论 -
[UESTC1284] 郭大侠的苦恼
Description 花开雷霆崖,血染伊吕波。 公元1772年。 郭大侠终于照着天行廖的叮嘱,摆出了阵型,准备带着部队与天行廖相逢于雷霆崖。 但郭大侠实在是没有把握,这个阵型是真的如天行廖所言,所向披靡,于是准备在于天行廖相逢前再确认一遍。 按照天行廖的叮嘱说,这个阵型得满足以下两个要求才能发挥最大威力: 1.这个阵型是一颗树,即n个点,n-1条边,任意两点之间都能互相到达。 2.这原创 2016-12-12 10:12:18 · 445 阅读 · 0 评论 -
[UESTC 1060]秋实大哥与快餐店
朝为田舍郎,暮登天子堂。秋实大哥从小就怀抱有远大的理想,所以他开了一家快餐店。秋实大哥根据菜的口感,给每一道菜一个唯一的CID,同时对于前来的客人,根据他们的口味喜好,秋实大哥会给每一个客人一个PID。对于一个标号为PID的客人,他对标号为CID的菜的喜爱程度为PID∧CID(∧表示按位异或),该值越大表示越喜欢。 秋实大哥实在太忙了,现在他需要你来帮忙照看一下他的店铺。Input第一行包含一个整原创 2016-10-03 10:47:36 · 475 阅读 · 0 评论 -
[UESTC 1061]秋实大哥与战争
男儿何不带吴钩,收取关山五十州。 征战天下是秋实大哥一生的梦想,所以今天他又在练习一个对战游戏。 秋实大哥命令所有士兵从左到右排成了一行来抵挡敌人的攻击。 敌方每一次会攻击一个士兵,这个士兵就会阵亡,整个阵列就会从这个位置断开;同时有的时候已阵亡的士兵会受人赢气息感染而复活。 秋实大哥想知道某一时刻某一个士兵所在的阵列的长度是多少。 Input第一行包含两个整数n,m,表示秋实大哥的士兵数原创 2016-10-03 10:53:21 · 460 阅读 · 0 评论 -
[UESTC 1074]秋实大哥搞算数
秋实大哥大学物理挂科了(误),于是在下学期的前两周的某一天要悲剧的补考。为了不给学校的挖掘机大楼做贡献,秋实大哥决定在假期里努力复习。当然,良好的计算能力也是非常必要的,毕竟是涉及计算自己做多少分的题能够通过考试的问题。现在他给自己出了一大堆长长的只有涉及整形四则运算式子,然后埋头计算结果。为了检验自己的计算能力,他请你来帮忙。Input 第一行一个整数T,表示式子的总数。 接下来每一行有一个长原创 2016-10-03 10:56:42 · 445 阅读 · 0 评论 -
[UESTC 1256]昊昊爱运动
昊昊喜欢运动 他N天内会参加M种运动(每种运动用一个[1,m]的整数表示)舍友有Q个问题,问昊昊第l天到第r天参加了多少种不同的运动。输入: 输入两个数N, M (1≤N≤2000, 1≤M≤100); 输入N个数ai表示在第i天昊昊做了第ai类型的运动; 输入一个数Q(1≤Q≤10^6) 输入Q行 每行两个数 l, r(1≤l≤r≤n)输出: 一共Q行 每一行输出一个数 表示昊昊在第原创 2016-10-22 21:35:15 · 729 阅读 · 0 评论 -
[洛谷P1631]序列合并/[codevs1245]最小的N个和
描述 有两个长度都是N的序列A和B,在A和B中各取一个数相加可以得到N^2个和,求这N^2个和中最小的N个。 输入输出格式 输入格式: 第一行一个正整数N; 第二行N个整数Ai,满足Ai<=Ai+1且Ai<=10^9; 第三行N个整数Bi, 满足Bi<=Bi+1且Bi<=10^9.【数据规模】 对于50%的数据中,满足1<=N<=1000;对于100%的数据中,满足1<=N<=1000原创 2016-08-15 14:38:43 · 1047 阅读 · 0 评论 -
[JSOI2008]最大数
题目描述现在请求你维护一个数列,要求提供以下两种操作: 1、 查询操作。 语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。 限制:L不超过当前数列的长度。 2、 插入操作。 语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所得答案插入到数列的末尾。 限制:n是整数(可原创 2016-09-14 16:38:14 · 259 阅读 · 0 评论