educational codeforces string round

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

A. Two Vessels Problem 题目 Sol & Code 签到题 #include <bits/stdc++.h> typedef long long ll; int min(int a, int b) { return a < b ? a : b; } int max(int a, ......
题解 Codeforces Round 895 Div

Codeforces Round 901 (Div. 2)

Codeforces Round 901 (Div. 2) A - Jellyfish and Undertale 解题思路: 卡在最后秒放。 若\(x_i > (a - 1)\):那么该\(x_i\)的贡献为\(a - 1\)。 否则,该\(x_i\)的贡献为\(x_i\)。 代码: #inclu ......
Codeforces Round 901 Div

Codeforces Round 653 (Div. 3)

A*800: 给定 x,y,n。 找出k%x==y && k<=n。 让 t=(n-y)/x, 答案就是t*x+y B*900: 如果说n有除了2,3以外的质数,答案就是-1 让c2=2出了多少次, c3情况相同 如果c2>c3,答案也是-1因为不可能移除掉那些2 其他情况:答案就是c3+(c3-c ......
Codeforces Round 653 Div

[CF1654F] Minimal String Xoration

Minimal String Xoration 有点智慧但不是特别智慧反正是我达不到的智慧。 打表可以看出长度为 \(2^x\) 的 \(i\oplus k\) 出现次数为 \(2^{n-k}\)。 进一步发现,设 \(f(k,x)\) 当前选取 k 时,数列前 \(2^k\) 的下标。 则 \(f ......
Xoration Minimal String 1654F 1654

Educational Codeforces Round 155 (Rated for Div

B. Chips on the Board 题解:贪心 显然我们可以把题意转化为:对于任意一个\((i,j)\),我们可以花费\(a_{i,j}\)的代价占据第\(i\)行和第\(j\)列,求占据所有格子的最小代价 考虑两种情况: 在每一行选一个格子 在每一列选一个格子 贪心选即可 int n, a ......
Educational Codeforces Round Rated 155

Codeforces Round 898 (Div. 4)

由于题目补完才来写总结,导致前面的有的题目都需要重新再看一遍,只好当作复习了。 但考虑到趁热打铁,先看H. H题:从小白视角来看乍一看是博弈论,仔细思考以后发现是图论。本题给的是基环树,意识到这一点很重要,这个条件是让本题不是很复杂的关键。n个点n条边且没有重边保证这个联通图中只有一个环。由于瓦能够 ......
Codeforces Round 898 Div

Codeforces Round 900 (Div. 3)

目录写在前面ABCDEFG写在最后 写在前面 比赛地址:https://codeforces.com/contest/1878。 前天晚上他妈睡不着觉又不想看漫画打游戏于是到阳台上开把 div3 放松心情。 40min 过了 5 题把剩下两题都口了感觉没意思了于是睡觉。 太菜了还是,现在是 div3 ......
Codeforces Round 900 Div

Educational Codeforces Round 122 (Rated for Div. 2)

A. Div. 7 #include<bits/stdc++.h> using namespace std; void solve(){ int n , a , b , c ; cin >> n; c = n % 10 , n /= 10; b = n % 10 , n /= 10; a = n % ......
Educational Codeforces Round Rated 122

Codeforces Round 627 (Div. 3)

Codeforces Round 627 (Div. 3) A. Yet Another Tetris Problem 解题思路: 最终所有位置减去的数是相同的,也就是说能否通过\(+2\)的方式使所有数相同。 即如果存在两个数之间的差为奇数,那么就不可能同时为\(0\)。 代码: #include ......
Codeforces Round 627 Div

Educational Codeforces Round 155 (Rated for Div. 2)

Preface 这天晚上这场因为不明原因(玩CCLCC中)就没有打,只能赛后补一下 这场的EF都不算难初看都有做法,但好家伙E写挂两发,F写个根号做法直接T到天上去了 A. Rigged! 签到题,对于所有的\(e_i\ge e_1\)的\(i\),求出\(S=\max s_i\),根据\(S+1\ ......
Educational Codeforces Round Rated 155

Codeforces Round 695 (Div. 2)

练习笔记: A:https://codeforces.com/contest/1467/problem/A 一开始以为是 987654321..... 交了两发WA。慢慢想想就是如果说我是第二个号码放8就是98901234.... 交了就是AC B: https://codeforces.com/c ......
Codeforces Round 695 Div

加训日记 Day5——codeforces round 899 再战div2

Day5,9.25,codeforces round 899 div2 ·事实证明自己的思维和手速都还不够快,晚上还晚来了一点 ·B题属实是,上来就想着并查集(菜鸡是这样的)然后发现不会写捏 ·思考了很久(看数据量)感觉是枚举暴力,但是又想不到怎么去枚举 ·一题遗憾离场 ·顺理成章的-26 ......
codeforces 日记 round Day5 div2

string:Python的文本常量与字符串模板

# 前言 在程序中,有很多高效率的[字符串](https://so.csdn.net/so/search?q=%E5%AD%97%E7%AC%A6%E4%B8%B2&spm=1001.2101.3001.7020)处理方式,如果开发者能够完全掌握这些高效的字符串处理,往往在开发者也能事半功倍。比如针 ......
常量 字符串 字符 文本 模板

Problem - 616C - Codeforces

Problem - 616C - Codeforces C. The Labyrinth 如果是直接对\(*\)去跑dfs或者bfs的话无疑是会超时的 既然如此,那我们可以去对 \(.\) 跑搜索,将各个连通的 \(.\) 块标号并计算出连通块内的点的数量,然后去遍历\(*\)的时候只需要上下左右跑 ......
Codeforces Problem 616C 616

string_array_object_date_php

title: PHP String、Array、Object、Date 常用方法小结 tags: [PHP, 常用方法小结] categories: 常用方法 keywords: 常用方法小结,string,array,object,date,php description: php常用方法小结 O ......

string_list_map_date_dart

title: Dart String、List、Map、Date 常用方法小结 tags: [Flutter, Dart, 常用方法小结] categories: 常用方法 keywords: 常用方法小结,string,list,map,date,dart description: dart常用方 ......

string字符串操作

string字符串操作 using System; using System.Linq; using UnityEngine; public class Guse : MonoBehaviour { void Start() { string str = "ASc_b1 6U2ja"; string ......
字符串 字符 string

P8512 [Ynoi Easy Round 2021] TEST_152

题外话 纪念一下第一道 Ynoi Easy Round.(上次那个是 Ynoi 模拟赛,什么时候才能做正统 Ynoi 啊/ll 在图老师的逼迫下换了洛谷博客的主题和背景,还挺好看的感觉。 原题传送门 题意 给定一个长度为 \(m\) 的序列,初始全为 \(0\)。再给 \(n\) 个区间赋值操作。 ......
P8512 Round 8512 2021 Easy

Codeforces Round 900 (Div. 3)

Codeforces Round 900 (Div. 3) A. How Much Does Daytona Cost? 解题思路: 可取一个元素作为子数组,数组中存在\(k\)即可。 代码: #include<bits/stdc++.h> using namespace std; using ll ......
Codeforces Round 900 Div

CF1197 Educational Codeforces Round 69 (Rated for Div. 2)

CF1197A DIY Wooden Ladder 答案为 \(\min(a_{n-1},n-2)\)。 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; ......
Educational Codeforces Round Rated 1197

CF1195 Codeforces Round 574 (Div. 2)

CF1195A Drinks Choosing 先将相同权值的配对直到只剩下一个,然后再配剩下的单个。 #include<iostream> #include<cstdio> using namespace std; const int N=1005; int n,k; int a[N]; int ......
Codeforces Round 1195 574 Div

CF1440 Codeforces Round 684 (Div. 2)

CF1440A Buy the String 每个点有两种决策,要么选当前的字符,要么选跟当前字符不同的字符,取个较小值相加。 #include<iostream> #include<cstdio> using namespace std; const int N=1005; int T; int ......
Codeforces Round 1440 684 Div

CF1447 Codeforces Round 683 (Div. 2, by Meet IT)

CF1447A Add Candies 可以将操作看做将 \(a_i\) 减 \(i\),然后第 \(i\) 次操作 \(i\) 就是合法的。 #include<iostream> #include<cstdio> using namespace std; int T; int n; void so ......
Codeforces Round 1447 Meet 683

CF1036 Educational Codeforces Round 50 (Rated for Div. 2)

CF1036A Function Height 答案为 \(\lceil \frac{k}{n}\rceil\)。 #include<iostream> #include<cstdio> using namespace std; long long n,k; int main() { scanf(" ......
Educational Codeforces Round Rated 1036

CF1008 Codeforces Round 497 (Div. 2)

CF1008A Romaji 直接模拟。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int n; char s[N]; int main() { scanf( ......
Codeforces Round 1008 497 Div

CF1011 Codeforces Round 499 (Div. 2)

CF1011A Stages 每次记下上一个选的位置,贪心能填就填。 #include<iostream> #include<cstdio> using namespace std; const int N=55; int n,k; char s[N]; int cnt[27]; int main( ......
Codeforces Round 1011 499 Div

CF1072 Codeforces Round 517 (Div. 2, based on Technocup 2019 Elimination Round 2)

CF1072A Golden Plate 第 \(i\) 个矩形的周长为 \(2(w - 4(i - 1))+2(h - 4(i - 1))-4\),枚举 \(i\) 求和。 #include<iostream> #include<cstdio> using namespace std; int n ......
Round Elimination Codeforces Technocup based

CF1079 Codeforces Round 522 (Div. 2, based on Technocup 2019 Elimination Round 3)

CF1079A Kitchen Utensils 令 \(c_i\) 表示餐具 \(i\) 出现的数量,最小的餐具套数为 \(t=\lceil \frac{\max\{c_i\}}{k}\rceil\),按照这个计算就好了。 #include<iostream> #include<cstdio> # ......
Round Elimination Codeforces Technocup based

CF1020 Codeforces Round 503 (by SIS, Div. 2)

CF1020A New Building for SIS 分类讨论 \(a,b\) 两个端点的几种情况就好了,特判 \(t_a=t_b\) 的情况。 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> usi ......
Codeforces Round 1020 503 Div

CF1162 Codeforces Round 557 (Div. 2) [based on Forethought Future Cup - Final Round]

CF1162A Zoning Restrictions Again 每个位置越高越好,暴力模拟即可。 #include<iostream> #include<cstdio> using namespace std; const int N=55; int n,h,m; int a[N]; int m ......
Round Forethought Codeforces Future Final