B. Sereja and Suffixes Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/368/B Description Sereja has an array a, consisting of n integers a1, a2, ..., an. The boy cannot sit and do nothing, he decided to study an…
http://codeforces.com/problemset/problem/368/B B. Sereja and Suffixes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja has an array a, consisting of n integers a1, a2, ..., an. The bo…
Sereja and Suffixes Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Description Sereja has an array a, consisting of n integers a1, a2, ..., an. The boy cannot sit and do nothing, he decided to study an arr…
B. Sereja and Suffixes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja has an array a, consisting of n integers a1, a2, ..., an. The boy cannot sit and do nothing, he decided to stud…
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int main(){ int n,m; cin >> n >>m; vector<int> a(n),l(m); ; i < n ; ++ i) cin >>a[i]; ; i < m; ++ i) cin &…
discription Sereja painted n points on the plane, point number i (1 ≤ i ≤ n) has coordinates (i, 0). Then Sereja marked each point with a small or large English letter. Sereja don't like letter "x", so he didn't use it to mark points. Sereja thi…
手动转田神的大作:http://blog.csdn.net/tc_to_top/article/details/38793973 D. Prefixes and Suffixes time limit per test 1:second memory limit per test: 256 megabytes input: standard input output: standard output You have a string s = s1s2...s|s|, where |s| is…
Sereja has a sequence that consists of n positive integers, a1, a2, ..., an. First Sereja took a piece of squared paper and wrote all distinct non-empty non-decreasing subsequences of sequence a. Then for each sequence written on the squared paper, S…
Sereja and Cinema 首先我们可以发现除了第一个人, 其他人都会坐在已入坐人的旁边. 难点在于计算方案数.. 我们可以从外往里把确定的人用组合数算上去,然后缩小范围. #include<bits/stdc++.h> #define LL long long #define LD long double #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #de…
CodeForces 3 67E (109 + 7). Two ways are considered distinct if there is such j(1 ≤ j ≤ n), that the j-th intervals in two corresponding sequences are not equal. (109 + 7);;][MAX][MAX]; { ) { memset(dp,, dp[][][]=; …
题目: A. Sereja and Prefixes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja loves number sequences very much. That's why he decided to make himself a new one following a certain algor…