codeforces 719C. Efim and Strange Grade】的更多相关文章

C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any po…
Codeforces 718A Efim and Strange Grade 程序分析 jerry的程序 using namespace std; typedef long long ll; string buf; int i; void up(int at) { at--; if (at < 0) { buf = '1' + buf; i++; return; } if (buf[at] == '.') at--; buf[at]++; if (buf[at] == '9'+1) { buf[…
题意:给定一个浮点数,让你在时间 t 内,变成一个最大的数,操作只有把某个小数位进行四舍五入,每秒可进行一次. 析:贪心策略就是从小数点开始找第一个大于等于5的,然后进行四舍五入,完成后再看看是不是还可以,一循环下去,直到整数位,或者没时间了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <…
C. Efim and Strange Grade 题目连接: http://codeforces.com/contest/719/problem/C Description Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappoin…
题目链接:http://codeforces.com/problemset/problem/719/C C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a…
codeforces 373 A - Efim and Strange Grade(算数模拟) 原题:Efim and Strange Grade 题意:给出一个n位的实型数,你可以选择t次在任意位进行四舍五入的进位,求最大结果. 解法:这道题一定不能忽略数位计算时本身带来的进位,如果我们要改变这个数的大小,一定是在最先的那个出现5以上的数字进行四舍五入,之后的t次允许我们多次四舍五入,如果自然进位则不消耗t. 最后一点,整数位的进位也是需要考虑的 #include <cstdio> #inc…
C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any po…
Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any posit…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. F…
题目链接:http://codeforces.com/problemset/problem/719/C 题目大意: 留坑...…
https://codeforces.com/contest/1191/problem/F 看了一下题解的思路,感觉除了最后一段以外没什么启发. 首先离散化x加快速度,免得搞多一个log.其实y不需要离散化. 规定无穷大就是xn+1这个很好理解嘿嘿.(反正开多了5个不怕) 注意到其实从上往下一行一行扫过去,每次必须新增的元素才是新的集合,那很容易想到一个不重不漏的办法就是每次计算"以点p[i]为加进去的新点中的结束的集合",那么假设一开始p[i]的左侧有cntl个点,那么显然有(cnt…
Description 给你一下长度为 \(n\) 的序列. \(a_i=a_j\) \(l_1 \leqslant i \leqslant r_1\) \(l_2 \leqslant i \leqslant r_2\) 询问满足条件的 \((i,j)\) 对数. Sol 分块+前缀和. 非常乱搞啊... 首先分块 \(O(\sqrt{n})\) 一块. 然后在每块里统计块中元素出现次数. 先预处理块与块之间的贡献,然后处理不足一块的. 处理块与块之间的时候,需要前缀和优化一下就可以了,枚举当前…
题目大意: 定义mex数为数组中第一个没有出现的非负整数.有m个操作,每个操作有一个x,将数组中所有的元素都异或x,然后询问当前的mex Input First line contains two integer numbers n and m (1 ≤ n, m ≤ 3·105) — number of elements in array and number of queries. Next line contains n integer numbers ai (0 ≤ ai ≤ 3·105…
题目链接 /* 异或只有两种情况,可以将序列放到01Tire树上做 在不异或的情况下在Tire上查找序列的mex很容易,从高位到低位 如果0位置上数没有满,则向0递归:否则向1 (0位置上的数都满了 即 其子树叶子节点都有值) 异或情况下 若x在当前位有1,则反转0/1继续走 由于异或具有结合率,异或一次求mex和异或多个数求原数列mex是一样的 故每次不需要修改原数列,las^=opt即可 注意需要去重 因为在判断某位置rt下的区间中的数都有时,需要num[rt],相同的数显然不能算(画个图)…
传送门 注意到矩形往上是无限的,考虑把点按 $y$ 从大到小考虑 对于枚举到高度为 $h$ 的点,设当前高度大于等于 $h$ 的点的所有点的不同的 $x$ 坐标数量为 $cnt$ 那么对于这一层高度 $h$ 我们就有 $cnt(cnt+1)/2$ 种不同的 $l$,$r$ ,使得矩形内点集不同 发现对于某些 $x$ 在这一层相邻两点之间,高度大于 $h$ 的点,这样又重复算了它们的贡献,所有要再扣掉 直接用树状数组维护一下当前区间内不同的 $x$ 的数量即可 因为离散化了判断 $x$ 是否出现过…
Codeforces Round #373 (Div. 1) A. Efim and Strange Grade 题意 给一个长为\(n(n \le 2 \times 10^5)\)的小数,每次可以选择某位小数进行四舍五入,最多做\(t(t \le 10^9)\)次. 求最大的数. 思路 每次必然找小数部分能进行四舍五入的最高位,并且四舍五入的位置是递增的. 注意:99.5这样的数据,最高位会进位. 代码 A. Efim and Strange Grade C. Sasha and Array…
A. Vitya in the Countryside time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Every summer Vitya comes to visit his grandmother in the countryside. This summer, he got a huge wart. Every gran…
A. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any po…
用了两场比赛上Div 1感觉自己好腊鸡的说...以下是这两场比赛的部分题解(不得不说有个黄学长来抱大腿还是非常爽的) Round #372 : Div 2 A:Crazy Computer 题意:给定N个输入和一个时间长度M,每次输入屏幕上增加一个字符,若两个输入间隔大于M则屏幕上的字符会被清空,问结束时屏幕上还有多少个字符 直接模拟没有什么好说的 代码: #include<cstdio> #include<iostream> #include<cstring> #in…
A. Vitya in the Countryside time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Every summer Vitya comes to visit his grandmother in the countryside. This summer, he got a huge wart. Every gran…
C. Efim and Strange Grade Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappointed, as he expected a way more pleasant result. Then, he devel…
A - Complete the Word(暴力) Description ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length 26 where each letter of English alphabet appears exactly once.…
A. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any po…
收录已发布的题解 按发布时间排序. 部分可能与我的其他文章有重复捏 qwq . AtCoder for Chinese: Link ZHOJ: Link 洛谷 \(1\sim 5\) : [题解]CF45I TCMCF+++ [题解]CF1013B And [题解]CF991C Candies [题解]CF356A Knight Tournament [题解]CF1715A Crossmarket \(6\sim 10\) : [题解]CF1215C Swap Letters [题解]CF172…
\(CodeForces 706E ~Working routine\) 给出一个矩阵,每次操作交换两个子矩阵,求最后状态. 使用链表存储,每次交换后,影响到的之后矩阵边缘的指针,暴力修改. \(~~~~\) \(CodeForces 985E ~Pencils and Boxes\) 每个铅笔盒至少放\(k\)个铅笔,每个盒子中的铅笔价值的绝对值之差不能超过\(d\).求是否有方案. 放在一个盒子里的铅笔价值是连续的一段,这样一定不劣.使用线段树维护合法的权值起始位置. \(~~~~\) \(…
n people are standing on a coordinate axis in points with positive integer coordinates strictly less than 106. For each person we know in which direction (left or right) he is facing, and his maximum speed. You can put a bomb in some point with non-n…
地址:http://codeforces.com/contest/832/problem/C 题目: C. Strange Radiation time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output n people are standing on a coordinate axis in points with positive i…
题目链接 https://codeforces.com/contest/1506/problem/A 原题 1506A - Strange Table Example input 5 1 1 1 2 2 3 3 5 11 100 100 7312 1000000 1000000 1000000000000 output 1 2 9 1174 1000000000000 题解 先竖列竖列地排数字, 找到x所在的位置s1; 再横行横行地排, 找到s1位置的值并输出  ----->  (n为总行数,…
题目链接:http://codeforces.com/problemset/problem/305/A 题目意思:给出一个序列,需要从中选择一些数,这些数需要满足:任意的两个数中每一位至少有一个数满足该位有0.例如,406, 10(可以看成010)是符合条件的: 406, 11 就不符合条件,因为个位上这两个数都不包含0. 一开始想得太过复杂:把整型的数保存到字符数组中,再用strstr函数找出是否有0的存在,但是这样做根本不能解决问题,因为不能得出0的具体位置.并且不能判断出两个数中的不同位至…
832C - Strange Radiation 思路:二分最短时间. 代码: #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define pi acos(-1.0) #define pii pair<int,int> #define pil pair<int,long> #define mem(a,…