
比赛中的部分题
yjr-1100
( ´・ω・)ノ(._.`),关注我,一起学习
展开
-
线段树 The Child and Sequence CF(438D)
The Child and Sequence题目解题思路 题目 题目大意: 给一组数据:执行一下操作 1.输出l-r 所有数据的和 2.把l-r的所有数据 mod x 3.把数据a[k]的值改为x 解题思路 操作1和3 就是单纯的 区间求和,单点修改,没有什么难度 对于操作2, 区间取模 如果取模的数比这段区间所有的数都大,那取模就是没有意义的, 就是说,如果取模的数比区间最大的数还大,那么就不用取模了, 所以我们在线段树里再记录一个区间最大值 考虑每次取模,对于每一个数x,取模y 的值必然比y小,原创 2020-07-21 10:07:20 · 189 阅读 · 0 评论 -
CodeForce 1327B Princesses and Princes (模拟注意时间)
CodeForce 1327B Princesses and Princes 初始化也是要时间的,尤其是数组开的大的时候,然后,,我text 6 就 tle 了好久。 #include<bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; typedef long long ll; const int maxn=...原创 2020-03-25 12:03:47 · 155 阅读 · 0 评论 -
kick start Round A 2020 Plates (DP)
Problem Dr. Patel has N stacks of plates. Each stack contains K plates. Each plate has a positive beauty value, describing how beautiful it looks. Dr. Patel would like to take exactly P plates to use ...原创 2020-03-24 23:56:32 · 184 阅读 · 0 评论 -
CodeForces - 1325B CopyCopyCopyCopyCopy (排序+unique去重)
CodeForces - 1325B CopyCopyCopyCopyCopy 题目分析: 这个题就是找 不重复的元素有多少个,排序+去重就好了,这里主要想学一个STL 的去重函数 AC代码: #include<iostream> #include<cmath> #include <cstring> #include<stdio.h> #...原创 2020-03-15 16:12:21 · 393 阅读 · 0 评论 -
CodeForces - 1324D Pair of Topics (分治+排序)
CodeForces - 1324D Pair of Topics 题目大意: 这题大意ai+aj>bi+bj全在这个式子上,就问你满足的组合有几种, 题目分析: 整理一下,得到(ai-bi)+(aj-bj)>0 ,所以现在我们就只用做个差,然后找有几种组合就好了, 开始比较笨,tle了一发,后来才知道要分治一下,我们给做差后的数组排个序,每次找到比自己大的第一个数的下标,...原创 2020-03-15 15:54:39 · 475 阅读 · 0 评论 -
Codeforce 1324B—— Yet Another Palindrome Problem (子列回文)
Codeforce 1324B Yet Another Palindrome Problem 题目: 题目大意: 给你一串数,他含有元素大于等于3的子列如果是回文的那么就输出YES 题目分析: 只要原来的数列中,有不相邻的两个元素相等就可以 AC代码: //https://codeforces.com/problemset/problem/1324/B #include<stdio.h...原创 2020-03-14 11:11:33 · 294 阅读 · 0 评论 -
Codeforce 1324C——Rrog Jumps (思维)
Codeforce 1324C Rrog Jumps 题目: 题目大意: 给你一串由‘R’和’L‘组成的字符串,预先设定好一次可以跳的最远距离d,当跳的地方落在R时只能向右跳,当落的地方在L时只能向左跳,问d最小是多少, 题目分析: 我们想,青蛙至少要跳出第一步,并且当遇到L的时候就只能后退,如果连续的‘L’就会连续后退,大致思考一下,再大胆猜想一下,d就是找所给字串中最多有多少连续的’...原创 2020-03-13 09:27:50 · 215 阅读 · 0 评论 -
Codeforce 1324A——Yet Another Teteis Problem (思维)
Codeforce 1324A Yet Another Teteis Problem 题目: 题目大意: 这个打比赛的时候,读题很重要啊,,,开始不懂题意,浪费了好长时间,, 这个题的大致意思就是,给你一个数组,每个数的值就代表方块的个数,每次下落的方块都是2*1 的样子,和俄罗斯方块的规则一样,那一行填满就可以消去,问你给出的示例能不能消去 题目分析: 我们想,每次都会下落2*1的方块,对...原创 2020-03-13 08:55:19 · 237 阅读 · 0 评论 -
Codeforce 1312C - Adding Powers (模拟,思维)
Codeforce 1312C Adding Powers 题目: Suppose you are performing the following algorithm. There is an array v1,v2,…,vn filled with zeroes at start. The following operation is applied to the array severa...原创 2020-03-12 19:47:37 · 333 阅读 · 0 评论