CodeForces - 988F Rain and Umbrellas (dp)

题目大意: 有三个整数a,n,m,a是终点坐标,给出n个范围(l,r)表示这块区域下雨,m把伞(p,w)在点p有重量为w的伞。 小明可以携带任意数量的伞,经过下雨处时必须要撑伞,小明每走一个单位长度消耗的体力与他所携带伞的重量相同, 求小明从0~a所需消耗的最少体力,若无解则输出-1。  ...

2018-12-31 17:16:08

阅读数 40

评论数 0

Duff in the Army codeforces 588E 树上主席树+lca

Recently Duff has been a soldier in the army. Malek is her commander.Their country, Andarz Gu has n cities (numbered from 1 to n) and n - 1 bidirecti...

2018-02-14 18:42:31

阅读数 256

评论数 1

hdu 6162 Ch’s gift(主席树)

Mr. Cui is working off-campus and he misses his girl friend very much. After a whole night tossing and turning, he decides to get to his girl friend’...

2018-02-14 18:41:54

阅读数 193

评论数 0

hdu 5709 动态线段树+合并

Claris loves painting very much, so he painted a tree with beautiful colors. The tree is a rooted tree with nn nodes which are conveniently labeled b...

2018-02-14 18:41:09

阅读数 223

评论数 0

codeforces 853c (关于矩形的主席树)

Ilya is sitting in a waiting area of Metropolis airport and is bored of looking at time table that shows again and again that his plane is delayed. S...

2018-02-14 18:40:08

阅读数 192

评论数 0

FZU 2267 贪心 后缀数组

Fat brother and Maze are playing a kind of special (hentai) game with two integers. All the digits of these two integers are in the range from 1 to 9...

2018-02-14 18:39:23

阅读数 173

评论数 0

hdu 5008 (后缀数组 + rmq +二分)

题意:给出一个字符串,求出第k小的子串,并求出字符串的起止位置,如果有多个重复的子串,求出位置最靠左的子串。 思路:比赛时,想到了要用后缀数组,但是没想到如何做。 其实,因为子串是后缀的前缀,后缀数组对后缀排序的同时,也对子串进行了排序。对于每一个sa[i],会产生不同的n...

2018-02-14 18:38:20

阅读数 162

评论数 0

CodeForces - 432D 后缀数组

You have a string s = s1s2…s|s|, where |s| is the length of string s, and si its i-th character.Let’s introduce several definitions:A substring s[i.....

2018-02-14 18:37:16

阅读数 153

评论数 0

string string string hdu 6194 (后缀数组做法)

string string string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 801 Accepted Submi...

2018-02-14 18:36:28

阅读数 126

评论数 0

后缀数组+贪心+隔板法

题意:给你sa数组,就是每个排名的后缀开始下标,让你求有多少种满足要求的串,有那么一个原理,对于相邻排名的两个后缀,后缀i的首字母要不要大于i-1,的取决于,第二个字符的比较,如果i的第二个字符>i-1的,那么i的首字符必然要+1,每一个后缀只要比较第二个字符就好,因为别的都会遍历到,这个是...

2018-02-14 18:35:19

阅读数 91

评论数 0

hdu 5446 lucas + 中国剩余定理 + 快速乘 (快速乘板子,中国剩余定理板子,lucas最新板子)

On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave becau...

2018-02-14 18:33:15

阅读数 179

评论数 0

字符串hash 交换两个字符

题意:给 k个字符串,长度为n 是否存在一个串 换两个字符可以包含k个字符串正解是 n^2*k 这里是字符串hash n^2*klogk 超时,只是没有好好做过字符串hash,这里记录一下#include <bits/stdc++.h> using namespace std; ty...

2017-12-13 21:12:35

阅读数 258

评论数 1

codeforces 895B XK Segments 思维 二分

While Vasya finished eating his piece of pizza, the lesson has already started. For being late for the lesson, the teacher suggested Vasya to solve o...

2017-12-13 20:25:51

阅读数 308

评论数 0

codeforces Unusual Sequences (数论)

D. Unusual Sequences time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Count the number o...

2017-12-12 15:21:19

阅读数 184

评论数 0

codeforces Remove Extra One(思维)

C. Remove Extra One time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given a pe...

2017-12-12 10:59:20

阅读数 579

评论数 0

gym 101190A Abbreviation (模拟)

Problem A. Abbreviation Input file: abbreviation.in Output file: abbreviation.out An abbreviation (from Latin brevis, meaning short) is a shortene...

2017-12-11 00:01:08

阅读数 225

评论数 0

Archery Tournament Gym - 101630A 线段树

Problem A. Archery Tournament Time limit: 3 seconds You were invited to the annual archery tournament. You are going to compete against the best ar...

2017-12-10 10:54:49

阅读数 548

评论数 0

Wannfly 挑战赛5 D

题目描述 给定一个小写字母字符串T 求有多少长度为m的小写字母字符串S满足,T是S的一个子序列(不需要连续) 输入描述: 第一行一个字符串T 第二行一个正整数m 输出描述: 输出答案对109+7取模的值 示例1 输入 a 2 输出...

2017-12-10 10:49:12

阅读数 251

评论数 0

wannfly 挑战赛5 A

时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 65536K,其他语言131072K 64bit IO Format: %lld 题目描述 星神是来自宇宙的 所以珂朵莉也是吧 所以我就出了个题 给你一个长为n的序列a,有n*(n+1...

2017-12-10 10:47:43

阅读数 172

评论数 0

codeforces 708B (数学构造)

For each string s consisting of characters '0' and '1' one can define four integersa00, a01, a10 and a11, where axy is the number of subsequences o...

2017-12-05 19:19:11

阅读数 155

评论数 0

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