自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(420)
  • 收藏
  • 关注

原创 大都会 J Beautiful Numbers (数位dp之数位和问题)

链接:https://www.nowcoder.com/acm/contest/163/J来源:牛客网 题目描述NIBGNAUK is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is ...

2018-08-05 20:47:10 361

原创 upc 6603: ConvexScore(平面点不共线多边形计数)

6603: ConvexScore时间限制: 1 Sec  内存限制: 128 MB提交: 86  解决: 42[提交] [状态] [讨论版] [命题人:admin]题目描述You are given N points (xi,yi) located on a two-dimensional plane. Consider a subset S of the N points ...

2018-08-04 11:08:52 230

原创 upc 6616: Small Multiple (k的倍数最小位数和->最短路)

6616: Small Multiple时间限制: 1 Sec  内存限制: 512 MB提交: 368  解决: 40[提交] [状态] [讨论版] [命题人:admin]题目描述Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K.C...

2018-08-03 21:01:39 461

原创 upc 6617: Finite Encyclopedia of Integer Sequences(树的先序遍历第n/2个结点)

6617: Finite Encyclopedia of Integer Sequences时间限制: 1 Sec  内存限制: 128 MB提交: 239  解决: 42[提交] [状态] [讨论版] [命题人:admin]题目描述In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences...

2018-08-03 19:25:46 191

原创 upc 6445: 棋盘V (网络流费用流解决匹配问题)

6445: 棋盘V时间限制: 1 Sec  内存限制: 128 MB提交: 325  解决: 31[提交] [状态] [讨论版] [命题人:admin]题目描述有一块棋盘,棋盘的边长为100000,行和列的编号为1到100000。棋盘上有n个特殊格子,任意两个格子的位置都不相同。现在小K要猜哪些格子是特殊格子。她知道所有格子的横坐标和纵坐标,但并不知道对应关系。换言之,她只有...

2018-08-03 10:58:32 383 4

原创 upc 6611: Bichrome Tree (树上dp)

6611: Bichrome Tree时间限制: 1 Sec  内存限制: 128 MB提交: 132  解决: 36[提交] [状态] [讨论版] [命题人:admin]题目描述We have a tree with N vertices. Vertex 1 is the root of the tree, and the parent of Vertex i (2≤i≤N)...

2018-08-01 11:13:07 264

原创 杭电多校第三场1003 C. Dynamic Graph Matching(状压dp 处理图匹配计数)

Problem C. Dynamic Graph Matching Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 388    Accepted Submission(s): 148   Proble...

2018-07-30 23:20:34 1185 1

原创 杭电多校第三场1001 Problem A. Ascending Rating(单调栈处理滑动区间)

Problem A. Ascending RatingTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 533    Accepted Submission(s): 122 Problem DescriptionBefo...

2018-07-30 19:51:54 197

原创 upc 6902: Trie树 (状压dp)

6902: Trie树时间限制: 1 Sec  内存限制: 128 MB提交: 137  解决: 19[提交] [状态] [讨论版] [命题人:admin]题目描述字母(Trie)树是一个表示一个字符串集合中所有字符串的前缀的数据结构,其有如下特征:1.树的每一条边表示字母表中的一个字母2.树根表示一个空的前缀3.树上所有其他的节点都表示一个非空前缀,每一个节点表示的前缀...

2018-07-30 10:57:55 310

原创 upc 6605: 所罗门王的宝藏(矩阵行列规律)

6605: 所罗门王的宝藏时间限制: 1 Sec  内存限制: 128 MB提交: 109  解决: 44[提交] [状态] [讨论版] [命题人:admin]题目描述据古代传说记载,所罗门王既是智慧的代表,又是财富的象征。他建立了强大而富有的国家,聚集了大批的黄金象牙和钻石,并把这些价值连城的珍宝藏在一个神秘的地方,这就是世人瞩目的“所罗门王的宝藏”。多少个世纪以来,人们一直...

2018-07-29 22:38:01 301

原创 upc 6604: Sandglass (沙漏定时翻转询问沙量-思维!)

6604: Sandglass时间限制: 1 Sec  内存限制: 128 MB提交: 223  解决: 33[提交] [状态] [讨论版] [命题人:admin]题目描述We have a sandglass consisting of two bulbs, bulb A and bulb B. These bulbs contain some amount of sand....

2018-07-29 22:04:58 235

原创 upc 6597: Don't Be a Subsequence (字符串的最短不匹配子序列 dp)

6597: Don't Be a Subsequence时间限制: 1 Sec  内存限制: 128 MB提交: 237  解决: 45[提交] [状态] [讨论版] [命题人:admin] 题目描述A subsequence of a string S is a string that can be obtained by deleting zero or more char...

2018-07-29 10:22:20 516

原创 牛客多校第四场 C Chiaki Sequence Reloaded(数位dp)

链接:https://www.nowcoder.com/acm/contest/142/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述Chiaki is interested in an infinite sequence a1, a2, a3, ..., w...

2018-07-28 20:15:24 737

原创 upc 5727: 小奇遐想 (树状数组+dp思路)

