educational codeforces string round
Pinely Round 2 (Div. 1 + Div. 2) (CF1863)
本来开了某场远古 Div 1,然后学了一堆前置知识至今仍然不会 E。换一场写来得及吗? A. Channel 模拟,略。 B. Split Sort Description 给你一个长度为 \(n\) 的排列。 每次操作你可以选择一个数 \(x\),然后类似于快速排序地把小于 \(x\) 和大于等于 ......
Codeforces Round#905 解题报告
按理来说最近开始了一天一套 div2 计划,第一天做了一套 Div1,第二天做了 hustfc,第三天因为要赶 latex 期末考试,所以什么也没做。 明天写一下 hustfc 比较牛的几题。 A 暴力怎么做,是不是加加加,然后判断。 B 本质上是让长度为 \(i\) 的后缀全是 \(0\) 那么找 ......
String和StringBuffer的区别
String 和 StringBuffer 是 Java 中两种用于处理字符串的不同类,它们之间有一些重要的区别。 可变性: String 是不可变的(immutable):一旦创建了一个 String 对象,就不能更改它的内容。每次对 String 进行修改操作(例如拼接字符串),都会创建一个新的 ......
Codeforces Round 904 (Div. 2)
A. 没想到是暴力,做的很晚 B. 手玩一下即可 C. Medium Design 给定一个长为 \(n\) 的数组 \(a\) ,和若干条线段 \([l_i,r_i]\) ,你可以选择这其中的任何若干条线段,并让 \(a_l\sim a_r\) 均 \(+1\).请你计算可以得到的 \(\max( ......
Easy Excel 导出存在绿色角标问题[返回字段类型是数字,当时使用String来接收]
一、背景 Easy Excel 导出,发现excel 存在大量的绿色角标,很影响美观,如果个人使用可以设置wps或office 忽略检测警告, 但是我是对业主的,所以这一方式对我不适用,只能通过代码的方式解决. 二、实现 通过以下创建一个 ExcelWriter ,实现去绿色角标的关键是 使用eas ......
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) ......
「题解」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 ......
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 ......
Codeforces Round 905 div2 F题
记答案为\(ans_i\),表示从1到i次修改出现的字典序最小的数组a, \(c\)数组表示\(ans_i\)出现之后,所有修改的累加和。用一个vector存一下\(ans_i\)之后的所有修改。从1到q遍历每一次修改时,对\(c\)数组进行区间赋值操作,如果\(c\)数组中第一个不为0的数<0,那 ......
VK Cup 2016 - Round 1 (CF639)
A. Bear and Displayed Friends 这是 Div2 的题,不写。 B. Bear and Forgotten Tree 3 这种东西怎么评蓝的? Description 给定 \(n,d,h\),构造一棵有 \(n\) 个点,直径为 \(d\),高度为 \(h\) 的树。 \ ......
C++ char String
C++ char string 目录C++ char string字符char字符数组遍历基本函数字符比较char*、char[]转换为string字符串 String 类1.声明和初始化2.string的大小和容量3.拼接append()&+操作符4.插入push_back()&insert()5 ......
「解题报告」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 905 (Div. 2)
Preface 周日晚上Div1,2,3同乐,但我不想打Div1,同时第三个号由于只打了两场没够到Div2的门槛,因此刚好打不了Div2,遂玩了一晚上LOL 今天补了下这场题感觉难度偏低,E之前的题都比较签,F刚开始没想到转化成差分最小准备去写扫描线+线段树了,后面发现其实可以写的很简单 A. Ch ......
[NEERC2004-2005] Hyper Almost Permutative String 题解
题目链接 题目大意 称一个长度为 \(n\) 的字符串为排列的,当且仅当它包含了前 \(n\) 个大写字母。 称一个长度为 \(n+1\) 的字符串为基本排列的,当且仅当可以通过删去一个字符使得它是排列的。 现在给定两个长为 \(n\) 的排列的字符串 \(s_1,s_2\),求一个最短的字符串 \ ......
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\) 删除。 所以可以发现差分数组中剩下的一定是操作前的最大值。 由于操作 ......
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\) 就不会对序列的答案产生 ......
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 905 (Div. 3)
Codeforces Round 905 (Div. 3) A. Morning 解题思路: 首先\(4\)个数字都要打印出来,所以\(ans\)起始值为\(4\)。 接着就是从左向右移动绝不回头,鼠标移动的距离和就是两两数字之差。 注意:这里\(0\)位置其实是\(10\). 代码: #inclu ......
宝塔:续签SSL证书报错string indices must be integers
网站SSL证书过期,续签的时候,报错string indices must be integers。 处理方法: 1.点击左侧首页,选择“修复”; 2.修复之后,重新点击网站,设置>>>SSL >>>续签证书,等待流程通过,点击保存即可。 ......
Codeforces Round#905 解题报告
由于是解题报告不是过题报告,所以理所当然的放弃了后三题代码的写。 感觉这场 Div1 D 是 cyh 的菜,E 是 gjk 的菜。我负责菜。 只写 Div1 题的题解。 A 双指针可以做 \(m=1\) 你发现随便换 \(a_1\) 答案最多减少 \(1\),而且 \(a_1\) 越趋向于减少,所以 ......
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 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. 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/ ......
Codeforces Round 905 (Div. 3)
E. Look Back 因为每次都是2,可以推出x<=y2^(n),转化成 x/y<=2^(n),求n直接取对数即可 注意: 1.答案很大要开LL 2.不要直接乘,会爆LL,直接利用原式即可,如果后面的大,就减去大多少的对数 3.记得向上取整 点击查看代码 #include<bits/stdc++ ......
Codeforces Round 905 (Div. 2)
目录写在前面ABCD1/D2E写在最后 写在前面 比赛地址:https://codeforces.com/contest/1884 oonp 这场 div2 怎么才 2k5 人打啊我草 里面还不知道多少大神的小号,呃呃 打了 1k3 掉了 75 分也是牛逼 A 考虑如何拼出一个长度为 \(n-k\) ......
[924] f-strings in Python
ref: f-strings in Python ref: Python's F-String for String Interpolation and Formatting F-strings, also known as formatted string literals, are a feat ......
Codeforces Round 905 - div.3(A B C D E)
目录Codeforces Round 905 (Div. 3)A. MorningB. Chemistry Codeforces Round 905 (Div. 3) A. Morning 模拟光标移动即可 void solve(){ string ss; cin >> ss; char ch = ......