Sereja ans Anagrams】的更多相关文章

B. Sereja ans Anagrams Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/367/B Description Sereja has two sequences a and b and number p. Sequence a consists of n integers a1, a2, ..., an. Similarly, sequence b con…
Sereja has two sequences a and b and number p. Sequence a consists of n integers a1, a2, ..., an. Similarly, sequence b consists of m integers b1, b2, ..., bm. As usual, Sereja studies the sequences he has. Today he wants to find the number of positi…
Codeforces Round #215 (Div. 1) B:http://codeforces.com/problemset/problem/367/B 题意:给你两个序列a,b,然后给你一个数p,然后让你在a序列中找一个位置q,得以这个位置开始,以后每隔着aq+aq+1*(p)+.......aq+(m-1)*p,这个序列经过重新排序能够等于b,输出,所有的这样的位置. 题解:可以采用递推.先找起点是1,然后再找起点是1+p,找1+p的时候,其实只要在找1的基础上删除最前的那个数,然后再…
http://codeforces.com/contest/368/problem/D 题意:有a.b两个数组,a数组有n个数,b数组有m个数,现在给出一个p,要你找出所有的位置q,使得位置q  q+p   q+2*p  .....q+(m-1)*p   经过一定的操作(不改变数据大小)全等于b数组. 思路:首先肯定对a数组离散,然后二分对a.b数组分配好离散后的值.其实我们只需要枚举0————p位置,哈希记录,然后从q----一直滚到q(m-1)*p>=n,对于一个数据,出来第一个数,进去最后…
http://codeforces.com/contest/368/problem/D #include <cstdio> #include <cstring> #include <map> #include <vector> #include <algorithm> #define maxn 300000 #define LL long long using namespace std; int n,m,p; LL a[maxn],b[maxn…
D. Sereja ans Anagrams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja has two sequences a and b and number p. Sequence a consists of n integers a1, a2, ..., an. Similarly, sequence …
A. Sereja and Algorithm 水题不解释. B. Sereja ans Anagrams 模p同余的为一组,随便搞. C. Sereja and the Arrangement of Numbers 我还以为是找规律... 把每个数当成一个点.就有一个图.让后求欧拉路什么的. D. Sereja and Sets 这个思路感觉很巧妙(可能是我太弱了),我们对于每一段连续的d,找到不包含它们的所有集合,这些集合的子集一定不可行. 见代码. /* * Problem: D. Ser…
A Sereja and Algorithm 题意:给定有x,y,z组成的字符串,每次询问某一段s[l, r]能否变成变成zyxzyx的循环体. 分析: 分析每一段x,y,z数目是否满足构成循环体,当然长度<3的要特判. 代码: #include <bits/stdc++.h> #define in freopen("solve_in.txt", "r", stdin); #define pb push_back using namespace s…
C. Sereja and Brackets time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja has a bracket sequence s1, s2, ..., sn, or, in other words, a string s of length n, consisting of characters "(…
49. Group Anagrams Problem's Link ---------------------------------------------------------------------------- Mean: 给定一个由string类型构成的集合,让你按照每个字符串的单词构成集合来将这个集合分类. analyse: STL的运用. Time complexity: O(N) view code /** * ---------------------------------…