自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 sort自定义排序注意

https://blog.csdn.net/weixin_33766168/article/details/93787201sort写自定义函数时要注意不能恒为true,为runtimeerror

2020-03-01 02:26:16 243

原创 Pertozavodsk Winter Training Camp 2016-Problem J. Sort It!

Time limit: 1.5 secondsMemory limit: 512 mebibytesYou are given a permutation of length n: p1p_{1}p1​, p2p_{2}p2​, . . ., pnp_{n}pn​. Consider some array of length n consisting of integers between 1...

2019-10-06 23:31:47 197

原创 Pertozavodsk Winter Training Camp 2016-Problem K. Two Strings

Time limit: 2.5 secondsMemory limit: 768 mebibytesYou are given two strings S = S0S_{0}S0​S1S_{1}S1​ · · · S∣S∣−1S_{|S|−1}S∣S∣−1​and T = T0T_{0}T0​T1T_{1}T1​ · · ·T∣T∣−1T_{|T|−1}T∣T∣−1​ consisting...

2019-10-06 11:07:19 219

原创 2018-german-collegiate-programming-contest-gcpc-18-en-Problem M: Mountaineers

  The Chilean Andes have become increasingly popular as a destination for backpacking and hiking. Many parts of the Andes are quite remote and thus dangerous. Because of this, theMinistry o...

2019-09-28 17:41:23 262

原创 HDU - 6231_K-th Number

题面Alice are given an array A[1…N] with N numbers. Now Alice want to build an array B by a parameter K as following rules: Initially, the array B is empty. Consider each interval in array A. If th...

2019-09-19 14:24:52 116

原创 asia-yokohama-regional-contest-2018的K题题解

题意:A和B在打牌,B足够聪明,他能知道A的出牌顺序,现在决定B的出牌顺序,使得B出的牌能最多的比A出的牌大,如果有多个方案,则输出最大字典序题解首先我们先求出最多能几张牌大于A的出牌,然后从A的第一张牌开始尽可能的用最大的牌,同时又不会破坏最多大于的,我们可以考虑如果当前选的牌是大于A[i]的,那么如果我把选的牌再变大,则满足最多的可能性会越来越小,所以是存在单调性的,这样我们就可以...

2019-09-19 00:57:18 189

原创 牛客__小H和遗迹

链接:https://ac.nowcoder.com/acm/problem/15160来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述小H在一片遗迹中发现了一种古老而神秘的文字,这种文字也由26种字母组成,小H用小写字母来代替它们。遗迹里总共有N句话,由...

2019-09-13 15:03:27 302

原创 2019宁夏网络赛__E - 2-3-4 Tree

