educational codeforces string round

2023.08.12 codeforces round 892 div2

年轻人的第三场div2(已完成:ABCDE) rank:1265 solved:4 rating change:+276 new rating:1323 A.United We Stand 题意:给定一个数列a,问是否能分成两个非空的数列b和c,使得c中任意一个数不是b中任意一个数的因子; 若x是y ......
codeforces round 2023 div2 892

牛客周赛 Round 7

# [牛客周赛 Round 7 ](https://ac.nowcoder.com/acm/contest/63091) ## [A-游游的you矩阵_牛客周赛 Round 7 (nowcoder.com)](https://ac.nowcoder.com/acm/contest/63091/A) ......
Round

c++ std::to_string实现原理

写这篇的起因是看到 MSVC STL 的一个[issue](https://github.com/microsoft/STL/issues/3857),里面提到```to_string```的实现,正常人的思维是直接除10拿到每位, 其实有个更高效的查表法 # 字符串转数字 除100拿到两位,并查表 ......
to_string 原理 string std to

Codeforces Round 892 (Div. 2)

c题jls的代码,拿过来仔细研究了一番,终于弄明白了。 https://codeforces.com/contest/1859/problem/C jls代码 ``` #include using i64 = long long; struct DSU { std::vector f, siz; D ......
Codeforces Round 892 Div

Codeforces Round 878 (Div. 3)

比赛链接:https://codeforces.com/contest/1840 ## A. Cipher Shifer **题意**:给你一个加密后的字符串,加密规则是将原字符串每个字符连续写两次,并在其中添加任意长度大于等于零的子串,求解原字符串 **思路**:不用管添加的子串,从第一个字符开始 ......
Codeforces Round 878 Div

Codeforces Round 892 (Div. 2)

# Preface 最接近橙名的一场,可惜给我一个小时也没想到E的关键点,后面徐神一点拨就懂了 虽然现在这个号已经到渡劫局了但因为之前有场比赛给了ztc一份代码然后他直接没咋改交上去了,估计下次roll Rating的时候这个号要掉200来分了 嘛不过也无所谓反正下次打另一个号冲分,而且像我这种永远 ......
Codeforces Round 892 Div

2023年多校联训NOIP层测试7+【LGR-149-Div.3】洛谷基础赛 #2 & qw Round -1

# [2023年多校联训NOIP层测试7,集训欢乐赛,绝对欢乐,童叟无欺](http://www.accoders.com/contest.php?cid=4470) 赛时在回家的路上+睡觉,所以没打。 ## $T1$ 近似[ybtOJ 2049:【例5.19】字符串判等](http://ybt.s ......
基础 Round 2023 NOIP 149

【题解】Educational Codeforces Round 146(CF1814)

而且怎么感觉 E,F 比 D 要简单很多,大概是因为比较套路吧[惊恐] ## A.Coins ### 题目描述: **本题一共有 $t$ 组数据。** 每组数据包含两个整数 $n$ 和 $k$,如果存在两个非负整数 $x,y$,满足 $2\times x+k\times y=n$,输出 `YES`, ......
题解 Educational Codeforces Round 1814

Codeforces Round 892 (Div. 2)(vp)

# [Codeforces Round 892 (Div. 2) ](https://codeforces.com/contest/1859) ## A United We Stand **题意:给一个数组,让你把它分成两个数组,第二个数组里的数不能是第一个数组里的数的除数,先输出两个数组的长度,依 ......
Codeforces Round 892 Div vp

Codeforces Round 892 (Div. 2)

手速慢了,掉分 ## C. Another Permutation Problem [Problem - C - Codeforces](https://codeforces.com/contest/1859/problem/C) ### 题意 给定一个正整数$n$,设序列$p$为$n$的排列,求$ ......
Codeforces Round 892 Div

HDU7326 string magic(Easy Version)

## HDU7326 string magic(Easy Version) ### tag:回文自动机 ### [题目链接](http://acm.hdu.edu.cn/showproblem.php?pid=7326) ### 题意: 多组样例,每组输入一字符串(长度1e5以内),输出满足下列条件 ......
Version string magic 7326 Easy

Codeforces Round 892 div2.C

这C真的魔幻,官方题解完全和写的不一样,太玄学了,打表发现的规律 这是打表代码: int main() { cin >> n; vector<int> a(n + 1); for (int i = 1; i <= n; i++) a[i] = i; LL ans = 0; do { auto b = ......
Codeforces Round div2 892 div

Codeforces Round 892 (Div.2)

## A. United We Stand >![image-20230813113018886](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230813113018886.png) ### 题解 >* 赛时想复杂了 >* 题目 ......
Codeforces Round 892 Div

Codeforces Round 764 (Div. 3)(vp)

# [Codeforces Round 764 (Div. 3) ](https://codeforces.com/contest/1624) ## A Plus One on the Subset **题意:判断最大和最小差多少即可** ```c++ void solve() { int n; c ......
Codeforces Round 764 Div vp

Codeforces Round 874 G题解

# 做不动那么多题了,来个G G就是问你一棵树能切成多少个大小为3的链,想了半天,想过dp啥的,但是后来发现这个贪心就好了,可以证明贪心找不到的,其他方法也找不到 好久没复健了,这是第一次,感觉以后要多做题才可以 ```cpp #include using namespace std; conste ......
题解 Codeforces Round 874

【LGR-149-Div.3】洛谷基础赛 #2 & qw Round -1

## T1 签到。 ## T2 送分题。 ## T3 大模拟,但是TLE两个点。 ```cpp #include #define ll long long #define int long long #define re register using namespace std; const int ......
基础 Round LGR 149 Div

WriteBuffer ReadBuffer String

在实际编程中,经常会用到Buffer,当string作为Buffer传值时需要注意的是 1, string的值的起始索引是1,千万记住! 2, 有时候需要先告诉系统去开辟出内存空间,用SetLength函数。 如下代码,示范了再Move、 WriteBuffer、 ReadBuffer时候的用法: ......
WriteBuffer ReadBuffer String

string reversal

python def reverse_string(s): return s[::-1] print(reverse_string("Hello, World!")) # Output: "!dlroW ,olleH" print(reverse_string("Python is awesome" ......
reversal string

Codeforces Round891(Div3)

说在前面的话: 心血来潮想要补一场Div3,这些题目确实很有意思。英文题面真的难懂,但是洛谷上的简洁题面无疑降低了难度。 然后通过这次补题经历,更加感到了**不开long long见祖宗**,所以,读者可以发现有几道题用了`signed`(源代码已经改成这样力,不想被long long再搞一次了)。 ......
Codeforces Round Div3 891 Div

Codeforces Round 799 (Div. 4)(vp)

# [Codeforces Round 799 (Div. 4)](https://codeforces.com/contest/1692) ## A Marathon ```c++ void solve() { vector a(4); int goal; cin >> goal; int ans ......
Codeforces Round 799 Div vp

Codeforces 1854E - Game Bundles

ll k;int ord[35],a[65];mt19937 rng(time(0)); int main(){ scanf("%lld",&k); if(kk){--n;break;} for(int i=60;i>=a[n];i--)dp[i]+=dp[i-a[n]]; }ll rk=k-dp[ ......
Codeforces Bundles 1854E 1854 Game

2023.8.11 Pure GJ Round

评价:无思维场,纯码力场,给我这种无码力选手区分了 -200pts Fact:因为有补题环节所以打得很激进写了 4 题正解然后开始调 T2,3,4 最后只有 T2,3 过了样例。快结束的时候还给自己都 hack 了。最后喜提暴力分。好处是补题改改就过了() ## B - Luogu P4334 省略 ......
Round 2023 Pure 11 GJ

CodeForces 1610F Mashtali: a Space Oddysey

[洛谷传送门](https://www.luogu.com.cn/problem/CF1610F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1610/F "CF 传送门") 比较有启发性的题。 首先,设 $a_u$ 为与点 ......
CodeForces Mashtali Oddysey 1610F Space

【题解】Educational Codeforces Round 147(CF1821)

自己做出来了 A-E,F 算是搞懂 GF 后第一道符合我这个菜鸡水平的实战,可惜的是根本没意识到可以 GF。 ## A.Matching ### 题目描述: 整数模板是**每位均为数字或问号**的字符串。 如果可以用数字**替换**模板中的每个问号,从而获得该**正整数(严格大于 $0$)** 的十 ......
题解 Educational Codeforces Round 1821

Codeforces Round 874 (Div. 3) 题解

# A. Musical Puzzle 字符串 $s$ 的不同的长度为 $2$ 的子串个数就是答案 可以用 set 处理 # B. Restore the Weather 将 $a$ 数组排序后,在 $b$ 数组中找到第一个大于等于 $a_i-k$ 的元素与 $a_i$ 对应即可 可以用 multi ......
题解 Codeforces Round 874 Div

Codeforces Round 878 (Div. 3) 题解

# A. Cipher Shifer 从头开始扫一遍即可,扫到两个相同的表示某一个字符的解密结束 # B. Binary Cafe 首先,我们不妨把题意转换为 **有多少种不同的花钱方案** 因为每一种咖啡就是一个二进制有 $k$ 位的数字的其中一位,而对于不同的方案,其二进制位不完全相同,则每一个 ......
题解 Codeforces Round 878 Div

《转换篇》string和int

# string转int 参考链接:https://blog.csdn.net/m0_70283041/article/details/126102424 // 法一 int i = int.Parse("100"); int text = int.Parse("整型");// 如果把非字符型(除了 ......
string int

2023牛客周赛 Round 6

https://ac.nowcoder.com/acm/contest/62622/C # c题 ### 从x!作为切入点,阶乘增长的非常快,我们可以枚举x,从而达到固定x,只剩y一个变量,问题转变为一次函数绝对值求最小值的数学问题,显然可以o(1)。 $$13!=6227020800 =6.227 ......
Round 2023

20230723牛客round4D题:给出一个大数的所有约数,通过dfs用质因子反向构造约数

# 两个正整数a,b,请问a∗b有哪些因子 #1≤a,b≤1e9 # 求因子的数量并给出所有因子 ### 本题无脑的暴力显然不能过,但用set存数,加上考虑到a*b的所有约数其实就是a的所有约数和b的所有约数分别相乘(核心) # 补充常识:int范围内数的约数个数最多为1600,2e9数的约数个数最 ......
约数 大数 因子 20230723 round4D

HDU 多校 Round #6 题解

# HDU 多校 Round #6 题解 $\text{By DaiRuiChen007}$ ## A. Count [Problem Link](https://acm.hdu.edu.cn/showproblem.php?pid=7336) **题目大意** > 求有多少个长度为 $n$,字符集 ......
题解 Round HDU