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. 团体程序设计天梯赛-练习集-L1-045. 宇宙无敌大招呼

    L1-045. 宇宙无敌大招呼 据说所有程序员学习的第一个程序都是在屏幕上输出一句“Hello World”,跟这个世界打个招呼.作为天梯赛中的程序员,你写的程序得高级一点,要能跟任意指定的星球打招呼 ...

  2. 在centos 配置python django环境 总结

    1,安装 python3  主要是版本问题,用3.6 好过3.7 报错ModuleNotFoundError: No module named '_ctypes' https://www.cnblog ...

  3. revit二次开发之族的类型参数与实例参数的转换

    1背景小伙伴在做revit二次开发的时候,可能需要在族环境中将族的类型参数与实例参数相互转换. 2思路1.使用族管理器FamilyManager,参见注释12.首先获取需要转换的参数(单个与批量),参 ...

  4. PAT_A1113#Integer Set Partition

    Source: PAT A1113 Integer Set Partition (25 分) Description: Given a set of N (>) positive integer ...

  5. UVA1339 - Ancient Cipher 【字符串+排序】【紫书例题4.1】

    题意:给定两个字符串,你可以替换或者置换,替换是指可以将相同的字母替换为任意一个字母,而置换是指将字母替换为下一个,如A替换B,B替换为C,,,Z替换为A.你需要判断是否可以通过一系列操作使两个字符串 ...

  6. 使用GitHub代码仓库Repositories上传自己的项目代码

    1.下载客户端github(必须下载,需要该软件所提供的Git shell输入命令来上传项目)下载地址: https://github-windows.s3.amazonaws.com/GitHubS ...

  7. C++string和int的相互转化

    本方法主要利用sstream头文件中的方法来进行转换 1.int转成string #include <iostream> #include<string> #include&l ...

  8. NOIP 2016 换教室(期望dp)

    第一次做期望dp 并不知道每个阶段的期望之和就是整个的期望之和 所以一直卡在这 期望=代价*概率 然后注意只有申请了才算期望,否则按原来的. 这道题和前几个课程,申请的限制,当前选或不选,有关 这样很 ...

  9. SBC37x交叉编译平台QT+OPENCV【1】

    在win7下安装Vbox虚拟机,然后安装Ubuntu10.04版本.上一篇说了根据厂商提供的编译器进行安装. 接下来要说的的环境准备.因为在Linux下对u盘的识别以及目录的共享,还有代码的编译传送运 ...

  10. Nexus私服的搭建

    1.nexus 介绍     是开源的,用该框架架设maven私有服务器   2.nexus私服环境搭建     把nexus.war包放到tomcat的webapps下面     浏览且登录     ...