codeforces divisible numbers version

解决Python中报错RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn't match a supported version!

在运行requests包时,出现了以下报错信息: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn't match a supported version! ......

PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.03.00.00 in TARGET database is not current

安装完19.3后,然后打完补丁35042068(19.19),使用rman有如下的提示报错误: [oracle@slnngk ~]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Tue Apr 25 20:39 ......

[LeetCode] 2336. Smallest Number in Infinite Set

You have a set which contains all positive integers [1, 2, 3, 4, 5, ...]. Implement the SmallestInfiniteSet class: SmallestInfiniteSet() Initializes t ......
LeetCode Infinite Smallest Number 2336

Problem A. Restoring Numbers

Problem A. Restoring Numbers Pavel had two positive integers a and b. He found their sum s and greatest common divisor g, and forgot a and b after tha ......
Restoring Problem Numbers

Codeforces 1781G - Diverse Coloring(构造)

vp 时候想到大致思路了,但是死活调不对,赛后套取 cf 的数据调了好久才过/ll 首先直觉告诉我们答案不会太大。稍微猜一猜可以猜出除了四个点的菊花之外答案都是 $n\bmod 2$,下面我们来通过构造证明这件事情。 首先,链的情况是 trivial 的,直接根据奇偶性间隔染色即可。如果不是链,那么 ......
Codeforces Coloring Diverse 1781G 1781

leetcode调研version0

这是我第一次发博客,所以许多功能还不太会使用。前几次的随笔既当作记录,也当作自己的练习。 最近想要刷leetcode,纠结用哪种语言(我自己学过c/c++, python, fortran, Java),所以前期做了一些调研,在此记录一下。 c语言: 网址:https://github.com/be ......
leetcode version0 version

Educational Codeforces Round 147(A~E)(补提记录)

Educational Codeforces Round 147(Rated for Div. 2) A: 题意: 每个问号都能被替换成0~9,求替换每个问号后所能的到的数的数量 注:所得到的序列不能有前导0 思路:先判断第一位是什么,作为特判,为0,则不能得到任何数输出0,为?则答案×9再依次枚举 ......
Educational Codeforces Round 147

Codeforces Round 867 (Div. 3)(A-C)

#A. TubeTube Feed 签到题 ##思路 往后走,每次减一,记录当前所能得到最大的bi ###完整代码 #include<bits/stdc++.h> using namespace std ; #define ll long long inline ll read(){ ll s=0 ......
Codeforces Round 867 A-C Div

Codeforces 103446A - Strange Functions(凸包)