In computer science, a 2-3-4 tree, as a search tree, is a self-balancing data structure that is commonly used to implement dictionaries. The numbers mean a tree where every node with children (interna...

2019-09-02 00:52:19 355

原创 牛客__树的颜色

链接:https://ac.nowcoder.com/acm/problem/16547来源:牛客网时间限制:C/C++ 4秒,其他语言8秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述给定一棵树,1为根,树上每个点有一个颜色给q次询问,每次询问以x为根的子树中深度在[dep[x],dep[x]+y]之...

2019-08-30 23:16:21 465

原创 牛客__[CQOI2015]任务查询系统

链接:https://ac.nowcoder.com/acm/problem/19936来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述最近实验室正在为其管理的超级计算机编制一套任务管理系统,而你被安排完成其中的查询部分。超级计算机中的任务用三元组(Si,Ei,P...

2019-08-27 00:17:14 147

原创 牛客__[SDOI2013]森林

链接:https://ac.nowcoder.com/acm/problem/20577来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述小Z有一片森林,含有N个节点,每个节点上都有一个非负整数作为权值。初始的时候,森林中有M条边。小Z希望执行T个操作,操作有两类...

2019-08-26 20:02:48 199

原创 牛客多校__Explorer

https://ac.nowcoder.com/acm/contest/888/E题意:给你一个无向图,其中每条边都有限制的大小区间可以通过,询问从1到n总共有多少个数字可以通过(即从1到n)题解:由于m的范围很大,所以我不能单纯的跑图,所以我们可以用时间分治的思想,先把每个区间离散化,然后加入线段树中,然后跑线段树,跑的过程做并查集(即将相连的边归为一类)然后就可以查询答案了,跑完一个子...

2019-08-11 22:59:11 104

原创 牛客多校__Find the median(一颗线段树处理区间和点)

https://ac.nowcoder.com/acm/contest/887/E题意:根据所给的条件,先递推的算出n个操作的区间【l,r】,然后按顺序将l,l+1....r加入无限长数组内,然后对于每次求一个中位数,对于偶数的中位数是中间两位靠左的一位题解:这道题很明显就是离散化线段树的题,只是要处理区间和点的问题,一个离散点代表一个区间,但当加入的是点的话怎么办,本来我打算弄两颗线段树...

2019-08-11 00:43:02 149

原创 牛客多校__subsequence 1

链接:https://ac.nowcoder.com/acm/contest/885/G来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述You are given two strings s and t composed by digits (characters...

2019-08-04 17:13:08 145

原创 牛客多校__meeting

链接:https://ac.nowcoder.com/acm/contest/884/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述A new city has just been built. There'rennninteresting places...

2019-07-30 14:13:24 428

原创 牛客多校__free

链接:https://ac.nowcoder.com/acm/contest/884/J来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述Your are given an undirect connected graph.Every edge has a cos...

2019-07-30 11:44:19 206

原创 牛客多校__number

链接:https://ac.nowcoder.com/acm/contest/884/K来源:牛客网题目描述300iq loves numbers who are multiple of 300.One day he got a string consisted of numbers. He wants to know how many substrings in the str...

2019-07-29 11:11:19 186

原创 牛客多校__string

链接:https://ac.nowcoder.com/acm/contest/884/I时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述We calla,ba,ba,bnon-equivalent if and only ifa≠ba \neq ba​=banda...

2019-07-29 11:06:57 165

原创 2019hdu多校__Harmonious Army

Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 826Accepted Submission(s): 291Problem DescriptionNow, Bob is playing an interesting...

2019-07-28 10:24:08 147

原创 牛客多校__Crazy Binary String

链接:https://ac.nowcoder.com/acm/contest/883/B来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述ZYB loves binary strings (strings that only contains `0' and `1'...

2019-07-26 01:59:25 220

原创 牛客多校__Magic Line

链接:https://ac.nowcoder.com/acm/contest/883/H来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288KSpecial Judge, 64bit IO Format: %lld题目描述There are always some problems that seem simple b...

2019-07-26 01:45:56 192

原创 牛客多校__Planting Trees

链接:https://ac.nowcoder.com/acm/contest/883/F来源:牛客网时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述The semester is finally over and the summer holiday is coming. H...

2019-07-26 01:33:00 214

原创 牛客多校__Second Large Rectangle

链接:https://ac.nowcoder.com/acm/contest/882/H来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Given a N×MN×M binary matrix. Please output the size of second l...

2019-07-21 10:19:01 101

原创 牛客多校__Partition problem

链接:https://ac.nowcoder.com/acm/contest/882/F来源:牛客网时间限制:C/C++ 4秒,其他语言8秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Given 2N people, you need to assign each of them into either red...

2019-07-21 10:12:33 157

原创 牛客多校__Equivalent Prefixes

链接:https://ac.nowcoder.com/acm/contest/881/A来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述Two arrays u and v each with m distinct elements are called equ...

2019-07-19 11:19:52 85

原创 牛客多校__Fraction Comparision

链接:https://ac.nowcoder.com/acm/contest/881/J来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述Bobo has two fractions xaxa and ybyb. He wants to compare them....

2019-07-19 09:55:56 146

原创 牛客网多校__ ABBA

链接:https://ac.nowcoder.com/acm/contest/881/E来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述Bobo has a string of length 2(n + m) which consists of characte...

2019-07-19 09:40:06 146

原创 hdu6556__The World

Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 215Accepted Submission(s): 99Problem DescriptionThe World can indicate world travel...

2019-07-17 15:50:18 433

原创 牛客网__护城河

链接:https://ac.nowcoder.com/acm/contest/984/J来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述为了防止口渴的食蚁兽进入他的农场,Farmer John决定在他的农场周围挖一条护城河。农场里一共有N(8<=N<=5,...

2019-07-15 17:31:24 145

原创 牛客网__Wonderprime Brands

链接:https://ac.nowcoder.com/acm/contest/984/G来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述The cows are forever competing to see who has the best brand. The ...

2019-07-15 10:34:25 163

原创 牛客网__金币馅饼

链接:https://ac.nowcoder.com/acm/contest/984/K来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述最近,奶牛们热衷于把金币包在面粉里,然后把它们烤成馅饼。第i块馅饼中含有Ni(1<=Ni<=25)块金币,并且,这个数字...

2019-07-15 00:46:08 152

原创 牛客网__Catch That Cow

链接:https://ac.nowcoder.com/acm/contest/984/L来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述Farmer John has been informed of the location of a fugitive cow an...

2019-07-15 00:15:44 155

原创 牛客网__Protecting the Flowers

链接:https://ac.nowcoder.com/acm/contest/984/I来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cow...

2019-07-14 23:57:30 117

原创 牛客网__随机数

链接:https://ac.nowcoder.com/acm/contest/984/F来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述正如你所知,奶牛们没有手指以至于不能玩“石头剪刀布”来任意地决定例如谁先挤奶的顺序。她们甚至也不能通过仍硬币的方式。所以她们通过"...

2019-07-14 23:25:17 109

原创 牛客网__小阳买苹果

链接:https://ac.nowcoder.com/acm/contest/949/D来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述水果店里有 nn个水果排成一列。店长要求顾客只能买一段连续的水果。小阳对每个水果都有一个喜爱程度 aiai,最终的满意度为他买...

2019-07-14 15:28:35 236

原创 牛客网__Bad Hair Day

链接:https://ac.nowcoder.com/acm/contest/984/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hai...

2019-07-09 10:31:21 102

原创 牛客网__筱玛爱线段树

链接:https://ac.nowcoder.com/acm/contest/946/D来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述筱玛是一个热爱线段树的好筱玛。筱玛的爷爷马爷在游戏中被筱玛吊打了,于是他恼羞成怒,决定给筱玛出这样一道数据结构题:给定一个长...

2019-07-08 20:07:06 374

原创

https://acm.uestc.edu.cn/status/78088设dp[i][j]表示当前处理到第i块, 第i块的末尾放第i块中的第j个字母 的时候,1~i块之间的段数.转移时枚举i-1块的结尾l和i块结尾j,如果i块 没有这个l,那么dp[i][j]只能是dp[i-1][l]加 上第i块的所有不同字母数 否则,可以把第i块的l放到第一段,这样 dp[i][j]=dp[...

2019-07-07 14:30:33 130

原创 子串

https://acm.uestc.edu.cn/problem/zi-chuan/description用滚动数组做,然后dp[i][j] i表示以第i个为结尾的余数为j的方案数#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 1e7+9;...

2019-07-07 13:00:46 110

原创 序列

https://acm.uestc.edu.cn/problem/xu-lie/descriptionnlog的求最长子序列,理解自己去百度下#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 1e6+9;int a[maxn];int nn[m...

2019-07-07 11:08:57 153

空空如也

空空如也

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

TA关注的人

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