5727: 小奇遐想时间限制: 1 Sec  内存限制: 128 MB提交: 225  解决: 35[提交] [状态] [讨论版] [命题人:admin] 题目描述撷来一缕清风飘渺方知今日书信未到窗外三月天霁垂柳新长枝条风中鸟啼犹带欢笑——《清风醉梦》小奇望着青天中的悠悠白云,开始了无限的遐想,在它的视野中,恰好有n朵高度不同的白云排成一排,他想从左到右选出四朵白云a...

2018-07-27 23:59:44 278 2

原创 杭电多校第二场1007 Naive Operations(线段树七十二变)

Naive Operations Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 502768/502768 K (Java/Others) Total Submission(s): 1215    Accepted Submission(s): 506   Problem Description ...

2018-07-26 10:57:51 210

原创 upc 6360: 词韵(字典树上dp)

6360: 词韵时间限制: 2 Sec  内存限制: 128 MB提交: 134  解决: 18[提交] [状态] [讨论版] [命题人:admin] 题目描述Adrian 很喜欢诗歌中的韵。他认为,两个单词押韵当且仅当它们的最长公共 后缀的长度至少是其中较长单词的长度减一。也就是说,单词 A 与单词 B 押韵 当且仅当 LCS(A, B) ≥ max(|A|, |B|) – ...

2018-07-26 09:16:01 710

原创 upc 6352: Multiplayer Moo(并查集+dfs处理连通块)

6352: Multiplayer Moo时间限制: 2 Sec  内存限制: 256 MB提交: 132  解决: 24[提交] [状态] [讨论版] [命题人:admin] 题目描述The cows have come up with a creative new game, surprisingly giving it the least creative name po...

2018-07-25 16:48:05 432

原创 upc 5500: 经营与开发(贪心)

