码迷,mamicode.com
首页 >  
搜索关键字:codeforces 197b limi    ( 12277个结果
Codeforces Round #649 (Div. 2) B. Most socially-distanced subsequence
题目链接:https://codeforces.com/contest/1364/problem/B 题意 给出大小为 $n$ 的一个排列 $p$,找出子序列 $s$,使得 $|s_1-s_2|+|s_2-s_3|+\ldots+|s_{k-1}-s_k|$ 最大的同时 $k$ 尽可能地小。 题解 ...
分类:其他好文   时间:2020-06-14 18:48:20    阅读次数:95
Codeforces Round #585 (Div. 2) B.The Number of Products(动态规划)
题目: You are given a sequence a1,a2,…,an consisting of n non-zero integers (i.e. ai≠0). You have to calculate two following values: the number of pairs ...
分类:其他好文   时间:2020-06-14 16:59:19    阅读次数:54
Codeforces Round #649 (Div. 2)
https://codeforces.com/contest/1364 ##A - XXXXX 题意:给一个 \(n\leq 10^5\) 的数组,求一段最长的区间,这段区间的和不被 \(x\) 整除。 题解:先考虑所有以第一个元素为左端点的区间,这时候往右扫描,得到的前缀和 \(prefix[i] ...
分类:其他好文   时间:2020-06-14 16:39:06    阅读次数:62
Educational Codeforces Round 30 B.Balanced Substring
题目: You are given a string s consisting only of characters 0 and 1. A substring [l,?r] of s is a string sl,sl?+?1,sl?+?2... sr, and its length equals ...
分类:其他好文   时间:2020-06-14 16:38:35    阅读次数:51
Codeforces 1322B - Present
Description 给出序列 $a_i$, 求两两之和的异或值 Solution 按位计算计算到第 $k$ 位时,将 $a_i$ 按 $mod \ 2^{k+1}$ 后排序当 $a_i \ mod \ 2^{k+1} + a_j \ mod \ 2^{k+1}\in [2^k, \ 2^{k+1 ...
分类:其他好文   时间:2020-06-14 14:56:33    阅读次数:47
Codeforces 1303E - Erase Subsequences
Description 从字符串$s$中选出子集从左往右按顺序放到$p$的结尾($p$初始为空串),最多可以这样操作两次,询问是否能得到 $p=t \ (1\leq|t|\leq|s|\leq400)$ Solution 在$t$中枚举断点$mid$,$t[1, mid]$为第一次操作选出,$t[m ...
分类:其他好文   时间:2020-06-14 14:47:13    阅读次数:50
Codeforces 1312D - Count the Arrays
Description 要你求每个元素都在$[1,m]$,存在一个位置左边严格递增,右边严格递减,且恰好存在一对相等元素的$n$个元素的数组的数量$(1 \leq n \leq m \leq 2 * 10^5)$ Solution 枚举数组中的最大值$max$,有$max \geq n - 1$当数 ...
分类:其他好文   时间:2020-06-14 14:34:40    阅读次数:51
Codeforces 1149D - Abandoning Roads
感谢sinian阿姨的热心指导 Description 这篇好久前写的,现在只是转过来,忘了 Solution 假设 $a \leq b$最小生成树上$a$边尽量要多,若a边不够将全图联通才用$b$边所以可以用$a$边将图连成多个联通块,再用$b$边将全图联通路径只要求在最小生成树上,且到不同点的最 ...
分类:其他好文   时间:2020-06-14 14:25:53    阅读次数:65
Codeforces Round #649 (Div. 2) D - Ehab's Last Corollary dfs
#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; int ans1; int ans2; int ans3 ...
分类:其他好文   时间:2020-06-14 12:57:25    阅读次数:164
Codeforces 1364C - Ehab and Prefix MEXs
题意:给1e5的数组a 保证 ai <= ai+1 ai<=i 求一个一样长的数组b 使得mex(b1,b2···bi) = ai QAQ:不知道为啥这1600分的题比赛时出不了 啊啊啊啊啊啊啊啊 题解:其实比赛的时候 就知道当前bi填的数字肯定是0,1,2...a[i] - 1中第一个没出现的数字 ...
分类:其他好文   时间:2020-06-14 12:40:26    阅读次数:72
12277条   上一页 1 ... 39 40 41 42 43 ... 1228 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!