随笔分类 - 数据结构 线段树
摘要:区间计数 基准时间限制:1.5 秒 空间限制:262144 KB 分值: 80 两个数列 {An} , {Bn} ,请求出Ans, Ans定义如下: Ans:=Σni=1Σnj=i[max{Ai,Ai+1,...,Aj}=max{Bi,Bi+1,...,Bj}] 注:[ ]内表达式为真,则为1,否则
阅读全文
摘要:Color it Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Problem Description Do you like painting? Little D doesn
阅读全文
摘要:Subsequence Count Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 256000/256000 K (Java/Others) Problem Description Given a binary string S[1,..
阅读全文
摘要:String Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Problem DescriptionBob has a dictionary with N words in it.N
阅读全文
摘要:D. The Bakery Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake s
阅读全文
摘要:F. Leha and security system Bankopolis, the city you already know, finally got a new bank opened! Unfortunately, its security system is not yet workin
阅读全文
摘要:Tree Problem Description You are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are numbered from 1 to NThere are N
阅读全文
摘要:Little Devil I Problem Description There is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy thi
阅读全文
摘要:Dylans loves tree Problem Description Dylans is given a tree with N nodes.All nodes have a value A[i].Nodes on tree is numbered by 1∼N.Then he is give
阅读全文
摘要:2243: [SDOI2011]染色 Description 给定一棵有n个节点的无根树和m个操作,操作有2类: 1、将节点a到节点b路径上所有点都染成颜色c; 2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。 请你
阅读全文
摘要:D. Developing Game Pavel is going to make a game of his dream. However, he knows that he can't make it on his own so he founded a development company
阅读全文
摘要:B2. Shave Beaver! The Smart Beaver has recently designed and built an innovative nanotechnologic all-purpose beaver mass shaving machine, "Beavershave
阅读全文
摘要:C. Coloring Trees ZS the Coder and Chris the Baboon has arrived at Udayland! They walked in the park where n trees grow. They decided to be naughty an
阅读全文
摘要:D. Happy Tree Party Bogdan has a birthday today and mom gave him a tree consisting of n vertecies. For every edge of the tree i, some number xi was wr
阅读全文
摘要:Problem 2082 过路费 Problem Description 有n座城市,由n-1条路相连通,使得任意两座城市之间可达。每条路有过路费,要交过路费才能通过。每条路的过路费经常会更新,现问你,当前情况下,从城市a到城市b最少要花多少过路费。 Input 有多组样例,每组样例第一行输入两个正
阅读全文
摘要:D. Vika and Segments Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system
阅读全文
摘要:Tunnel Warfare Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description During the War of Resistance Again
阅读全文
摘要:Description You are given an array A consisting of N positive integers. You have to answer Q queries on it of following type: l r k : Let S denote the
阅读全文
摘要:Stars in Your Window Description Fleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vivid
阅读全文
摘要:E. Correct Bracket Sequence Editor Recently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as C
阅读全文

浙公网安备 33010602011771号