5500: 经营与开发时间限制: 1 Sec  内存限制: 128 MB提交: 87  解决: 62[提交] [状态] [讨论版] [命题人:admin] 题目描述4X概念体系,是指在PC战略游戏中一种相当普及和成熟的系统概念,得名自4个同样以“EX”为开头的英语单词。eXplore(探索)eXpand(拓张与发展)eXploit(经营与开发)eXterminate(征...

2018-07-25 09:23:45 217

原创 中石油6346 Disruption(LCA 利用倍增思想维护树上最小值)

问题 H: Disruption时间限制: 1 Sec  内存限制: 128 MB提交: 12  解决: 3[提交] [状态] [讨论版] [命题人:admin] 题目描述Farmer John prides himself on running a well-connected farm. The farm is a collection of N pastures (2≤N...

2018-07-24 23:21:36 270

原创 牛客多校第二场J.farm(二进制处理矩阵标记)

链接:https://www.nowcoder.com/acm/contest/140/J来源:牛客网 题目描述White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th row...

2018-07-22 18:50:25 356

原创 CodeForces 964D Destruction of a Tree (删除树上偶度点 dfs序的巧用)

题目:http://codeforces.com/contest/964/problem/DYou are given a tree (a graph with n vertices and n - 1 edges in which it's possible to reach any vertex from any other vertex using only its edges).A...

2018-07-17 22:21:13 265

原创 uva246 10-20-30 (双端队列deque + vector模拟)

【题意】:一个游戏。共52张牌(1~10中的数字)。初始状态,按输入顺序放在 总堆里。然后从头开始,挨着拿7张,从左到右摆开,作为7堆。然后回到第一堆,以此循环着每次往一堆放一张。每放完一张牌,考虑下面的情况:1. 这一堆的头两张与尾一张之和等于10 or 20 or 302. 这一堆的头一张与尾两张之和等于10 or 20 or 303. 这一堆的尾三张之和等于10 or 20 or 30若满足...

2018-07-15 22:23:11 611

原创 HDU 5711 Ingress(状压dp 解决商旅推销员问题TSP)

IngressTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 102400/65535 K (Java/Others)Total Submission(s): 440    Accepted Submission(s): 205Problem DescriptionBrickgao, who profited from your ac...

2018-06-14 19:47:39 456

原创 UVA 536 Tree Recovery (二叉树遍历,由先序.中序求后序序列)

Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomlylooking binary trees with capital letters in the nodes.This is an example of one of her creations...

2018-06-13 09:53:54 278

原创 CodeForces 965E Short Code (字典树的缩树)

Arkady's code contains nn variables. Each variable has a unique name consisting of lowercase English letters only. One day Arkady decided to shorten his code.He wants to replace each variable name wit...

2018-06-13 09:41:33 506

原创 51nod 1079 中国剩余定理 拓展欧几里得

1079 中国剩余定理 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注一个正整数K,给出K Mod 一些质数的结果,求符合条件的最小的K。例如,K % 2 = 1, K % 3 = 2, K % 5 = 3。符合条件的最小的K = 23。Input第1行:1个数N表示后面输入的质数及模的数量。(2 <= N <= 10)第2 - N + 1行...

2018-06-03 17:08:34 162

原创 upc ABC049&ARC065 Connectivity(并查集+dfs)

6492: Connectivity时间限制: 1 Sec  内存限制: 128 MB提交: 122  解决: 30[提交][状态][讨论版][命题人:admin]题目描述There are N cities. There are also K roads and L railways, extending between the cities. The i-th road bidirection...

2018-05-30 11:59:10 425

原创 解决方法:vs2013无法启动exe程序 Error 1 error MSB8020: The build tools for v140 (Platform Toolset = 'v140')

Error 1 error MSB8020: The build tools for v140 (Platform Toolset = 'v140')解决方案:https://blog.csdn.net/sinat_20265495/article/details/53348963Error 1 error MSB8020: The build tools for v140 (Platform T...

2018-05-26 09:50:29 3964

原创 Codeforces Round #461 (Div. 2)E. Birds(dp)

题目:点击打开链接E. Birdstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputApart from plush toys, Imp is a huge fan of little yellow birds!To summon birds, I...

2018-05-09 11:29:35 324

原创 2018ACM浙江省赛 ZOJ 4029 Now Loading!!!(二分)

Now Loading!!!Time Limit: 1 Second      Memory Limit: 131072 KBDreamGrid has  integers . DreamGrid also has  queries, and each time he would like to know the value offor a given number , where , .Inpu...

2018-04-30 17:15:17 1246

原创 2018浙江省赛 ZOJ 4027 Sequence Swapping(dp)

Sequence SwappingTime Limit: 1 Second      Memory Limit: 65536 KBBaoBao has just found a strange sequence {<, >, <, >, , <, >} of length  in his pocket. As you can see, each element ...

2018-04-30 11:55:40 877

原创 中石油5157: Treasure Map(无向图dp)

5157: Treasure Map时间限制: 1 Sec  内存限制: 128 MB提交: 111  解决: 21[提交][状态][讨论版][命题人:admin]题目描述You have found a treasure map! The map leads you to several gold mines. The mines each produce gold each day, but ...

2018-04-29 11:45:40 437

原创 中石油5112: Equal Numbers(贪心模拟)

5112: Equal Numbers时间限制: 3 Sec  内存限制: 512 MB提交: 41  解决: 6[提交][状态][讨论版][命题人:admin]题目描述You are given a list of n integers a1,...,an. You can perform the following operation: choose some ai and multiply ...

2018-04-28 13:55:05 466

原创 笛卡尔树 二叉树解决序列区间询问大小关系

笛卡尔树笛卡尔树是一种同时满足二叉搜索树和堆的性质的数据结构。对于一个数组a有n个元素,可将其构造为笛卡尔树,便于解决一些数列上不好处理的问题性质树中的元素满足二叉搜索树性质,要求按照中序遍历得到的序列为原数组序列树中节点满足堆性质,节点的key值要大于其左右子节点的key值构造时间复杂度O(n),栈维护。对于数组a[],从左往右,依次扫描。因为要满足二叉树中序遍历,所以每往树中插入一个元素a[i...

2018-04-27 14:53:57 711

原创 BZOJ1009: [HNOI2008]GT考试(矩阵快速幂+dp+KMP)

1009: [HNOI2008]GT考试Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 4685  Solved: 2916[Submit][Status][Discuss]Description  阿申准备报名参加GT考试,准考证号为N位数X1X2....Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字。他的不吉利数学A1A2...

2018-04-27 14:43:31 278

原创 最大权闭合子图(RMRC2017 Open-Pit Mining)

闭合图:对于一个有向图G,存在点集合V,任取点u属于V,u的出边的另一个点也属于V,则为闭合图。理解:任取一起点,终点必定是无出度的点。最大权闭合子图:当每个点有一个权值w(有正有负),点权和最大的闭合图为最大权闭合子图。如图:最大权闭合子图为点集{3,4,5},最大权为7+0-3=4。求解方法:网络流。建立超级源点s,超级汇点t。所有点权为正数的点i,建边 s->i,容量为点权。所有点权为...

2018-04-25 13:47:23 5645 1

原创 Trouble of Tyrant (固定图边加长最短路 转 直线群最小值)

题目来源2018 ACM-ICPC 中国大学生程序设计竞赛线上赛Tyrant has a private island on the Pacific Ocean. He has built many luxury villas on the island. He flies here every vacation to enjoy life. He will drive his sports ca...

2018-04-23 15:52:06 345

原创 Column Addition(dp 加法删列)

问题 H: Column Addition时间限制: 1 Sec  内存限制: 128 MB提交: 207  解决: 41[提交][状态][讨论版][命题人:admin]题目描述A multi-digit column addition is a formula on adding two integers written like this:A multi-d

2018-04-21 11:46:29 370

原创 HDU6162(主席树)一个没调出来的代码

Ch’s giftTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2144    Accepted Submission(s): 756Problem DescriptionMr. Cui is working off-campus and...

2018-04-20 11:25:03 269 1

原创 F - Fenwick Tree Gym - 100623F (树状数组规律)

F题 :  http://codeforces.com/gym/100623/attachmentsProblem F. Fenwick TreeInput file: fenwick.inOutput file: fenwick.outTime limit: 3 secondsMemory limit: 256 megabytesFenwick tree is a data structure ...

2018-04-10 15:45:20 472

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除