educational codeforces binary string

PAT甲级:1174 Left-View of Binary Tree

题目:1174 Left-View of Binary Tree 25分 题解:层次遍历输出每一行最左边的元素。(最开始以为输出部分节点的左子树...想不到思路) using namespace std; #include <iostream> #include <vector> #include ......
甲级 Left-View Binary 1174 Left

Codeforces Round 904 (Div. 2) C. Medium Design(前缀和+差分)

Codeforces Round 904 (Div. 2) C. Medium Design 思路: 因为出现的线段应该为不相同的线段,所以最小值应该为 \(1\) 或 \(m\) 因此我们可以通过差分储存线段范围内的加值,再用前缀和表示这个范围内的最大加值 sl为不包含\(1\)的线段的差分,sr ......
前缀 Codeforces Design Medium Round

CodeForces 1887D Split

洛谷传送门 CF 传送门 \(a_l, a_{l + 1}, \ldots a_r\) 是好的当且仅当 \(\exists k \in [l, r - 1], \max\limits_{i = l}^k a_i < \min\limits_{i = k + 1}^r a_i\),称此时的 \(k\) ......
CodeForces 1887D Split 1887

string的相关用法

string的相关用法 一、string对象初始化 常见的初始化有两种方式:拷贝初始化和直接初始化。 点击查看代码 string s1="hello";//拷贝初始化 string s2("world");//直接初始化 string s3(10,c);//十个c,cccccccccc 二、stri ......
string

c++恶心的char和string

统计数字出现次数。 Char的长度Strlen(char) string的长度.size()函数与.length() Char和string都可以==比较。注意 string a=”1adbcde”,而a[0]是char类型需要转换。 #include <bits/stdc++.h> #includ ......
string char

Spring @ConfigurationProperties Yaml语法配置List和Map:List<String>、List<Obj>、List<List<Obj>>、Map<String,String>、Map<String,List<String>>、Map<String,Obj>、Map<String,List<Obj>>

yaml语法 数据结构可以用类似大纲的缩排方式呈现,结构通过缩进来表示,连续的项目通过减号“-”来表示,map结构里面的key/value对用冒号“:”来分隔。 例子: 配置类 YmalConfig: import cn.hutool.json.JSONUtil; import lombok.Dat ......
String List lt gt Map

Codeforces Round#905 解题报告

按理来说最近开始了一天一套 div2 计划,第一天做了一套 Div1,第二天做了 hustfc,第三天因为要赶 latex 期末考试,所以什么也没做。 明天写一下 hustfc 比较牛的几题。 A 暴力怎么做,是不是加加加,然后判断。 B 本质上是让长度为 \(i\) 的后缀全是 \(0\) 那么找 ......
Codeforces 报告 Round 905

String和StringBuffer的区别

String 和 StringBuffer 是 Java 中两种用于处理字符串的不同类,它们之间有一些重要的区别。 可变性: String 是不可变的(immutable):一旦创建了一个 String 对象,就不能更改它的内容。每次对 String 进行修改操作(例如拼接字符串),都会创建一个新的 ......
StringBuffer String

Codeforces Round 904 (Div. 2)

