Codeforces Round #451 & Codeforces Round #452
Rounding
Proper Nutrition
枚举
Phone Numbers
模拟
Alarm Clock
贪心,好像不用线段树也可以,事实证明我很擅长想得太多。
Squares and not squares
以后再也不用qsort了
Restoring the Expression
用哈希真的很讨厌好吗?你们怎么从来不考虑冲突的问题,用的那么毫无负担呢?
Splitting in Teams
Months and Years
Dividing the numbers
相邻的4个数字可以分成和相等的两部分,只有前最多3个会凑不出相同。
Shovel Sale
有的时候加不出9,这时候算最多个9,结果为n*(n-1)/2,草。
Segments Removal
stl大法好
Letters Removing
解法我已经会了,心情不好代码就不写了,描述一下过程:
首先用set记录各个字母都在哪些位置出现过
对于每次操作的输入lr,先找出lr在原字符串中对应的lr,然后根据c选择set,删除掉值位于lr之间的元素(很多次区间删除,所以用set)。
输出的时候62个set齐头并进,找到62个begin()中值最小的那个,输出对应字符,并删除该元素。
如何求lr在原字符串中的位置?
设a[i]表示按原字符串编号第i个字符串是否被删除,0为被删除,1为未被删除;s[i]表示1-i中有几个1,也可以当成a[1]+a[2]+...+a[i]。那么lr在原字符串中的位置就是最小的i满足s[i]=lr,用线段树或树状数组维护s数组,再二分确定最小的i,复杂度应该是nlgnlgn。
Codeforces Round #451 & Codeforces Round #452的更多相关文章
- Codeforces Round #451 (Div. 2) A B C D E
Codeforces Round #451 (Div. 2) A Rounding 题目链接: http://codeforces.com/contest/898/problem/A 思路: 小于等于 ...
- Codeforces Beta Round #27 (Codeforces format, Div. 2)
Codeforces Beta Round #27 (Codeforces format, Div. 2) http://codeforces.com/contest/27 A #include< ...
- MySQL四舍五入函数ROUND(x)、ROUND(x,y)和TRUNCATE(x,y)
MySQL四舍五入函数ROUND(x) ROUND(x)函数返回最接近于参数x的整数,对x值进行四舍五入. 实例: 使用ROUND(x)函数对操作数进行四舍五入操作.SQL语句如下: mysql> ...
- Codeforces Round #451 (Div. 2)-898A. Rounding 898B.Proper Nutrition 898C.Phone Numbers(大佬容器套容器) 898D.Alarm Clock(超时了,待补坑)(贪心的思想)
A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...
- Codeforces Round #451 (Div. 2) A. Rounding【分类讨论/易错】
A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...
- Codeforces Round #451 (Div. 2) [ D. Alarm Clock ] [ E. Squares and not squares ] [ F. Restoring the Expression ]
PROBLEM D. Alarm Clock 题 OvO http://codeforces.com/contest/898/problem/D codeforces 898d 解 从前往后枚举,放进 ...
- Codeforces Round #451 (Div. 2)
水题场.... 结果因为D题看错题意,B题手贱写残了...现场只出了A,C,E A:水题.. #include<bits/stdc++.h> #define fi first #defin ...
- Codeforces Round #451 (Div. 2) B. Proper Nutrition【枚举/扩展欧几里得/给你n问有没有两个非负整数x,y满足x·a + y·b = n】
B. Proper Nutrition time limit per test 1 second memory limit per test 256 megabytes input standard ...
- 【Codeforces Round #451 (Div. 2) A】Rounding
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟 [代码] /* 1.Shoud it use long long ? 2.Have you ever test several ...
随机推荐
- Typeclassopedia 阅读笔记:导言与 Functor
Typeclassopedia 阅读笔记 本文是对介绍 Haskell 中类型类(type classes)的文档 Typeclassopedia 的阅读笔记和简短总结,包含此文档中重要的知识点.读者 ...
- C# MVC 获得程序运行路径
string filePath = System.Web.HttpContext.Current.Request.MapPath("~/Upload"); //由虚拟路径指定的服务 ...
- Android LinearLayout整个布局设置不可点击
1,activity的xml布局(布局中有个Button按钮,点击按钮弹出一个popupwindow ) <?xml version="1.0" encoding=" ...
- 两个控件同一行显示bootstrap
<div class="form-group"> <label for="Name" class="form-inline" ...
- Ubuntu18.04 安装后应该做的事!!!
一.WPS 进入WPS_Linux官网,下载对应的deb文件. WPS有官方的文件说明可供查看,WPS社区 WPS 的依赖关系,部分数学公式显示支持,都可以通过WPS社区查看 安装wps sudo d ...
- AtCoder ARC 076E - Connected?
传送门:http://arc076.contest.atcoder.jp/tasks/arc076_c 平面上有一个R×C的网格,格点上可能写有数字1~N,每个数字出现两次.现在用一条曲线将一对相同的 ...
- Docker与K8s
2010年,几个搞IT的年轻人,在美国旧金山成立了一家名叫“dotCloud”的公司. 这家公司主要提供基于PaaS的云计算技术服务.具体来说,是和LXC有关的容器技术. LXC,就是Li ...
- 【ACM】hdu_zs1_1003_放大的X _201307271557
放大的X Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submissio ...
- [bzoj3717][PA2014]Pakowanie_动态规划_状压dp
Pakowanie bzoj-3717 PA-2014 题目大意:给你n个物品m个包,物品有体积包有容量,问装下这些物品最少用几个包. 注释:$1\le n\le 24$,$1\le m\le 100 ...
- 淘宝内部分享:MySQL & MariaDB性能优化
发表于2015-01-20 16:26| 28875次阅读| 来源mysql.taobao.org| 22 条评论| 作者淘宝数据库团队 MySQL性能优化淘宝数据库 摘要:MySQL是目前使用最多的 ...