Educational Codeforces Round 65 选做】的更多相关文章

好久没更博客了,随便水一篇 E. Range Deleting 题意 给你一个长度为 \(n\) 的序列 \(a_1,a_2,\dots a_n\) ,定义 \(f(l,r)\) 为删除 \(l\le a_i\le r\) 元素后的序列.求所有 \(f(l,r)\) 单调不降序列的数量. \(n,a_i\le 10^6\) 题解 简单题,但还是调了一年(见代码注释). 考虑删除后的区间,一定是一段前缀并上一段后缀.首先找到一段合法的极长后缀,然后枚举前缀,在保证前缀合法的情况下双指针统计有多少个…
感觉这场比赛题目质量挺高(A 全场最佳),难度也不小.虽然 unr 后就懒得打了. A. Inscribed Figures 题意 给你若干个图形,每个图形为三角形.圆形或正方形,第 \(i\) 个图形内接于第 \(i-1\) 个图形.问交点是否有限,如有限求交点个数. (题目还有很多细节,具体见原题.) 题解 如果两个一样的图形相邻或正方形和三角形相邻. 圆和三角形有 \(3\) 个交点,和正方形有 \(4\) 个交点. 注意如果是 [圆.正方形.三角形]这样的,最上面有一个交点会重合,答案要…
D. Beautiful Array 题意 给你一个长度为 \(n\) 的序列.你可以选择至多一个子段,将该子段所有数乘上给定常数 \(x\) .求操作后最大的最大子段和. 题解 考虑最大子段和的子段一共有三类点:1. 左边没有 \(\times x\) 的点 : 2. 中间 \(\times x\) 的点: 3. 右边没有 \(\times x\) 的点. 考虑 dp .设 \(f[i][1/2/3]\) 表示前 \(i\) 个数,第 \(i\) 个数作为第 1/2/3 类点的最大子段和.转移…
Educational Codeforces Round 65 (Rated for Div. 2)题解 题目链接 A. Telephone Number 水题,代码如下: Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int a[N] ; int n, T; char s[N] ; int main() { cin >> T; whil…
链接:https://codeforces.com/contest/1167/problem/D 题意: A string is called bracket sequence if it does not contain any characters other than "(" and ")". A bracket sequence is called regular (shortly, RBS) if it is possible to obtain corr…
链接:https://codeforces.com/contest/1167/problem/C 题意: In some social network, there are nn users communicating with each other in mm groups of friends. Let's analyze the process of distributing some news between users. Initially, some user xx receives…
链接:https://codeforces.com/contest/1167/problem/B 题意: This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python o…
链接:https://codeforces.com/contest/1167/problem/A 题意: A telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, the sequence 80011223388 is a telephone number, but the sequences 70011223388and 80000011223388 are n…
A.前n-10个有8即合法. #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define rep(i,l,r) for (int i=(l); i<=(r); i++) typedef long long ll; using namespace std; ; char s[N]; int T,n; int main(){ for (scanf(&qu…
E. Range Deleting 题意:给出一个序列,定义一个操作f(x,y)为删除序列中所有在[x,y]区间内的数.问能使剩下的数单调不减的操作f(x,y)的方案数是多少. 解法:不会做,思维跟不上,双指针也不熟练.思路和代码都是学习https://edwiv.com/archives/587这位巨佬的. 说下我的理解:我们考虑怎样的操作[l,r]才是合理的?很容易能想到有3个条件:①删除后剩下的数字[1,l-1]的位置是单调递增,②数字[r+1,x]的位置也是单调递增的,3 数字l-1的所…