A. 没想到是暴力,做的很晚 B. 手玩一下即可 C. Medium Design 给定一个长为 \(n\) 的数组 \(a\) ,和若干条线段 \([l_i,r_i]\) ,你可以选择这其中的任何若干条线段,并让 \(a_l\sim a_r\) 均 \(+1\).请你计算可以得到的 \(\max( ......
Codeforces Round 904 Div

Easy Excel 导出存在绿色角标问题[返回字段类型是数字,当时使用String来接收]

一、背景 Easy Excel 导出,发现excel 存在大量的绿色角标,很影响美观,如果个人使用可以设置wps或office 忽略检测警告, 但是我是对业主的,所以这一方式对我不适用,只能通过代码的方式解决. 二、实现 通过以下创建一个 ExcelWriter ,实现去绿色角标的关键是 使用eas ......
字段 类型 绿色 数字 String

java中 int (double、float、long等等) 与 String 之间的相互转换

int 转 String (double、float、long等同理) 方法1 int i = 28; String s = i + ""; 此方法在将i转换成s时,会额外产生一个 "" 常量对象存放在常量池中 方法2 int i = 28; String s = String.valueOf(i) ......
之间 double String float java

「题解」Codeforces Round 905 (Div. 3)

before 终于有一篇题解是一次性更所有题的了。 A. Morning Problem A. Morning Sol&Code 根据题意模拟即可。 #include <bits/stdc++.h> typedef long long ll; int min(int a, int b) { retu ......
题解 Codeforces Round 905 Div

Java 练习题03 String类

1. 编写一个程序,将下面的一段文本中的各个单词的字母顺序翻转, "To be or not to be",将变成"oT eb ro ton ot eb."。 import java.util.Arrays; public class Test08 { public static void main ......
练习题 String Java

Codeforces Round 905 div2 F题

记答案为\(ans_i\),表示从1到i次修改出现的字典序最小的数组a, \(c\)数组表示\(ans_i\)出现之后,所有修改的累加和。用一个vector存一下\(ans_i\)之后的所有修改。从1到q遍历每一次修改时,对\(c\)数组进行区间赋值操作,如果\(c\)数组中第一个不为0的数<0,那 ......
Codeforces Round div2 905 div

C++ char String

C++ char string 目录C++ char string字符char字符数组遍历基本函数字符比较char*、char[]转换为string字符串 String 类1.声明和初始化2.string的大小和容量3.拼接append()&+操作符4.插入push_back()&insert()5 ......
String char

「解题报告」Codeforces Round 653 (Div. 3)

A. Required Remainder You are given three integers \(x, y\) and \(n\). Your task is to find the maximum integer \(k\) such that \(0 \le k \le n\) that ......
Codeforces 报告 Round 653 Div

Codeforces Round 905 (Div. 2)

Preface 周日晚上Div1,2,3同乐,但我不想打Div1,同时第三个号由于只打了两场没够到Div2的门槛,因此刚好打不了Div2,遂玩了一晚上LOL 今天补了下这场题感觉难度偏低,E之前的题都比较签,F刚开始没想到转化成差分最小准备去写扫描线+线段树了,后面发现其实可以写的很简单 A. Ch ......
Codeforces Round 905 Div

[NEERC2004-2005] Hyper Almost Permutative String 题解

题目链接 题目大意 称一个长度为 \(n\) 的字符串为排列的,当且仅当它包含了前 \(n\) 个大写字母。 称一个长度为 \(n+1\) 的字符串为基本排列的,当且仅当可以通过删去一个字符使得它是排列的。 现在给定两个长为 \(n\) 的排列的字符串 \(s_1,s_2\),求一个最短的字符串 \ ......
题解 Permutative Almost String NEERC

CodeForces 946F Fibonacci String Subsequences

洛谷传送门 CF 传送门 duel 的时候差点不会 2400 了。 套路地,考虑每个 \(F(x)\) 中与 \(s\) 相同的子序列的贡献。设这个子序列为 \(F(x)_{p_1}, F(x)_{p_2}, F(x)_{p_3}, \ldots, F(x)_{p_n}\)。 我们想要它成为一个子序 ......

Codeforces 1862G 题解

传送门 题解 因为有这个操作:将序列 \(a\) 加上 \(\{n, n - 1, \cdots, 1\}\),考虑差分。 那么显然每次操作会将差分数组中的每个元素减去 \(1\),如果差分数组中有 \(0\),就会把 \(0\) 删除。 所以可以发现差分数组中剩下的一定是操作前的最大值。 由于操作 ......
题解 Codeforces 1862G 1862

Educational Codeforces Round 127(CF1671 D~E) 题解

D. Insert a Progression 题目链接 可以瞪出来的一个结论就是当我们在位置 \(p\) 插入了一个数 \(x\) 时,如果存在一对 \(l,r\) 满足 \(l<p\),\(r>p\) 且 \(x\in[a_l,a_r]\),那么我们插入的这个 \(x\) 就不会对序列的答案产生 ......
题解 Educational Codeforces Round 1671

LocalDateTime、LocalDate、Date、String相互转化大全及其注意事项

一、前言 大家在开发过程中必不可少的和日期打交道,对接别的系统时,时间日期格式不一致,每次都要转化! 每次写完就忘记了,小编专门来整理一篇来详细说一下他们四个的转换的方法,方便后面使用!! 二、LocalDateTime、LocalDate、Date三者联系 这里先说一下,为什么日期有Date了,还 ......

Codeforces Round 886 (Div. 4) 题解

link 我为什么还要 vp div4 场。。。 A 直接找最大的两个判断一下。 void solve() { int a[3]; cin >> a[0] >> a[1] >> a[2]; sort(a, a + 3); if(a[2] + a[1] >= 10) cout << "YES\n"; ......
题解 Codeforces Round 886 Div

Codeforces Round 905 (Div. 3)

Codeforces Round 905 (Div. 3) A. Morning 解题思路: 首先\(4\)个数字都要打印出来,所以\(ans\)起始值为\(4\)。 接着就是从左向右移动绝不回头,鼠标移动的距离和就是两两数字之差。 注意:这里\(0\)位置其实是\(10\). 代码: #inclu ......
Codeforces Round 905 Div

宝塔:续签SSL证书报错string indices must be integers

网站SSL证书过期,续签的时候,报错string indices must be integers。 处理方法: 1.点击左侧首页,选择“修复”; 2.修复之后,重新点击网站,设置>>>SSL >>>续签证书,等待流程通过,点击保存即可。 ......
宝塔 integers 证书 indices string

Codeforces Round#905 解题报告

由于是解题报告不是过题报告,所以理所当然的放弃了后三题代码的写。 感觉这场 Div1 D 是 cyh 的菜,E 是 gjk 的菜。我负责菜。 只写 Div1 题的题解。 A 双指针可以做 \(m=1\) 你发现随便换 \(a_1\) 答案最多减少 \(1\),而且 \(a_1\) 越趋向于减少,所以 ......
Codeforces 报告 Round 905

Codeforces Round 905 (Div. 2) D1. Dances (Easy version)(贪心+二分)

Codeforces Round 905 (Div. 2) D1. Dances (Easy version) 思路: 对于 \(a\),它的头默认为 \(1\),则 \(a_0\) = \(1\) 对于排完序的 \(a\) 与 \(b\) 数组 最优为从 \(a\) 的结尾删除,从 \(b\) 的 ......
Codeforces version Dances Round Easy

「解题报告」Codeforces Round 905 (Div. 3)

A. Morning You are given a four-digit pin code consisting of digits from \(0\) to \(9\) that needs to be entered. Initially, the cursor points to the ......
Codeforces 报告 Round 905 Div

Codeforces Round 905 (Div. 2) C. You Are So Beautiful(数据结构)

Codeforces Round 905 (Div. 2) C. You Are So Beautiful 定义: 设数组 abcd 子数组定义:从原数组砍去前面若干元素,后边若干元素,剩余的数组。如:bc、ab 子序列定义:从原数组删除若干元素,剩余元素拼凑一起,组成的数组。如:ac、bd 思路: ......

Educational Codeforces Round 144(CF1796 D~E) 题解

D. Maximum Subarray 题目链接 十分钟秒了一道 *2000,非常爽,但是个人感觉确实非常简单。 下面令 \(b_i=a_{i}-x\),\(b_i'=a_i+x\) 。 因为 \(k<=20\),因此考虑一个复杂度与 \(k\) 相关的做法。 不妨 dp:设 \(f_{i,j,0/ ......
题解 Educational Codeforces Round 1796