interesting codeforces function 1538f

codeforces图论合集

Cyclic Operations 给定一个数组$a$,每次构造一个数组$\space l \space$长度为$\space k\space$,数组$\space a\space$与$\space l\space$转换关系如下 : $a_{l_1}\to l_2\space,\space a_{l ......
codeforces

Codeforces Round 897 (Div. 2) 考试总结

这次打得很好,相较于 div3 的脑残题和签到题来说,div2 的思维难度更加的大。同时还有除传统题外,其他的题型出现。比如交互题等。这次能在考场上想出三道较于之前是有很大的进步的。 赛时实况: A B C D E1 E2 F √ √ √ × × × × 赛后改题情况: A B C D E1 E2 ......
Codeforces Round 897 Div

Codeforces Round 882 (Div. 2) 题解

Codeforces Round 882 (Div. 2) 这题很简单的吧,比较脑抽的就是D,下面详细说,我nloglogn过不去2e5说实话有点不应该,感觉有更聪明的办法搞这个。 很奇怪的一点是,yongwham究竟是怎么只做出来A的???? A. The Man who became a God ......
题解 Codeforces Round 882 Div

Codeforces 1868C/1869E Travel Plan 题解 | 巧妙思路与 dp

题目链接:Travel Plan 题目大意:\(n\) 个点的完全二叉树,每个点可以分配 \(1 \sim m\) 的点权,定义路径价值为路径中最大的点权,求所有路径的价值和。 对于任意长度(这里主要指包括几个节点)的路径 \(t\),最大点权不超过 \(k\) 的方案数有 \(k^t\) 个, 因 ......
题解 Codeforces 思路 Travel 1868

Codeforces Round 772 (Div. 2) E.Cars 二分图染色/拓扑排序

Cars 二分图染色/拓扑排序 题意 坐标轴 $X$ 上有 $n$ 辆汽车。每辆车最初位于一个整数点,并且没有两辆车位于同一点。此外,每辆车都可以向左或向右定向地、可以随时以任何恒定的正速度地沿该方向移动。定义两种关系: 如果两辆汽车无论速度如何都永远不会到达同一点,我们称它们为 无关紧要的。换句话 ......
拓扑 Codeforces Round Cars 772

Codeforces Round 776 (Div. 3) B. DIV + MOD

定义函数 \(f_a(x) = \lfloor \frac{x}{a} \rfloor + x \mod a\) 。 回答 \(q\) 个独立询问,每个询问给出 \(l, r, a(1 \leq l,r,a \leq 10^9)\) ,询问 \(f_a(x)\) 在定义域 \([l,r]\) 上的最 ......
Codeforces Round 776 Div DIV

Codeforces Round 781 (Div. 2) B. Array Cloning Technique

给一个长度为 \(n\) 的数组 \(a\) 。开始只有一份所给 \(a\) 的副本。你可以做以下两种操作: 选择任意一个副本并且克隆它,然后将会多出一个克隆副本。 交换两个元素,他们属于任意两个副本(可能是同一个)。 需要判断最小操作数,使有一个副本的所有元素相同。 观察一:只需要在开始的副本上让 ......
Codeforces Technique Cloning Array Round

Codeforces Round 787 (Div. 3) B. Make It Increasing

给一个长为 \(n\) 的数组 \(a_1, a_2, \cdots, a_n \quad (0 \leq a_i \leq 10^9)\) 。可以执行以下操作任意次: 选择任意一个 \(a_i\) 并且执行 \(a_i = \lfloor \frac{a_i}{2} \rfloor\) 。 输出最 ......
Codeforces Increasing Round Make 787

Codeforces Round 897 (Div. 2)

Preface 这场周一晚上因为沉迷玩《Chaos Child》就没打,赛后点开一看人傻了怎么E2都有1k+的人过 后面补了下发现确实全是丁真题,早知道给小号上上分了 A. green_gold_dog, array and permutation 签到题,把大的\(a_i\)和小的数匹配即可 #i ......
Codeforces Round 897 Div

Codeforces Round 791 (Div. 2) A. AvtoBus

已知有 \(n\) 个轮子,会有一个车队车来换轮,且恰好使用完这些轮子。只知道这些车中有 \(4\) 轮车和 \(6\) 轮车。你需要估计这个车队最少可能有多少车和最多可能有多少车,或判断这是完全不可能的。 观察:\(4x + 6y = n\) ,由裴蜀定理,当 \(2 \mid n\) 有解且 \ ......
Codeforces AvtoBus Round 791 Div

Learning Continuous Image Representation with Local Implicit Image Function

Learning Continuous Image Representation with Local Implicit Image Function(阅读笔记)11.03 局部隐式图像函数(LIIF)表示连续中的图像,可以以任意高分辨率表示。 摘要:如何表示图像?当视觉世界以连续的方式呈现时,机器 ......

Codeforces Round 783 (Div. 2) B. Social Distance

\(m\) 张椅子被顺序排成一个圈,编号从 \(0\) 到 \(n - 1\) , \(n\) 个人打算入座,第 \(i\) 个人希望左右 \(a_i\) 张椅子没有人坐。是否存在满足所有的意愿的情况下可以全部入座。\(n\) 个人不必顺序入座。 观察一:总共有 \(m\) 张椅子,\(n\) 个人 ......
Codeforces Distance Social Round 783

frequently used character, numeric, and date functions

# Character functions ## ANYALNUM(str, startpos) Return position of first occurrence of any alphabetic or numeric value after or at the start postion ......
frequently character functions numeric date

Codeforces Round 897 (Div. 2)

目录写在前面ABCDE1/E2F写在最后 写在前面 比赛地址:https://codeforces.com/contest/1867。 简略题解。 还好没掉分。 A 令原数列中第 \(k\) 大对应 \(k\) 即可。 // /* By:Luckyblock */ #include <bits/st ......
Codeforces Round 897 Div

CodeForces 1801G A task for substrings

洛谷传送门 CF 传送门 区间显然不好处理,考虑转化成前缀和后缀。 设 \(f'_i\) 为 \(T[1 : i]\) 的单词出现次数,\(f_i\) 为 \(f'_i\) 的前缀和,\(g_i\) 为 \(T[1 : i]\) 后缀最长的单词编号。都可以通过建 \(s_i\) 正串的 ACAM 预 ......
CodeForces substrings 1801G 1801 task

遇到错误:ESLint:TypeError:this.libOptions.parse is not a function

遇到错误:ESLint:TypeError:this.libOptions.parse is not a function 打开vue文件之后遇到如下错误: ESLint: TypeError: this.libOptions.parse is not a function 该问题是由 ESLint ......
libOptions TypeError function 错误 ESLint

【题解】Educational Codeforces Round 141(CF1783)

评价:educational A.Make it Beautiful 题目描述: 如果一个数组中存在一个数恰好等于该数前面所有数之和,那么这个数组就是丑的。如果一个数组不是丑的,就是美的。 比如说: 数组 $ [6, 3, 9, 6] $ 是丑的,因为 \(9 = 6 + 3\) ; 数组 $ [5 ......
题解 Educational Codeforces Round 1783

CodeForces 1517F Reunion

洛谷传送门 CF 传送门 典? 考虑枚举 \(r\),算有多少种方案使得,存在一个点,离它最近的黑点距离 \(> r\)。 设 \(f_{u, i}\) 为 \(u\) 子树内离 \(u\) 最近的黑点距离为 \(i\)。如果一个点子树中离它最近的黑点距离 \(> r\),那么它就已经满足子树的限制 ......
CodeForces Reunion 1517F 1517

Educational Codeforces Round 34 (Rated for Div. 2) C(multiset、思维)

C. Boxes Packing 思路:每一次选择一段递增的子段, 将其删除, 最高的一个会能够被看到。这个过程可以用 std::multiset 模拟, 主要是两个函数的应用: extract(x):删除集合中的一个 $ x $,upper_bound(x):返回集合中第一个大于 $ x $ 的元 ......
Educational Codeforces multiset 思维 Round

Codeforces Round 895 (Div. 3)

Codeforces Round 895 (Div. 3) A. Two Vessels 解题思路: \(d = \lceil {\frac {abs(a - b)} 2}\rceil\) \(ans = \lceil {\frac d c}\rceil\) 代码: #include <bits/s ......
Codeforces Round 895 Div

【Azure Function】修改Function执行的Timeout时间

问题描述 Azure Function默认的Timeout时间是否可以调整呢? 问题解答 可以的,根据创建Function的时候选择的定价层不同,Function 默认的Timeout时间也不同。 消耗层的 functionTineout默认是5分钟,最大可修改为10分钟 高级和专用计划的默认值为3 ......
Function Timeout 时间 Azure

Codeforces Round 897 (Div. 2)

Codeforces Round 897 (Div. 2) 比赛链接 A. green_gold_dog, array and permutation 题目 给你一个长度为n的数组a,要求你找出一个数组长度为n的数组b,大小是1-n,保证每个数字出现一次,使得a数组与b数组对应位置上的差值和最大。 ......
Codeforces Round 897 Div

Codeforces Round 897 (Div. 2)

F. Most Different Tree 当 \(n=2\) 时,只能构造一条长度为 \(2\) 的链。 当 \(n\ge 3\) 时,对于 \(i\) \((1\le i\le n)\),以 \(i\) 作为根的树记为 \(h_i\),考虑枚举树找一个大小为 \(s\) 的树 \(t\),使得 ......
Codeforces Round 897 Div

2023-09-12 chooseMedia:fail d.lookup(...).indexOf is not a function ==》上传了接口不支持的图片类型导致,比如你上传了一张.jfif结尾的图片

如题。微信小程序调微信官方上传图片接口报错:chooseMedia:fail d.lookup(...).indexOf is not a function, chooseMedia:fail d.lookup(…).indexOf不是函数。 解决方案:选择其他图片即可,不要上传jfif结尾的图片。 ......
图片 chooseMedia function 接口 indexOf

Codeforces Round 897 (Div. 2)

Codeforces Round 897 (Div. 2) A. green_gold_dog, array and permutation 分析: 由题意: \[c_i = a_i - b_i \]\(c_i\)种类最多就是\(n\)个数都不同。 若\(a_i\)不断变大,\(b_i\)不断变小, ......
Codeforces Round 897 Div

atcode abc318,codeforce 1861

题目链接 题解 目录AtCoder abc318_a Full MoonAtCoder abc318_b Overlapping sheetsAtCoder abc318_c Blue SpringAtCoder abc318_d General Weighted Max MatchingAtCod ......
codeforce atcode 1861 abc 318

Codeforces Round 897 (Div. 2) A~E

Codeforces Round 897 (Div. 2) A~E A: 原先数组里面最小的位置放最大的数,次小的放次大的即可。 void solve(){ int n; cin>>n; for(int i=1;i<=n;i++){ int x; cin>>x; c[i]={x,i}; } sort ......
Codeforces Round 897 Div

Codeforces Round 896 (Div. 2)

Codeforces Round 896 (Div. 2) A. Make It Zero 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using i128 = __int128; int n, m; ......
Codeforces Round 896 Div

[2022 China Collegiate Programming Contest (CCPC) Guilin Site](https://codeforces.com/gym/104008) CEM

2022 China Collegiate Programming Contest (CCPC) Guilin Site CEM C. Array Concatenation 思路:数学推柿子 考虑有两种操作: 复制 \(b' = \{b_1,b_2,...,b_{|b|},b_1,b_2,..., ......

[misc] Functional C++ Programming

Functional C++ Programming Introduction 模板真是个强大的东西,能够在编译期完成很多计算,这里整了一套list编程,有点像Racket和Ocaml里面的stylish List 这个并不难实现,我们可以通过简单的折叠表达式来实现 template <int... ......
Programming Functional misc