题 OvO http://codeforces.com/contest/909/problem/D CF 455 div2 D CF 909D 解 算出模拟的复杂度之后就是一个很水的模拟题 把字符串按照类似于行程编码的方式来表示,例如把 aaaabbccc 表示成 [4*a] [2*b] [3*c] 这样的形式([4*a] 这个用一个结构体表示) 接下去就可以开心地敲模拟了, 例如对于 [5*a] [4*b] [2*c] [4*b]  这样一个表, 运行一次之后就变成了  [4*a] [2*b]…
Codeforces Round #455 (Div. 2) A. Generate Login 题目描述:给出两个字符串,分别取字符串的某个前缀,使得两个前缀连起来的字符串的字典序在所有方案中最小,输出该字符串. solution 为保证字典序最小,第二个字符串只会选第一个字符,然后先选上第一个字符串的第一个字符(因为不能为空),接着从第二个字符开始,如果该字符小于第二个字符串的第一个字符,那么选上,否则停止,输出答案. 时间复杂度:\(O(n)\) B. Segments 题目描述:给定一个…
D. Colorful Points You are given a set of points on a straight line. Each point has a color assigned to it. For point a, its neighbors are the points which don't have any other points between them and a. Each point has at most two neighbors - one fro…
A. Integer Points DLS and JLS are bored with a Math lesson. In order to entertain themselves, DLS took a sheet of paper and drew…
题 OvO http://codeforces.com/contest/909/problem/E CF455 div2 E CF 909E 解 类似于拓扑排序地进行贪心, 对于 Ei=0 并且入度为 0 的点,创建一个缓冲队列,把这些点的影响到的点先放到缓冲队列中,然后等一次 coprocessor calls 计算完后统一处理,保证每次找 coprocessor calls 的集合的时候,缓冲队列为空 #include <iostream> #include <cstring>…
第一次写博客 ,请多指教! 翻了翻前面的题解发现都是用树状数组来做,这里更新一个 线段树+离散化的做法: 其实这道题是没有必要用线段树的,树状数组就能够解决.但是个人感觉把线段树用熟了会比树状数组更有优势一点 不多废话  http://codeforces.com/contest/1311/problem/F 题目链接 题意是 给你一堆点的位置和他们运动的速度(可正可负),然后时间无限往后推的情况下问你他们之间所有点的最小距离之和.(不明白自行读题) n的范围是2,200000: 显然单纯的一个…
题目链接 题意 : 给你一个半径为n的圆,圆里边还有圆上都有很多整点,让你找出与圆外的任意一个整点距离等于1的点. 思路 :这个题可以用枚举,画个图就发现了,比如说先数第一象限的,往下往右找,还可以找规律,看到神代码就4行,我十分佩服数学学的特别好的人.... 大神博客地址 下边这个是枚举的代码,也很简单. #include<stdio.h> #include<iostream> #include<algorithm> using namespace std; #def…
C. An impassioned circulation of affection time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dian…
A. Generate Login time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The preferred way to generate user login in Polygon is to concatenate a prefix of the user's first name and a prefix of th…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 枚举两个串的前缀长度就好. 组出来. 排序. 取字典序最小的那个. [代码] #include <bits/stdc++.h> using namespace std; string s1,s2; vector <string> v; int main(){ #ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", stdin); #en…