Rounding

Solution

Proper Nutrition

枚举

Solution

Phone Numbers

模拟

Solution

Alarm Clock

贪心,好像不用线段树也可以,事实证明我很擅长想得太多。

Solution

Squares and not squares

以后再也不用qsort了

Solution

Restoring the Expression

用哈希真的很讨厌好吗?你们怎么从来不考虑冲突的问题,用的那么毫无负担呢?

Splitting in Teams

Solution

Months and Years

Solution

Dividing the numbers

相邻的4个数字可以分成和相等的两部分,只有前最多3个会凑不出相同。

Solution

Shovel Sale

有的时候加不出9,这时候算最多个9,结果为n*(n-1)/2,草。

Solution

Segments Removal

stl大法好

Solution

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的更多相关文章

  1. Codeforces Round #451 (Div. 2) A B C D E

    Codeforces Round #451 (Div. 2) A Rounding 题目链接: http://codeforces.com/contest/898/problem/A 思路: 小于等于 ...

  2. Codeforces Beta Round #27 (Codeforces format, Div. 2)

    Codeforces Beta Round #27 (Codeforces format, Div. 2) http://codeforces.com/contest/27 A #include< ...

  3. MySQL四舍五入函数ROUND(x)、ROUND(x,y)和TRUNCATE(x,y)

    MySQL四舍五入函数ROUND(x) ROUND(x)函数返回最接近于参数x的整数,对x值进行四舍五入. 实例: 使用ROUND(x)函数对操作数进行四舍五入操作.SQL语句如下: mysql> ...

  4. 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 ...

  5. 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 ...

  6. 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 解 从前往后枚举,放进 ...

  7. Codeforces Round #451 (Div. 2)

    水题场.... 结果因为D题看错题意,B题手贱写残了...现场只出了A,C,E A:水题.. #include<bits/stdc++.h> #define fi first #defin ...

  8. 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 ...

  9. 【Codeforces Round #451 (Div. 2) A】Rounding

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟 [代码] /* 1.Shoud it use long long ? 2.Have you ever test several ...

随机推荐

  1. position:搜索框显示历史浏览记录

    absolute 生成绝对定位的元素,相对于 static 定位以外的第一个父元素进行定位. 元素的位置通过 "left", "top", "righ ...

  2. 第1章 面向对象的JavaScript

    针对基础知识的每一个小点,我都写了一些小例子,https://github.com/huyanluanyu1989/DesignPatterns.git,便于大家理解,如有疑问,大家可留言给我,最近工 ...

  3. 《奋斗吧!菜鸟》 第八次作业:Alpha冲刺 Scrum meeting 5

    项目 内容 这个作业属于哪个课程 任课教师链接 作业要求 https://www.cnblogs.com/nwnu-daizh/p/11012922.html 团队名称 奋斗吧!菜鸟 作业学习目标 A ...

  4. FreeMarker基本使用

    FreeMarker是一个模板引擎,一个基于模板生成文本输出的通用工具,使用纯Java编写 l         FreeMarker被设计用来生成HTML Web页面,特别是基于MVC模式的应用程序 ...

  5. Co-prime

    Co-prime Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem ...

  6. (10)Spring Boot修改端口号【从零开始学Spring Boot】

    Spring boot 默认端口是8080,如果想要进行更改的话,只需要修改applicatoin.properties文件,在配置文件中加入: server.port=9090 常用配置: #### ...

  7. find结合rm删除大量文件

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://navarro.blogbus.com/logs/31502374.html 例:删除/home/raven下,包括子目录 ...

  8. i=i+1,i+=1与i++的区别

    1. i=i+1 a.读取右i的地址 b,i=1 c.读取左i的地址 d. 值赋给左i 2.i+=1 a.读取左i的地址 b.i+1 c.值给i 3.i++ a.读取右i的地址 b.值加1

  9. 项目 cmdb(一)

    Django之ModelForm组件 ModelForm    a.  class Meta:            model,                           # 对应Mode ...

  10. LINUX内核内存屏障

    =================                          LINUX内核内存屏障                          ================= By ...