首先,根据 $\arctan$ 函数的性质,一个函数在 $x$ 处的取值是所有 $n$ 个函数中最小的,当且仅当 $|k_i\sec(x-a_i)|$ 是所有 $n$ 个函数中最小的。 和差角公式把 $\sec$ 拆开得到 $|\dfrac{k_i}{\cos(x)\cos(a_i)+\sin(x) ......
凸包 Codeforces Functions 103446A Strange

[LeetCode] 1342. Number of Steps to Reduce a Number to Zero 将数字变成 0 的操作次数

Given an integer num, return the number of steps to reduce it to zero. In one step, if the current number is even, you have to divide it by 2, otherwi ......
Number LeetCode 次数 数字 Reduce

Codeforces 1804G - Flow Control(势能分析)

成功把这道小清新题做成了一道大数据结构题,我的评价是我是小丑。 首先显然要离散化对时间轴扫描线。这个除以 $2$ 下取整的操作显然启示我们往势能的方向思考,也就是我们希望能够找到某个变量,使得这个变量的均摊变化次数在可接受范围内。但是直接以每个元素的值为势能好像也不太对,因为一次全局除以 $2$ 之 ......
势能 Codeforces Control 1804G 1804

Educational Codeforces Round 147

A 题意 思路 有前导零结果直接为0,出现在第一位的**?贡献为9**,其他地方的**?贡献为10**。 代码 #include<bits/stdc++.h> using namespace std; using ll=long long; char s[10]; int main() { int ......
Educational Codeforces Round 147

Educational Codeforces Round 147 (Rated for Div. 2)

题目链接 B 核心思路 真的需要加强了,看到这个最大值和最小值我们其实也需要往对应的最大值和最小值的相关操作去想,不如前缀最小值/前缀最大值或者是后缀最小值/后缀最大值。 这里一个比较直接的想法就是想找到不同的地方,然后看不可以扩展。那么怎么看是否可以扩展呢,如果是左边的话,就看当前的位置是不是小于 ......
Educational Codeforces Round Rated 147

The binary version of its metadata is 1.8.0, expected version is 1.5.1.

C:/Users/sdt16354/.gradle/caches/transforms-3/b92f389f516aa233b37ae70b7a7c1337/transformed/jetified-annotation-jvm-1.6.0.jar!/META-INF/annotation.kotl ......
version expected metadata binary is

Educational Codeforces Round 127 (Rated for Div. 2)

题目链接 D 核心思路 首先挖掘下操作的性质吧: x>1&&x+3<10: 1 x x+1 x+2 x+3 10 我们可以发现这样子好像对于我们的结果是没有影响的,答案还是9. 所以这个性质就挖掘出来了啊,只要我们把一段连续的插入到对应的区间里面就好了。也就是只要这个区间的左端点小于插入连续的数的最 ......
Educational Codeforces Round Rated 127

Codeforces Beta Round 96 (Div. 1) -- C. Logo Turtle (dp,记忆化搜索)

#记忆化搜索 就是暴力,多一步优化,走过的路别走了。说实话,可能是数据水了,居然能过。 const int N = 510; string s; int n, ans; bool st[501][501][2][50]; void dfs(int x, int idx, int dir, int k ......
Codeforces 记忆 Turtle Round Beta

Vue学习笔记之Node Sass version 8.0.0 is incompatible with 4.0.0错误

输入以下两个命令: npm uninstall node-sass npm i -D sass 注:Mac环境如果进行了系统升级,需要重新安装Xcode,执行命令 xcode-select install 不然会出现如下的错误 Mac 解决 gyp: No Xcode or CLT version ......
incompatible 错误 version 笔记 Node

Educational Codeforces Round 147 (A-D)

#A. Matching 橘子熊:这题太简单了我不想写 ##题面 Description 给定给一个带问号的字符串,求有多少种可能的数字 Input 多次询问,一次一个字符串 Output 对于每次询问,输出可能的数字的总数 数据范围与约定 2e5次询问,单词询问不超过5个字符 ##思路 主要思路 ......
Educational Codeforces Round 147 A-D

Educational Codeforces Round 39 (Rated for Div. 2) -- D. Timetable (DP)

写得很折磨人,每次dp都写个一个多小时,写出来明明觉得不难 ^.^ 题目大意:可以进行K次操作,把删除1,进行k次操作后每行第一个 1 和最后一个 1 的位置 相减的绝对值加 1 得到的结果最小。 做法:每次肯定是要从左删或者从右边删,然后顺着这个思路,先把每行的进行小于等于k次操作时, 每行最小的 ......
Educational Codeforces Timetable Round Rated

Educational Codeforces Round 147 (Rated for Div. 2) A-D题解

A. Matching 题意:给出一个数,数中可能会有?,可以用0-9替换问号,问最后有多少种方法 Solution 对于位于首位的数可以用1-9替换,对于其他位置的额、可以用0-9替换,如果首位为0则无解 void solve() { string s;cin>>s; if(s[0]=='0') ......
题解 Educational Codeforces Round Rated

Quasi Binary---codeforces

# Quasi Binary ## 题面翻译 **题目描述** 给出一个数n,你需要将n写成若干个数的和,其中每个数的十进制表示中仅包含0和1。 问最少需要多少个数 **输入输出格式** 输入格式: 一行 一个数 n(1≤n≤10^6) 输出格式: 最少的数的个数,并给出一种方案。 ## 题目描述 ......
codeforces Binary Quasi

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''',b_5='17',b_6='' wher

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right s ......

Codeforces Round 866 (Div. 2)(A~C)

A. Yura's New Name 题意 在字符串$s$中添加 "" 或者 "^",使得$s$中的任意字符都必须为 "^^" 或者 "^^" 的一部分,求最少要添加的字符数量 思路 当字符串头部为 "_" 时,一定要在前面添加1个字符 "^" 当字符串尾部为 "_" 时,一定要在后面添加1个字符 ......
Codeforces Round 866 Div

Educational Codeforces Round 110 (Rated for Div. 2)

题目链接 C 核心思路 这个题目其实我们可以转换为把当前串转换为完美串有多少种方案呢,也就是我们从前往后一步一步往完美串去构造我们的方案。 这个思路非常巧妙,我刚开始的思路局限于算贡献去了。 完全就脱离了正确的思路。 集合定义 $f[i][0/1]表示的是处理了前i个位置,并且当前位置是0的方案数$ ......
Educational Codeforces Round Rated 110

Codeforces Round 689 (Div. 2, based on Zed Code Competition)D.Divide and Summarize

题意: 我们给定包含n个正整数的数组,我们可以对这个数组执行一些操作之后,可以让数组内元素的和成为我们想要的数。 我们对数组的执行操作一共分为三个步骤,第一个步骤是我们首先计算出数组的中间值mid。这里mid的定义不是中位数也不是均值,而是最大值和最小值的均值。也就是mid = (min + max ......

阶梯网格计数模型 & Codeforces 1770G - Koxia and Bracket 题解

更差的阅读体验(bushi) 其实 2022 年省选前联考出过类似的套路,但当时太鸽了就没有总结。 阶梯网格计数问题是指以下一类问题: 问题:给定一个 $n$ 列阶梯状网格图,第 $i$ 列高度为 $c_i$(保证 $c_i$ 不降),每次可以向上或向右走一步,不能超出网格边界(即所有经过的点 $( ......
题解 网格 阶梯 Codeforces 模型

codeforces #864 div2 B

GCD Partition 这道题首先要解决一个问题,要把区间分成几块,可以证明分成两块是更优 首先我们假设把区间分成了m(>= 2)块 b1, b2, b3, ...,bm,则答案是gcd(b1, b2, b3,..., bm),则b1,b2是 gcd(b1, b2, b3,..., bm)的倍数 ......
codeforces div2 864 div

AtCoder Regular Contest 114 F Permutation Division

洛谷传送门 AtCoder 传送门 这题居然是之前某场模拟赛(contest 701)的 T1……(@Vidoliga 场切但是被卡常/bx) 下面记 $m$ 为原题面中的 $K$,$a_i$ 为原题面中的 $P_i$。 不难发现后手的策略是把所有段按照段的第一个数从大到小排序接在一起。 考虑若 $ ......
Permutation Division AtCoder Regular Contest

Educational Codeforces Round 147 (Rated for Div. 2) A ~ C

A. Matching 题意:   给定一个字符串,将其中的 ‘?’ 替换成数字,不含前导0,如果字符串前导为0,输出0.。 分析:   每个地方有10种可能方案,在特判一下第一位就行了。 ......
Educational Codeforces Round Rated 147

Educational Codeforces Round 147 (Rated for Div. 2)

Educational Codeforces Round 147 (Rated for Div. 2) 链接 Educational Codeforces Round 147 (Rated for Div. 2) A题 如果第一位数是0,直接打印0 如果第一位数是'?',有9个数可以选择,如果其他位 ......
Educational Codeforces Round Rated 147