#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,d; cin >> n >>d; vector<int>a(n); ; i < n ; ++ i ) cin >>a[i]; int m; cin >> m; sort(a.begin(),a.end()); ;…
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…
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…
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main(){ string s ; cin >>s; int m; cin >>m; vector<int> l(m),r(m); ; i < m ; ++ i ) cin >> l[i]>>…
#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 &…
题目链接:http://codeforces.com/contest/381/problem/E E. 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…
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 …
Sereja and Dima time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a n…