自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 字符串hash 交换两个字符

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

2017-12-13 21:12:35 495 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 one interesting problem. Vasya has an array a and int

2017-12-13 20:25:51 566

原创 codeforces Unusual Sequences (数论)

D. Unusual Sequences time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Count the number of distinct sequences a1, a2, …, an (1 ≤ ai) consisti

2017-12-12 15:21:19 399

原创 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 permutation p of length n. Remove one element from per

2017-12-12 10:59:20 865

原创 gym 101190A Abbreviation (模拟)

Problem A. Abbreviation Input file: abbreviation.in Output file: abbreviation.out An abbreviation (from Latin brevis, meaning short) is a shortened form of a word or phrase. In this problem you mus

2017-12-11 00:01:08 639

原创 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 archers from all of the Northern Eurasia. This year,

2017-12-10 10:54:49 972

原创 Wannfly 挑战赛5 D

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

2017-12-10 10:49:12 584

原创 wannfly 挑战赛5 A

时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 65536K,其他语言131072K64bit IO Format: %lld题目描述星神是来自宇宙的所以珂朵莉也是吧所以我就出了个题给你一个长为n的序列a,有n*(n+1)/2个子区间,问这些子区间里面和为完全平方数的子区间个数输入描述:第一行一个数n第二行

2017-12-10 10:47:43 402

原创 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 of length 2 of the string s equal to the sequence 

2017-12-05 19:19:11 366

转载 知道年月日求星期几

转:http://blog.csdn.net/minyuanxiani/article/details/22890447#include using namespace std;int arr[1010],arr1[1010];/* *******************************************************************

2017-12-05 00:15:16 2577

原创 codeforces 897C Nephren gives a riddle 递归

递归好题啊What are you doing at the end of the world? Are you busy? Will you save us?Nephren is playing a game with little leprechauns.She gives them an infinite array of strings, f0...

2017-12-04 22:09:50 491

原创 codeforces 724D 思维

题意:给你一个字符串,让你从中选出一串字符,使得这串字符的sort后字典序最小,选字符的要求是如果上一个选的是i 那么[i+1,i+m]中至少选一个,[1,m]中必须选一个首先每次 在1,m里面选择最小的选择了以后,起点位置移动到这里,再次找下一个m范围内的最小的,然后最后扫一遍,把没加进去的但是比最大值要小的都加进去,因为比最大值要小的越多越好#i

2017-12-04 21:38:54 328

原创 codeforces 745C 联通

/题意:n个定点 m条边(无重边),有k个顶点之间不能有路径存在,问最多能添加多少条边时,仍然满足情况 因为k个顶点之间不能有路径存在 则最后图中剩下的联通分量个数为k//显然最后组成的最大的哪一个联通分量,点数要尽可能的多,其余有限制的联通分量里面的边数是size*(size-1)/2#include using namespace std;con

2017-12-04 21:36:03 344

空空如也

空空如也

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

TA关注的人

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