educational codeforces string round

Codeforces vp 寄

难度标记: \(\verb!A!\) :傻逼题。 \(\verb!B!\) :看完题解后马上就会了。 \(\verb!C!\) :看完题解后还需要想一会,甚至仍然不会。 + 和 - 表示在同档题中的难度。 Codeforces Round 694 (Div. 1) 最终 \(\rm performa ......
Codeforces vp

Codeforces Round 907 (Div. 2) ABCF

Codeforces Round 907 (Div. 2)ABCF A. Sorting with Twos 题意:给你一个数组\(a_1,a_2,...,a_n\),你可以进行以下操作: 选择一个非负整数\(m\),并且\(2^m\le n\) 把\(1\le i \le 2^m\)的元素\(a_ ......
Codeforces Round ABCF 907 Div

Codeforces Round 903 (Div. 3) ABCDE

Codeforces Round 903 (Div. 3)ABCDE A. Don't Try to Count 题意:复制\(s\)串若干遍,是否能在\(s\)串中找到\(t\)串。 思路:直接暴力,注意不要超限,会MLE // AC one more times // nndbk #includ ......
Codeforces ABCDE Round 903 Div

Codeforces Round 908 (Div. 2)

比赛链接 A. Secret Sport 题解 O(1 * T) 对于一场比赛,结束前谁最后赢就是谁赢 #include <bits/stdc++.h> using namespace std; string s; void solve() { int n; cin >> n >> s; cout ......
Codeforces Round 908 Div

Educational Codeforces Round 157 D

tilian 不太会这种题 发现找到一个数就能确定整个序列 然后转而发现 前缀异或和 b1 ^ b2 = a1 b1 ^ b3 = a2 ... 我们发现要是n为偶数时能直接求出b1从而确定整个序列 而为奇数时我们无法确定b1 我们思考拆位之后 如果b1该位为0 算出真实的异或后的0 1 个数 b1 ......
Educational Codeforces Round 157

CodeForces 852C Property

洛谷传送门 CF 传送门 NOIP 模拟赛 T1,小清新几何题。 要让选出的点组成的多边形面积最大,就要让正多边形的面积减去选出的点组成的多边形面积最小。而这个面积差可以表示成 \(2n\) 个三角形的面积,即 \(\sum\limits_{i = 0}^{2n - 1} S_{\triangle ......
CodeForces Property 852C 852

String 字符串

比较String,不能用==号,而要用equals()方法。==号比较的是地址,equals()比较的是字符串里的值。 ......
字符串 字符 String

Math.round(-2019.5)的结果是 -2019

Math.round()函数返回一个数字四舍五入后最接近的整数 如果参数的小数部分大于0.5,四舍五入到相邻的绝对值更大的整数 如果参数的小数部分小于0.5,四舍五入到相邻的绝对值更小的整数 如果参数的小数部分等于0.5,四舍五入到相邻的在正无穷(+∞)方向上的整数。 例: x=Math.round ......
2019 结果 2019.5 round Math

CodeCraft-21 and Codeforces Round 711 (Div. 2)

CodeCraft-21 and Codeforces Round 711 (Div. 2) A. GCD Sum 题意 定义 \(gcdSum(x)=gcd(x,sum\ of\ digits\ of\ x)\)。 请你输出最小的 \(x\) 满足 \(x\ge n\),且 \(gcdSum(x) ......
Codeforces CodeCraft Round 711 and

Educational Codeforces Round 126 (Rated for Div. 2)

https://codeforces.com/contest/1661/ B题数据很小,直接bfs预处理就行 C题随便猜了一下,设mx=\(max\{a_i\}\)最后的值应该是 mx,mx+1,mx+2,mx+3之类的吧 D题刚开始从前面考虑,陷入僵局,一度非常的困,学习凯库勒睡了一会,就突然想到 ......
Educational Codeforces Round Rated 126

JavaScript--String对象&自定义对象&Windows对象

String对象 var str1 = new String("abc") var str2 = "abc" trim():去除字符串前后两端的空白字符 自定义对象 BOM对象 1、Window confirm方法 会产生一个返回值 var flag = confirm(""); 按确定返回true ......
对象 JavaScript amp Windows String

jackson序列化 has to be escaped using backslash to be included in string value

Jackson配置转义符的处理 // 忽略未知字段mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);// 允许出现特殊字符和转义符mapper.configure(JsonParser.Feature. ......
序列 backslash included jackson escaped

Codeforces Round 908 (Div. 2) D. Neutral Tonality

题目链接 题面翻译 给定两个序列 \(a,b\),将 \(b\) 中所有元素以任意顺序在任意位置插入 \(a\) 中,使得形成的新序列 \(c\) 的最长上升子序列最短,输出你的序列 \(c\)。 思路 首先我们可以确定一点,a数组的元素,在c数组中他们的顺序是不会有任何变化的。 说明LIS(C)> ......
Codeforces Tonality Neutral Round 908

Codeforces Round 428 (Div. 2) B. Game of the Rows

题目链接 题面翻译 现在有 \(K\) 个队,飞机有 \(N\) 排座位,每排能坐 \(8\) 个人,不同队伍的人不能坐相邻的位置。 相邻情况有 \(5\) 种 \((1, 2), (3, 4), (4, 5), (5, 6), (7, 8)\)。请问这 \(n\) 排座位是否够坐。 (\(K\) ......
Codeforces Round Game Rows 428

Codeforces Round 908 (Div. 2) C. Anonymous Informant

题目链接 题面翻译 给定长度为 \(n\) 的数列 \(a\),定义一次轮换为将 \(a_1,a_2,\cdots,a_n\) 变为 \(a_2,a_3,\cdots,a_n,a_1\)。 定义一次操作为,先选择一个满足 \(a_x=x\) 的数 \(x\),然后对数列做 \(x\) 次轮换。 再给 ......
Codeforces Anonymous Informant Round 908

Codeforces Round 908 (Div. 2)

A. Secret Sport 题意:A与B选手在下棋,规定下赢X把看作赢一局,一共赢Y把的那个是最后的赢家。 思路:因为不知道x,y到底是多少,n的范围是到20,所以只需要枚举x即可,时间复杂度不高,注意的是,如果枚举结果是A赢,那么给定字符串的最后一个值一定是A,反之也是。 #include<b ......
Codeforces Round 908 Div

有关String的内容

public static void fun(){ Scanner sc=new Scanner(System.in); String n=sc.next(); StringBuilder sb=new StringBuilder(n); sb.reverse(); n=sb.toString(); ......
内容 String

【Java SE】String.format格式化

String.format 1、字符串左对齐,不足10位的右侧补空格:[123 ] String.format("%-10s", "123"); 2、字符串右对齐,不足10位的左侧补空格:[ 123] String.format("%10s", "123"); 3、整数格式化10位,不足左侧补0:[ ......
格式 String format Java

Required request parameter 'numbers' for method parameter type String[] is not present

报错就是这个,然后报错的信息再给点详细的 org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter 'numbers' for method parameter t ......
parameter Required request numbers present

ECMAScript中有5种原始类型,即undefined、null、number、string、boolean。

ECMAScript中,变量可以存放两种类型的值,即原始值和引用值。 原始值是存储在栈中的简单数据段,也就是说,它们的值直接存储在变量访问的位置。 引用值是存储在堆中的对象,也就是说,存储在变量处的值是一个指针,指向存储对象的内存处。 ECMAScript中有5种原始类型,即undefined、nu ......
ECMAScript undefined boolean 类型 number

Codeforces Round 908 (Div. 2)

https://codeforces.com/contest/1894 A题题意说一堆,还看了好几次,读懂之后就很简单,直接输出最后的。 B题直接数一下有多少个大于2的块即可。 C题每次找到最后一个,判断一下即可,同时打上标记,保证时间复杂度。 D题手玩之后发现我们可以用以下方式插入b 将大于等于a ......
Codeforces Round 908 Div

Codeforces Round 908 (Div. 2) A-C

Codeforces Round 908 (Div. 2) A. Secret Sport 题意: 一个长为n的字符串,A表示A赢,B表示B赢。当一局比赛中A或B赢下X场,则A或B赢得此局。当A或B赢下Y局,则其胜利。结束比赛 思路: 最后一场比赛的获胜者就是整个比赛的获胜者 代码: #includ ......
Codeforces Round 908 A-C Div

CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!)

https://codeforces.com/contest/1842 C题很像leetcode上买股票那几题的套路,直接dp就行 \(z=max\{i-j+1+g[j-1] (a[i]=a[j]) \}\),g[j]表示以i结尾的最大值,很显然可以将跟j有关的项分离出来,然后对于每种ai维护最大值 ......
Div CodeTON Prizes Round Rated

使用navicat连接SQL Server出错SQLSTATE[08001]:[ODBC Driver 17 for SQL Server]Connection string is not valid;max_provs:连接字符串无效[87]

使用Navicat连接SqlServer一直报错 经过排查,发现主机地址得使用,逗号来分隔端口号,如下图 在此记录避免忘记。 感谢网友 使用navicat连接SQL Server出错SQLSTATE[08001]:[ODBC Driver 17 for SQL Server]Connection s ......
Server 字符串 Connection SQL max_provs

六、Java常用类:String,StringBuffer

一、String类 概述:是字符串的对象描述类,java中任意一个字符出都是该类的对象(实例)。 它们的值在创建后不能被更改。 构造方法:public String() public String(byte[] bytes) 将字节数组变成字符串 public String(byte[] bytes ......
StringBuffer 常用 String Java

[LeetCode] 2609. Find the Longest Balanced Substring of a Binary String

You are given a binary string s consisting only of zeroes and ones. A substring of s is considered balanced if all zeroes are before ones and the numb ......
Substring LeetCode Balanced Longest Binary

Codeforces Round 908 (Div. 2)

A 读了 10min 题,做题 7min/cf,傻逼题。 B 没啥思维难度,但是中间电脑死机了/ll,傻逼题。 C 考虑到每次操作会把 \(x\) 转到 \(a_n\) 的位置上,然后记搜即可。 D 考虑每次将 \(k\) 插入一个位置并满足最优只有在 \(a_i\geq k\geq a_{i+1} ......
Codeforces Round 908 Div

Codeforces Round 908 (Div. 2)

\(A. Secret Sport\) https://codeforces.com/contest/1894/submission/231748875 \(B. Two Out of Three\) https://codeforces.com/contest/1894/submission/23 ......
Codeforces Round 908 Div

Educational Codeforces Round 157 (Rated for Div. 2)

\(D. XOR Construction\) 首先观察 $ b_1 \oplus b_2=a_1, b_2 \oplus b_3=a_2 \ldots $ ,发现 \(b_1 \oplus b_{j+1}=\bigoplus^{j}_{i=1}a_i\) ,那么自然的想到如果第一个数字确定,后面的 ......
Educational Codeforces Round Rated 157