自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 未完成题目

poj 2373 #include <cstdio>#include <queue>#include <deque>#define inf 1e9#define N 1000005using namespace std;queue<int> Q;deque<int> q;int f[N],n,l,a,b;boo...

2018-08-15 21:21:49 216

原创 洛谷P2023 [AHOI2009]维护序列(线段树)

[AHOI2009]维护序列题目描述 老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。 有长为N的数列,不妨设为a1,a2,…,aN 。有如下三种操作形式: (1)把数列中的一段数全部乘一个值; (2)把数列中的一段数全部加一个值; (3)询问数列中的一段数的和,由于答案可能很大,你只需输出这个数模P的值。输入输出格式 输入格式: 第一行两个整数N和P(1≤P≤1000...

2018-08-25 10:39:30 208

原创 codevs1200 同余方程(数论)

同余方程 2012年NOIP全国联赛提高组题目描述 Description 求关于 x 同余方程 ax ≡ 1 (mod b)的最小正整数解。 输入描述 Input Description 输入只有一行,包含两个正整数 a, b,用 一个 空格隔开。 输出描述 Output Description 输出只有一行包含一个正整数x0,即最小正整数解,输入数据保证一定有解。样例输...

2018-08-25 08:32:07 146

原创 洛谷P1816 忠诚(线段树)

忠诚题目描述 老管家是一个聪明能干的人。他为财主工作了整整10年,财主为了让自已账目更加清楚。要求管家每天记k次账,由于管家聪明能干,因而管家总是让财主十分满意。但是由于一些人的挑拨,财主还是对管家产生了怀疑。于是他决定用一种特别的方法来判断管家的忠诚,他把每次的账目按1,2,3…编号,然后不定时的问管家问题,问题是这样的:在a到b号账中最少的一笔是多少?为了让管家没时间作假他总是一次问多个...

2018-08-24 21:04:05 287

原创 洛谷P1962 斐波那契数列(矩阵快速幂)

斐波那契数列题目背景 大家都知道,斐波那契数列是满足如下性质的一个数列: • f(1) = 1 • f(2) = 1 • f(n) = f(n-1) + f(n-2) (n ≥ 2 且 n 为整数)题目描述 请你求出 f(n) mod 1000000007 的值。输入输出格式输入格式: ·第 1 行:一个整数 n输出格式: 第 1 行: f(n) mod 1000...

2018-08-24 15:54:57 299

原创 poj3468 A Simple Problem with Integers(分块)

A Simple Problem with IntegersDescription You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a g...

2018-08-24 11:18:52 144

原创 TYVJ1402 乌龟棋(dp)

乌龟棋题目背景 NOIP2010提高组复赛第二题题目描述 小明过生日的时候,爸爸送给他一副乌龟棋当作礼物。 乌龟棋的棋盘是一行N 个格子,每个格子上一个分数(非负整数)。棋盘第1 格是唯一 的起点,第N 格是终点,游戏要求玩家控制一个乌龟棋子从起点出发走到终点。 1 2 3 4 5 …… N 乌龟棋中M 张爬行卡片,分成4 种不同的类型(M 张卡片中不一定包含所有4 种类型 ...

2018-08-23 20:06:40 160

原创 poj1180 Batch Scheduling(dp,斜率优化)

Batch SchedulingDescription There is a sequence of N jobs to be processed on one machine. The jobs are numbered from 1 to N, so that the sequence is 1,2,…, N. The sequence of jobs must be partition...

2018-08-23 15:10:32 180

原创 TYVJ1098 任务安排1(dp)

任务安排1题目描述 N个任务排成一个序列在一台机器上等待完成(顺序不得改变),这N个任务被分成若干批,每批包含相邻的若干任务。从时刻0开始,这些任务被分批加工,第i个任务单独完成所需的时间是Ti。在每批任务开始前,机器需要启动时间S,而完成这批任务所需的时间是各个任务需要时间的总和(同一批任务将在同一时刻完成)。每个任务的费用是它的完成时刻乘以一个费用系数Fi。请确定一个分组方案,使得总费用...

2018-08-23 09:18:42 366

原创 poj1821 Fence(dp,单调队列优化)

FenceDescription A team of k (1 <= K <= 100) workers should paint a fence which contains N (1 <= N <= 16 000) planks numbered from 1 to N from left to right. Each worker i (1 <= i &l...

2018-08-23 08:29:46 478

原创 pojP2629 好消息,坏消息(单调队列)

好消息,坏消息题目描述 uim在公司里面当秘书,现在有n条消息要告知老板。每条消息有一个好坏度,这会影响老板的心情。告知完一条消息后,老板的心情等于之前老板的心情加上这条消息的好坏度。最开始老板的心情是0,一旦老板心情到了0以下就会勃然大怒,炒了uim的鱿鱼。uim为了不被炒,知道了了这些消息(已经按时间的发生顺序进行了排列)的好坏度,希望研究如何不让老板发怒。uim必须按照时间的发...

2018-08-22 20:08:52 247

原创 poj2376 Cleaning Shifts(dp,线段树优化)

Cleaning ShiftsDescription Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning thing...

2018-08-22 15:16:37 205

原创 洛谷P1438 无聊的数列(线段树,差分)

无聊的数列题目背景 无聊的YYB总喜欢搞出一些正常人无法搞出的东西。有一天,无聊的YYB想出了一道无聊的题:无聊的数列。。。(K峰:这题不是傻X题吗)题目描述 维护一个数列{a[i]},支持两种操作: 1、1 L R K D:给出一个长度等于R-L+1的等差数列,首项为K,公差为D,并将它对应加到a[L]~a[R]的每一个数上。即:令a[L]=a[L]+K,a[L+1]=a[L+1]...

2018-08-22 09:30:53 338

原创 poj3468 A Simple Problem with Integers(线段树)

A Simple Problem with IntegersDescription You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a g...

2018-08-21 20:05:35 96

原创 poj2182 Lost Cows(树状数组,二分)

Lost CowsDescription N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood ‘watering hole’ and drank a few to...

2018-08-21 19:23:08 1826

原创 [Tyvj Jan]1432楼兰图腾(树状数组)

[Tyvj Jan]楼兰图腾题目描述 在完成了分配任务之后,西部314来到了楼兰古城的西部。相传很久以前这片土地上(比楼兰古城还早)生活着两个部落,一个部落崇拜尖刀(‘V’),一个部落崇拜铁锹(‘∧’),他们分别用V和∧的形状来代表各自部落的图腾。 西部314在楼兰古城的下面发现了一幅巨大的壁画,壁画上被标记出了N个点,经测量发现这N个点的水平位置和竖直位置是两两不同的。西部314认为这幅...

2018-08-21 16:23:33 179

原创 poj1955 Parity game(带权并查集)

Parity gameDescription Now and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous subsequence (for example ...

2018-08-21 14:38:59 163

原创 洛谷P1955 [NOI2015]程序自动分析(并查集,离散化)

[NOI2015]程序自动分析题目描述 在实现程序自动分析的过程中,常常需要判定一些约束条件是否能被同时满足。 考虑一个约束满足问题的简化版本:假设x1,x2,x3…代表程序中出现的变量,给定n个形如xi=xj或xi≠xj的变量相等/不等的约束条件,请判定是否可以分别为每一个变量赋予恰当的值,使得上述所有约束条件同时被满足。例如,一个问题中的约束条件为:x1=x2,x2=x3,x3=x4,...

2018-08-21 11:06:59 123

原创 洛谷P2170 选学霸(并查集,背包)

选学霸题目描述 老师想从N名学生中选M人当学霸,但有K对人实力相当,如果实力相当的人中,一部分被选上,另一部分没有,同学们就会抗议。所以老师想请你帮他求出他该选多少学霸,才能既不让同学们抗议,又与原来的M尽可能接近输入输出格式 输入格式: 第一行,三个正整数N,M,K。 第2…K行,每行2个数,表示一对实力相当的人的编号(编号为1…N)输出格式: 一行,表示既不让同学们抗议,...

2018-08-20 21:15:52 240

原创 poj3585 Accumulation Degree(树形dp,二次扫描换根)

Accumulation DegreeDescriptionTrees are an important component of the natural landscape because of their prevention of erosion and the provision of a specific ather-sheltered ecosystem in and unde...

2018-08-20 20:25:27 415

原创 洛谷P2014 选课(树形dp)

选课题目描述 在大学里每个学生,为了达到一定的学分,必须从很多课程里选择一些课程来学习,在课程里有些课程必须在某些课程之前学习,如高等数学总是在其它课程之前学习。现在有N门功课,每门课有个学分,每门课有一门或没有直接先修课(若课程a是课程b的先修课即只有学完了课程a,才能学习课程b)。一个学生要从这些课程里选择M门课程学习,问他能获得的最大学分是多少?输入输出格式输入格式: 第一行...

2018-08-20 18:28:01 216

原创 codevs1380 没有上司的舞会(树形dp)

1380 没有上司的舞会题目描述 Description Ural大学有N个职员,编号为1~N。他们有从属关系,也就是说他们的关系就像一棵以校长为根的树,父结点就是子结点的直接上司。每个职员有一个快乐指数。现在有个周年庆宴会,要求与会职员的快乐指数最大。但是,没有职员愿和直接上司一起与会。输入描述 Input Description 第一行一个整数N。(1<=N&lt...

2018-08-20 15:50:21 191

原创 poj1742 Coins(dp)

CoinsDescription People in Silverland use coins.They have coins of value A1,A2,A3…An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nic...

2018-08-20 15:24:04 131

原创 poj1015 Jury Compromise(dp)

Jury CompromiseDescription In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a trial is set to begin, a j...

2018-08-20 14:16:52 107

原创 poj3666 Making the Grade(dp)

Making the GradeDescription A straight dirt road connects two fields on FJ’s farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a single slope, but the...

2018-08-18 15:15:19 198

原创 codevs2185 最长公共上升子序列(LCIS,dp)

最长公共上升子序列题目描述 Description 熊大妈的奶牛在小沐沐的熏陶下开始研究信息题目。小沐沐先让奶牛研究了最长上升子序列,再让他们研究了最长公共子序列,现在又让他们要研究最长公共上升子序列了。 小沐沐说,对于两个串A,B,如果它们都包含一段位置不一定连续的数字,且数字是严格递增的,那么称这一段数字是两个串的公共上升子串,而所有的公共上升子串中最长的就是最长公共上升子串了。 奶...

2018-08-18 10:50:03 121

原创 洛谷P2564 [SCOI2009]生日礼物(队列模拟)

[SCOI2009]生日礼物题目描述 小西有一条很长的彩带,彩带上挂着各式各样的彩珠。已知彩珠有N个,分为K种。简单的说,可以将彩带考虑为x轴,每一个彩珠有一个对应的坐标(即位置)。某些坐标上可以没有彩珠,但多个彩珠也可以出现在同一个位置上。小布生日快到了,于是小西打算剪一段彩带送给小布。为了让礼物彩带足够漂亮,小西希望这一段彩带中能包含所有种类的彩珠。同时,为了方便,小西希望这段彩带尽...

2018-08-17 21:23:05 126

原创 poj2823 Sliding Window(单调队列)

Sliding WindowDescription An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num...

2018-08-17 20:14:33 124

原创 poj3630 Phone List(trie)

Phone ListDescription Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:Emergen...

2018-08-17 19:21:47 106

原创 洛谷P2922 [USACO08DEC]秘密消息Secret Message(trie)

[USACO08DEC]秘密消息Secret Message题目描述 Bessie is leading the cows in an attempt to escape! To do this, the cows are sending secret binary messages to each other.Ever the clever counterspy, Farmer Joh...

2018-08-17 15:41:52 208

原创 洛谷 P3435 [POI2006]OKR-Periods of Words(kmp)

P3435 [POI2006]OKR-Periods of Words题目描述 A string is a finite sequence of lower-case (non-capital) letters of the English alphabet. Particularly, it may be an empty sequence, i.e. a sequence of 0 le...

2018-08-17 11:29:33 241

原创 poj2442 Sequence(堆)

SequenceDescription Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It’s clear that we may get n ^ m thi...

2018-08-17 11:00:26 260

原创 poj1456 Supermarket(堆,贪心)

SupermarketDescription A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units star...

2018-08-17 08:45:43 113

原创 poj3764 The xor-longest Path(trie)

The xor-longest PathDescription In an edge-weighted tree, the xor-length of a path p is defined as the xor sum of the weights of edges on p: {xor}length(p)=\oplus{e \in p}w(e) ⊕ is the xor oper...

2018-08-17 08:16:57 145

原创 poj1961 Period(kmp)

PeriodDescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. Th...

2018-08-16 16:18:35 134

原创 poj3974 Palindrome(hash,二分)

PalindromeDescription Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, “Can you propose an efficient algorithm to f...

2018-08-16 14:59:30 196

原创 poj3349 Snowflake Snow Snowflakes(hash)

Snowflake Snow SnowflakesDescriptionYou may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read informatio...

2018-08-16 09:09:14 108

原创 TYVJ1305 最大子序和(单调队列)

最大子序和描述 输入一个长度为n的整数序列,从中找出一段不超过M的连续子序列,使得整个序列的和最大。 例如 1,-3,5,1,-2,3 当m=4时,S=5+1-2+3=7 当m=2或m=3时,S=5+1=6输入格式 第一行两个数n,m(n<=3000, m<=n) 第二行有n个数,要求在n个数找到最大子序和 输出格式 一个数,数出他们的最大子序和样例1 输...

2018-08-15 14:29:21 284

原创 poj2259 Team Queue(队列)

Team QueueDescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it occurs often in everyday l...

2018-08-15 09:58:53 190

原创 poj2559 Largest Rectangle in a Histogram(单调栈)

Largest Rectangle in a HistogramDescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heig...

2018-08-14 19:44:50 77

Sobooks书单(书名+作者)

Sobooks网站中部分电子书的书名+作者数据,13000+。

2023-06-14

文本分析 停用词(txt文件,2800+)

在去除文本中无意义的字词时可以使用,内容包括特殊符号、中英文字词等。

2023-06-13

空空如也

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

TA关注的人

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